Breakout Swing High Low

How It Works
Swing Detection: The indicator uses a user-defined lookback period (default: 4 candles) to identify swing highs (peaks) and swing lows (troughs). A swing high is confirmed when a candle's high is higher than the surrounding candles, and a swing low is confirmed when a candle's low is lower.
Breakout Signals: A green triangle below the candle signals a breakout above the most recent swing high, indicating a potential buy opportunity. A red triangle above the candle signals a breakout below the most recent swing low, indicating a potential sell opportunity. Each swing level triggers only one breakout signal to avoid clutter.
Visualization: Swing high levels are drawn as green dashed lines, and swing low levels as red dashed lines, extending 15 candles for clarity. Breakout signals are marked with small triangles.
How to Use
Apply the Indicator: Add the indicator to your TradingView chart.
Adjust Lookback: Set the "Lookback Candles" input (default: 4) to control the sensitivity of swing detection. Smaller values detect shorter-term swings, while larger values identify more significant levels.
Interpret Signals:
Green triangle (below candle): Consider a buy opportunity when price breaks above a swing high.
Red triangle (above candle): Consider a sell opportunity when price breaks below a swing low.
Combine with Other Tools: Use in conjunction with trend indicators (e.g., 50-period EMA) or support/resistance levels to filter signals in trending markets.
Timeframes: Works best on higher timeframes (e.g., 1H, 4H) in trending markets to avoid false breakouts in sideways conditions.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.