soru

soru H/L zones

50
shared on Delta's requst:)

hf
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
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)