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

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.