TAtrader

Highs & Lows by TaTrader

Hello,

This is my script for H&Ls. I am still working on it.

EDIT: be careful when using it!
It does NOT compare previous H&L levels with those in the making. It can only be used if you hold your positions a long time.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?
study("Highs & Lows by TaTrader", overlay = true)
time = input(title = "Timeframe (minutes)", defval = 240)

// Calculate Highs & Lows
low_m = lowest(low, 30*240/time)
high_m = highest(high, 30*240/time)
low_w = lowest(low, 15*240/time)
high_w = highest(high, 15*240/time)

// Set up Highs & Lows
bottom_m = valuewhen(low <= low_m[1], low, 0)
top_m = valuewhen(high >= high_m[1], high, 0)
bottom_w = valuewhen(low <= low_w[1], low, 0)
top_w = valuewhen(high >= high_w[1], high, 0)

// Draw Highs & Lows
// Important S&R Levels --> extend lines (hline)
plot(bottom_m, color=bottom_m != bottom_m[1] ? na : black, style = cross, linewidth = 2, join = true)
plot(top_m, color=top_m != top_m[1] ? na : black, style = cross, linewidth = 2, join = true)
plot(bottom_w, color=bottom_w != bottom_w[1] ? na : black, style = line, linewidth = 2, join = true)
plot(top_w, color=top_w != top_w[1] ? na : black, style = line, linewidth = 2, join = true)

// Breakthrough signals
plot(bottom_m, color=(close < bottom_m[1]) ? red : na, style = line, linewidth = 2)
plot(top_m, color=(close > top_m[1]) ? green : na, style = line, linewidth = 2)
plot(bottom_w, color=(close < bottom_w[1]) ? red : na, style = line, linewidth = 2)
plot(top_w, color=(close > top_w[1]) ? green : na, style = line, linewidth = 2)

plot(top_m, color=(close > top_m[1]) ? green : na, style = line, linewidth = 2)
plot(bottom_m, color=(close < bottom_m[1]) ? red : na, style = line, linewidth = 2)
plot(top_w, color=(close > top_w[1]) ? green : na, style = line, linewidth = 2)
plot(bottom_w, color=(close < bottom_w[1]) ? red  : na, style = line, linewidth = 2)

// PVT!!!
//plot((high_w - low_w) / (high_m[1] - low_m[1]) * rsi(hlc3, 14), color = black, join = true)