OPEN-SOURCE SCRIPT
HH/HL/LH/LL - Bigger Letter MArking

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
//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
Script de código abierto
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Exención de responsabilidad
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.
Script de código abierto
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Exención de responsabilidad
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.