OPEN-SOURCE SCRIPT

HH/HL/LH/LL - Bigger Letter MArking

72
Alam's Money
//version=6
indicator("HH/HL/LH/LL - Clean Letters Only", overlay = true, max_labels_count = 500)

// Pivot confirmation bars (fixed)
L = 2
R = 2

// Confirmed pivots (appear R bars after turn)
sh = ta.pivothigh(high, L, R)
sl = ta.pivotlow(low, L, R)

// Keep last confirmed swing values
var float lastHigh = na
var float lastLow = na

// Swing highs → HH / LH
if not na(sh)
if na(lastHigh)
lastHigh := sh
else
string txtH = sh > lastHigh ? "HH" : "LH"
label.new(bar_index - R, sh, txtH, xloc.bar_index, yloc.price, color.new(color.white, 100), label.style_label_down, color.red, size.large)
lastHigh := sh

// Swing lows → HL / LL
if not na(sl)
if na(lastLow)
lastLow := sl
else
string txtL = sl > lastLow ? "HL" : "LL"
label.new(bar_index - R, sl, txtL, xloc.bar_index, yloc.price, color.new(color.white, 100), label.style_label_up, color.green, size.large)
lastLow := sl

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.