OPEN-SOURCE SCRIPT

Advanced Breakout System v2.0

238
Advanced Breakout System v2.0
Developed by: Mohammed Bedaiwi

This script hunts for high-probability breakouts by combining price consolidation zones, volume spikes vs. average volume, smart money flow (OBV), and a Momentum Override for explosive moves that skip consolidation. Additionally, it automatically identifies and plots Support and Resistance levels with price labels to help you visualize market structure.

The system follows a "Watch & Confirm" logic: it first prints a WATCH setup, then a BUY only if price confirms strength.

💡 JUSTIFICATION OF CONCEPTS (MASHUP & ORIGINALITY)

This script is an original mashup combining several analytical concepts to address common breakout failures:
  1. Volatility Compression Engine: Uses built-in functions like ta.highest() and ta.lowest() to mathematically define the setup phase where price volatility is compressed below a user-defined threshold.

  2. Volume Spike Confirmation: The breakout must be confirmed by a volume increase greater than a moving average of volume, signaling strong market interest.

  3. Smart Volume Filter (OBV): This is the key component. By checking if ta.obv is above its own Moving Average, we confirm that accumulation has been occurring during the consolidation period, suggesting institutional positioning before the price break.

  4. Multi-Exit Risk System: Employs dynamic exits (EMA cross, volume dump, bearish pattern) instead of static stop-losses to manage risk adaptively based on real-time market action.

  5. Market Structure Visualization: The script also includes a Support & Resistance engine to plot key swing pivots and price labels for visual context.

✅ STRATEGY RESULTS & POLICY COMPLIANCE

To ensure non-misleading and transparent backtesting results, this strategy is published with the following fully compliant properties:
  • Dataset Compliance: The backtest is performed on the CMTL Daily (1D) chart across a long history, generating 201 total trades. This significantly exceeds the minimum requirement of 100 trades, providing a robust test dataset.

  • Risk Control: The strategy uses a conservative order size set to 2% of equity (default_qty_value=2), strictly adhering to the sustainable risk recommendation of 5-10% of equity per trade.

  • Transaction Costs: Realistic trading conditions are modeled using 0.07% commission and 3 ticks slippage to prevent the overestimation of profitability.

⚙️ VISUAL GUIDE & SIGNAL LOGIC

Key Color Legend (Visual Guide):
  • WATCH – Setup (Yellow Arrow Down): Potential breakout setup detected.

  • BUY – Confirmation (Green Arrow Up): Confirmed breakout, triggered when price trades above the high of the WATCH candle.

  • SELL – Break (Orange Arrow): Short-term trend weakness, triggered when price closes below the Fast EMA (9).

  • SELL – Dump (Dark Red Arrow): Distribution / volume dump, triggered by a bearish candle with abnormally high volume.

  • SELL – Pattern (Purple Arrow): Bearish price-action pattern (such as a bearish engulfing).

  • Support & Resistance Lines (Red/Green): Small horizontal lines plotted at key swing points with exact price labels.

⌨️ INPUTS (DEFAULT SETTINGS)
  • Entry settings: Consolidation Lookback (default 20) = bars used to detect consolidation. Consolidation Range % (default 12%) = max allowed range size. Volume Spike Multiplier (default 1.2) = factor above average volume to count as a spike. Force Signal on Big Moves (default ON) = forces a WATCH signal on high-momentum moves.

  • Exit settings: Enable Fast Exit (EMA 9) toggles the SELL – Break signal. Dump Volume Multiplier defines what counts as “dump” volume.

  • Support & Resistance: Adjustable Pivot Left/Right bars control the sensitivity of the support and resistance lines.

⚠️ Disclaimer Trading involves significant risk of loss. This script is for educational and informational purposes only and is not financial advice or a recommendation to buy or sell any asset. BUY and SELL signals are rule-based and derived from historical behavior and do not guarantee future performance. Always use your own analysis and risk management. This is an open-source strategy; users are encouraged to test it across different symbols and timeframes.

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.