soru

soru H/L zones

50
shared on Delta's requst:)

hf
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
study("soru H/L zones", "soru H/L zones", overlay=true)

//inputs
h_left1 = input(title="H left 1", type=integer, defval=30)
h_left2 = input(title="H left 2", type=integer, defval=90)
h_left3 = input(title="H left 3", type=integer, defval=240)
h_left4 = input(title="H left 4", type=integer, defval=480)
show_channel1 = input(title="Show channel 1", type=bool, defval=true)
show_channel2 = input(title="Show channel 2", type=bool, defval=true)
show_channel3 = input(title="Show channel 3", type=bool, defval=true)
show_channel4 = input(title="Show channel 4", type=bool, defval=true)

h_left_low1 = lowest(h_left1)
h_left_low2 = lowest(h_left2)
h_left_low3 = lowest(h_left3)
h_left_low4 = lowest(h_left4)
h_left_high1 = highest(h_left1)
h_left_high2 = highest(h_left2)
h_left_high3 = highest(h_left3)
h_left_high4 = highest(h_left4)
newlow1 = low <= h_left_low1
newlow2 = low <= h_left_low2
newlow3 = low <= h_left_low3
newlow4 = low <= h_left_low4
newhigh1 = high >= h_left_high1
newhigh2 = high >= h_left_high2
newhigh3 = high >= h_left_high3
newhigh4 = high >= h_left_high4

channel_high1 = plot(show_channel1 ? h_left_low1 : 0, color=black)
channel_low1 = plot (show_channel1 ? h_left_high1 : 0, color=black)
//fill(channel_high, channel_low, color=gray, transp=70)
channel_high2 = plot(show_channel2 ? h_left_low2 : 0, color=black)
channel_low2 = plot (show_channel2 ? h_left_high2 : 0, color=black)
channel_high3 = plot(show_channel3 ? h_left_low3 : 0, color=black)
channel_low3 = plot (show_channel3 ? h_left_high3 : 0, color=black)
channel_high4 = plot(show_channel4 ? h_left_low4 : 0, color=black)
channel_low4 = plot (show_channel4 ? h_left_high4 : 0, color=black)