Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. //@version=3
  2. //@Author: Bitcoin_O_Plomo
  3.  
  4. //This indicator was made to allow three moving averages to be displayed without needing to use up 3 charting indicators individually
  5.  
  6. study(title="2-Year MA Multiplier", shorttitle="2Y-MA", overlay=true)
  7.  
  8. // Checkbox's for the other 2 MA's
  9. a = input(true, title="Enable 2nd SMA")
  10. b = input(true, title="Enable 3rd SMA")
  11.  
  12. len = input(730, minval=1, title="Length")
  13. len2 = input(730, minval=1, title="Length2")
  14.  
  15.  
  16. src = input(close, title="Source")
  17. src2 = input(close, title="Source2")
  18.  
  19.  
  20. out = sma(src, len)
  21. out2 = sma(src2 * 5 , len2)
  22.  
  23.  
  24. plot(out, title="SMA", color=red)
  25. plot(a and out2 ? out2: na, title="SMA2", color=green)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement