Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. //Inputs
  2. multi1 = input(title="Multiplier 1", type=input.float, step=0.1, defval=3, minval=1)
  3. period1 = input(title="Period 1", type=input.integer, step=1, defval=10, minval=1)
  4. multi2 = input(title="Multiplier 2", type=input.float, step=0.1, defval=6, minval=1)
  5. period2 = input(title="Period 2", type=input.integer, step=1, defval=10, minval=1)
  6.  
  7. [st_line1, trend1] = getSuperTrend(multi1, period1)
  8. [st_line2, trend2] = getSuperTrend(multi2, period2)
  9. [st_line3, trend3] = getSuperTrend(multi1, period1) and (multi2, period2)
  10.  
  11.  
  12. // Plotting
  13. plot1 = plot(st_line1, color = trend1 == 1 ? color.green : color.red, style = plot.style_line, linewidth = 1, title = "SuperTrend 1")
  14. plot2 = plot(st_line2, color = trend2 == 1 ? color.green : color.red, style = plot.style_line, linewidth = 1, title = "SuperTrend 2")
  15. plot3 = plot(st_line1 + st_line2, color = trend3 == 1 ? color.yellow : color.blue, style = plot.style_line, linewidth = 1, title = "SuperTrend 3")
  16. fill(plot1, plot2, color = color.aqua, title = "Cloud")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement