How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Feature Request FAQ Help & Wiki Twitter

# KDJ Indicator - @iamaltcoin,modified by Yanga

144 2
KDJ Indicator - @iamaltcoin,modified by Yanga
```//
// @author bitcoinwisdom, modified by Yanga
//
// This KDJ indicator is a mimic of the same indicator on bitcoinwisdom
//
// This script is released free of charge with no warranty
// Please leave a not to the author of this script if it is used
// whole or in part
//
study("KDJ Indicator - @iamaltcoin,modified by Yanga", shorttitle="KDJ_Yanga")
ilong = input(9, title="period")
isigK = input(3, title="signal K")
isigD = input(3, title="signal D")

bcwsma(s,l,m) =>
_s = s
_l = l
_m = m
_bcwsma = (_m*_s+(_l-_m)*nz(_bcwsma[1]))/_l
_bcwsma

c = close
h = highest(high, ilong)
l = lowest(low,ilong)
RSV = 100*((c-l)/(h-l))
pK = sma(RSV, isigK)
pD = sma(pK, isigD)
pJ = 3 * pK-2 * pD

plot(pK, color=orange)
plot(pD, color=lime)
plot(pJ, color=fuchsia)
h0 = hline(80)
h1 = hline(20)
h2 = hline(100)
h3 = hline(0)
bgcolor(pJ>pD? green : red, transp=70)```
On this line of code: what the slm stands for? bcwsma(s,l,m). Thanks.
syracusepro
well, s is signal, l is the length or number of periods, and m is the weighting. In principle, it is from the weighted moving average function y=(m*x+(l-m)*y')/l, where y' denotes the y value in its previous period. This code is just from the math book and also from the author bitcoinwisdom, no creative :). And here you can alternatively use the bcwsma instead of sma, or you just still use sma. This change will make curves different. Maybe could get something from this change in different cases. Hope my answer is fit your question :)
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia

한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter