OPEN-SOURCE SCRIPT

HH/HL/LH/LL - Bigger Letter MArking

71
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

免责声明

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.