Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. //
  2. // @author iamaltcoin
  3. //
  4. // This KDJ indicator is a mimic of the same indicator on bitcoinwisdom
  5. //
  6. // This script is released free of charge with no warranty
  7. // Please leave a not to the author of this script if it is used
  8. // whole or in part
  9. //
  10. strategy("KDJ Indicator - @iamaltcoin", shorttitle="GM_V2_KDJ")
  11. ilong = input(9, title="period")
  12. isig = input(3, title="signal")
  13.  
  14. bcwsma(s,l,m) =>
  15. _s = s
  16. _l = l
  17. _m = m
  18. _bcwsma = (_m*_s+(_l-_m)*nz(_bcwsma[1]))/_l
  19. _bcwsma
  20.  
  21. c = close
  22. h = highest(high, ilong)
  23. l = lowest(low,ilong)
  24. RSV = 100*((c-l)/(h-l))
  25. pK = bcwsma(RSV, isig, 1)
  26. pD = bcwsma(pK, isig, 1)
  27. pJ = 3 * pK-2 * pD
  28.  
  29. plot(pK, color=orange)
  30. plot(pD, color=lime)
  31. plot(pJ, color=fuchsia)
  32.  
  33. trade_size = 3
  34.  
  35. bgcolor(pJ>pD? green : red, transp=70)
  36. strategy.entry("buy", strategy.long, trade_size, when=strategy.position_size <= 0)
  37. strategy.exit("bracket1", "buy", trade_size, profit=75, stop=75)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement