OPEN-SOURCE SCRIPT

Wave 2 Flat Detection - B Breaks A High, C Breaks A Low

71
//version=5
indicator("Wave 2 Flat Detection - B Breaks A High, C Breaks A Low", overlay=true)

// === Parameters ===
wave1_len = 10 // length of wave 1
a_len = 5 // candles to look for Wave A
b_len = 3 // candles to look for Wave B
c_len = 3 // candles to look for Wave C

// === Detect Wave 1 (upward impulse) ===
wave1_start = low[wave1_len]
wave1_end = high[0]
wave1_valid = wave1_end > wave1_start * 1.05 // 5% move up

// === Wave A ===
a_start = high[wave1_len] // assumed wave 1 top
a_end = low[a_len] // correction low (Wave A end)
wave_a_valid = a_end < a_start

// === Wave B ===
b_high = high[b_len]
wave_b_valid = b_high > a_start // B breaks above A's high

// === Wave C ===
c_low = low[0]
wave_c_break = c_low < a_end // C breaks below A's low

// === Final Condition ===
flat_pattern_confirmed = wave1_valid and wave_a_valid and wave_b_valid and wave_c_break

// === Plot + Alert ===
plotshape(flat_pattern_confirmed, title="Flat Wave 2 Detected", location=location.belowbar, color=color.red, style=shape.labelup, text="C↓")

alertcondition(flat_pattern_confirmed, title="Wave C Breaks Below A", message="Wave C broke below Wave A low — Flat correction confirmed, watch for Wave 3")

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.