Advertisement
Guest User

Color Coded SMIIO [LazyBear]

a guest
Aug 3rd, 2014
9,281
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. //
  2. // @author LazyBear
  3. // Coded for @Drat
  4. //
  5. study(title="Color Coded SMIIO [LazyBear]", shorttitle="SMIIOColors_LB")
  6. shortlen = input(10, minval=1, title="Short Period")
  7. longlen = input(4, minval=1, title="Long Period")
  8. siglen = input(10, minval=1, title="Signal Line Period)")
  9. sigInsteadOfOsc=input(false, type=bool)
  10.  
  11. src=close
  12. erg = tsi(src, shortlen, longlen)
  13. sig = ema(erg, siglen)
  14. osc = erg - sig
  15.  
  16. plot(sigInsteadOfOsc ? sig : na, color=(sig > 0) ? ((sig > sig[1]) ? green : orange) : ((sig < sig[1]) ? red : orange), style=histogram, title="SignalHist", linewidth=2)
  17. plot(not sigInsteadOfOsc ? osc : na, color=(osc > 0) ? ((osc > osc[1]) ? green : orange) : ((osc < osc[1]) ? red : orange), style=histogram, title="OscHist", linewidth=2)
  18. //plot(osc, color=yellow, style=histogram, linewidth=2, title="Indicator")
  19. plot(sig, color=orange, title="Signal")
  20. plot(erg, color=aqua, title="Indicator")
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement