TAtrader

HL&SR levels by TaTrader

11
Hello,

I am still working on this. It doesn't work that well for now.
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?
study(title = "HLSR levels by TaTrader", overlay = true)

////Calculate and set Highs & Lows////
time = input(title = "Timeframe (minutes)", defval = 240)

////Calculate and set Highs & Lows////

// weekly
//s2 = hlc3_w[1]-(high_w[1]-low_w[1])
s1 = hlc3_w[1]+hlc3_w[1]-high_w[1]
pp = sma(hlc3[1], 4*7200/time)
r1 = hlc3_w[1]+hlc3_w[1]-low_w[1]
//r2 = hlc3_w[1]+(high_w[1]-low_w[1])

low_w = lowest(low, 4*7200/time)
high_w = highest(high, 4*7200/time)
hlc3_w = sma(hlc3, 4*7200/time)
low_w_new = valuewhen(low <= low_w[1], low, 0)
high_w_new = valuewhen(high >= high_w[1], high, 0)
bottom_w_min = valuewhen(low_w_new <= lowest(low, 4*7200/time), low_w, 0)
//bottom_w_max = valuewhen(low_w_new <= lowest(high, 4*7200/time)[1], high, 0)
//top_w_min = valuewhen(high_w_new >= highest(low, 4*7200/time)[1], low, 0)
top_w_max = valuewhen(high_w_new >= highest(high, 4*7200/time), high_w, 0)

bottom_w = valuewhen(low[1] <= s1 and low[1] <= pp, low, 0)
top_w = valuewhen(high[1] >= r1 and high[1] >= pp, high, 0)

// plot static levels
W_bottom = plot(lowest(bottom_w_min, 4*7200/time), color = black, style = line, linewidth = 2)
//W_bottom_max = plot(lowest(bottom_w_max, 4*7200/time)[1], color = black, style = line, linewidth = 1)
//W_top_min = plot(highest(top_w_min, 4*7200/time)[1], color = black, style = line, linewidth = 1)
W_top = plot(highest(top_w_max, 4*7200/time), color = black, style = line, linewidth = 2)

// plot dynamic levels
//W_s2 = plot(s2, color = black, style = line, linewidth = 1)
//W_s1 = plot(s1, color = #0059FF, style = cross, linewidth = 2)
W_pp = plot(pp, color = #0059FF, style = line, linewidth = 2)
//W_r1 = plot(r1, color = #0059FF, style = cross, linewidth = 2)
//W_r2 = plot(r2, color = black, style = line, linewidth = 1)

W_bottom2 = plot(bottom_w, color = black, style = line, linewidth = 2)
W_top2 = plot(top_w, color = black, style = line, linewidth = 2)

// Combine lines
//fill(W_s2, W_s1, color = #FFFF00, transp = 70)
fill(W_bottom, W_bottom2, color = #008000, transp = 80)
//fill(W_bottom, W_bottom_max, color = #008000, transp = 80)
//fill(W_top_min, W_top, color = #FF0000, transp = 80)
fill(W_top, W_top2, color = #FF0000, transp = 80)
//fill(W_r2, W_r1, color = #FFFF00, transp = 70)


// Trending market: find a signal!