OPEN-SOURCE SCRIPT
Breakout Strategy with Dynamic SL Label

Description:
This script identifies breakout trading opportunities using adaptive support and resistance levels, adjusted dynamically based on market volatility. A trade signal is generated only when a breakout candle is followed by a confirming close in the same direction. The signal is displayed on the chart as a labeled marker that includes a suggested stop-loss level based on the highest high or lowest low of the past 10 bars, ensuring structure-aware risk management.
🧩 How it Works:
Adaptive S/R Zones: Based on volatility-normalized swing highs/lows using ATR. These zones automatically adjust to changing market conditions.
Confirmation Logic: Trade signals only appear after the second candle confirms the breakout, helping reduce false signals.
Single Signal Rule: Only one buy or sell label is printed per breakout level, avoiding repeated triggers.
Embedded Stop Loss in Label: SL value is calculated from the 10-bar high (for shorts) or low (for longs) and included in the signal label.
⚙️ User Inputs Explained:
Base Swing Strength: Controls the pivot sensitivity; higher values detect stronger reversal points.
Line Duration: Number of bars that horizontal S/R levels remain visible.
ATR Period: Length used to calculate volatility for adaptive S/R logic.
Volatility Sensitivity: Adjusts how responsive the S/R zone strength is to volatility. Higher = more responsive.
Stop-Loss Lookback (Bars): Defines the number of candles to reference when calculating SL from high/low structure.
Max Lines Stored: Controls chart clutter by limiting how many S/R zones are kept active.
🟩 Ideal for:
Breakout traders who value clean structure, confirmation, and built-in risk logic.
Scalpers and swing traders looking for adaptive, low-latency signals without repainting.
Chartists who want minimal indicators but maximum signal clarity.
This script identifies breakout trading opportunities using adaptive support and resistance levels, adjusted dynamically based on market volatility. A trade signal is generated only when a breakout candle is followed by a confirming close in the same direction. The signal is displayed on the chart as a labeled marker that includes a suggested stop-loss level based on the highest high or lowest low of the past 10 bars, ensuring structure-aware risk management.
🧩 How it Works:
Adaptive S/R Zones: Based on volatility-normalized swing highs/lows using ATR. These zones automatically adjust to changing market conditions.
Confirmation Logic: Trade signals only appear after the second candle confirms the breakout, helping reduce false signals.
Single Signal Rule: Only one buy or sell label is printed per breakout level, avoiding repeated triggers.
Embedded Stop Loss in Label: SL value is calculated from the 10-bar high (for shorts) or low (for longs) and included in the signal label.
⚙️ User Inputs Explained:
Base Swing Strength: Controls the pivot sensitivity; higher values detect stronger reversal points.
Line Duration: Number of bars that horizontal S/R levels remain visible.
ATR Period: Length used to calculate volatility for adaptive S/R logic.
Volatility Sensitivity: Adjusts how responsive the S/R zone strength is to volatility. Higher = more responsive.
Stop-Loss Lookback (Bars): Defines the number of candles to reference when calculating SL from high/low structure.
Max Lines Stored: Controls chart clutter by limiting how many S/R zones are kept active.
🟩 Ideal for:
Breakout traders who value clean structure, confirmation, and built-in risk logic.
Scalpers and swing traders looking for adaptive, low-latency signals without repainting.
Chartists who want minimal indicators but maximum signal clarity.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
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.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
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.