Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Inputs
- multi1 = input(title="Multiplier 1", type=input.float, step=0.1, defval=3, minval=1)
- period1 = input(title="Period 1", type=input.integer, step=1, defval=10, minval=1)
- multi2 = input(title="Multiplier 2", type=input.float, step=0.1, defval=6, minval=1)
- period2 = input(title="Period 2", type=input.integer, step=1, defval=10, minval=1)
- [st_line1, trend1] = getSuperTrend(multi1, period1)
- [st_line2, trend2] = getSuperTrend(multi2, period2)
- [st_line3, trend3] = getSuperTrend(multi1, period1) and (multi2, period2)
- // Plotting
- plot1 = plot(st_line1, color = trend1 == 1 ? color.green : color.red, style = plot.style_line, linewidth = 1, title = "SuperTrend 1")
- plot2 = plot(st_line2, color = trend2 == 1 ? color.green : color.red, style = plot.style_line, linewidth = 1, title = "SuperTrend 2")
- plot3 = plot(st_line1 + st_line2, color = trend3 == 1 ? color.yellow : color.blue, style = plot.style_line, linewidth = 1, title = "SuperTrend 3")
- fill(plot1, plot2, color = color.aqua, title = "Cloud")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement