Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // @author iamaltcoin
- //
- // 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
- //
- strategy("KDJ Indicator - @iamaltcoin", shorttitle="GM_V2_KDJ")
- ilong = input(9, title="period")
- isig = input(3, title="signal")
- 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 = bcwsma(RSV, isig, 1)
- pD = bcwsma(pK, isig, 1)
- pJ = 3 * pK-2 * pD
- plot(pK, color=orange)
- plot(pD, color=lime)
- plot(pJ, color=fuchsia)
- trade_size = 3
- bgcolor(pJ>pD? green : red, transp=70)
- strategy.entry("buy", strategy.long, trade_size, when=strategy.position_size <= 0)
- strategy.exit("bracket1", "buy", trade_size, profit=75, stop=75)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement