Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. //@version=4
  2. study(title="Moving Average Field++", shorttitle="MA-field++", overlay=true)
  3. len = input(60, minval=1, title="Length")
  4. src = input(close, title="Source")
  5. out = sma(src, len)
  6. len2 = input(360, minval=1, title="360Length")
  7. out2 =sma(src, len2)
  8. len3 = input(2160, minval=1, title="1260length")
  9. out3 =sma(src, len3)
  10.  
  11. p1 = plot(out, color=blue, transp=100, title="MA")
  12. p2 = plot(out2, color=yellow, transp=100, title="OMA")
  13. p3 = plot(out3, color=yellow, transp=100, title="GMA")
  14.  
  15. fillColor = out > out2 ? green : red
  16. fill(p1, p2, color=fillColor, transp=75)
  17. fillColor2 = out2 > out3 ? green : red
  18. fill(p2, p3, color=fillColor2, transp=90)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement