OPEN-SOURCE SCRIPT
Decoded Volatility Expansion [Ahtisham]

The Decoded Volatility Expansion engine is built on the principle of Market Compression vs. Expansion. Markets spend the majority of their time in a state of "Consolidation Noise." This strategy is designed to ignore that noise and only commit capital when volatility breaks a specific mathematical threshold—effectively "decoding" the moment a range expansion begin
CORE MECHANICS
The system utilizes a dynamic "Consolidation Box" to map institutional equilibrium before placing strategic stop-entry orders:
Volatility Decoding (ATR-Outlier): Unlike standard breakout bots, this engine uses an ATR-based multiplier to identify "Outlier Volatility." It sets entry triggers beyond the normal noise floor.
Equilibrium Mid-Line: The strategy identifies the zoneMid (Point of Control) of the recent consolidation. This acts as our "Gravity Point" for stop-loss placement, ensuring we exit if the breakout fails to sustain momentum.
Expansion Triggers: The system places passive Stop Orders (Aqua for Long, Orange for Short). These are only filled if the market demonstrates an aggressive expansion state.
Asymmetric Risk Management: Uses a customizable Reward-to-Risk (RR) ratio (Default 2.0) to ensure that winning expansions significantly outweigh "Fakeout" losses.
🎨 VISUAL INTELLIGENCE
The script features a high-fidelity "Hybrid Visual" interface:
The Gray Consolidation Box: A real-time visual representation of the current "Lookback" range being analyzed.
Expansion Labels: Clean, bold labels ("EXPANSION BUY/SELL") trigger at the exact moment of the volatility breakout.
Static Midline: A bold white axis representing the market's fair-value equilibrium during the consolidation phase.
Aqua/Orange Axis: Real-time tracking of the volatility-adjusted trigger levels.
📊 TECHNICAL SPECIFICATIONS
Strategy Type: Volatility Breakout / Momentum Expansion.
Instruments: Highly optimized for XAU/USD (Gold), BTC/USD, and high-beta Equities.
Timeframe: 15m (Scalp/Intraday) or 1H (Swing).
Execution: Orders utilize process_orders_on_close=true for realistic backtesting and to eliminate "repainting" illusions.
🛠️ HOW TO USE
Identify the Box: Observe the gray consolidation zone. This is where the engine is "Decoding" the current volatility.
Monitor the Triggers: Watch the Aqua (Upper) and Orange (Lower) lines. The closer price gets to these lines, the closer the system is to an "Armed" expansion state.
Risk Calibration: Adjust the Outlier Multiplier (default 1.5). Increase it for highly volatile news events to avoid "whipsaws," or decrease it for tighter, low-volatility sessions.
Target Setting: Set your Target Profit based on your specific asset's average daily range (ADR).
📜 VERSION HISTORY
V1.0 (Current): Initial release of the Decoded Expansion Engine with V6 syntax and hybrid visual labels.
⚖️ DISCLAIMER
This is a quantitative strategy for educational and research purposes. Trading high-volatility assets like Gold or Crypto involves significant risk. Always utilize proper position sizing and risk management.
Author: AHTISHAM_EE
Version: PineScript v6
CORE MECHANICS
The system utilizes a dynamic "Consolidation Box" to map institutional equilibrium before placing strategic stop-entry orders:
Volatility Decoding (ATR-Outlier): Unlike standard breakout bots, this engine uses an ATR-based multiplier to identify "Outlier Volatility." It sets entry triggers beyond the normal noise floor.
Equilibrium Mid-Line: The strategy identifies the zoneMid (Point of Control) of the recent consolidation. This acts as our "Gravity Point" for stop-loss placement, ensuring we exit if the breakout fails to sustain momentum.
Expansion Triggers: The system places passive Stop Orders (Aqua for Long, Orange for Short). These are only filled if the market demonstrates an aggressive expansion state.
Asymmetric Risk Management: Uses a customizable Reward-to-Risk (RR) ratio (Default 2.0) to ensure that winning expansions significantly outweigh "Fakeout" losses.
🎨 VISUAL INTELLIGENCE
The script features a high-fidelity "Hybrid Visual" interface:
The Gray Consolidation Box: A real-time visual representation of the current "Lookback" range being analyzed.
Expansion Labels: Clean, bold labels ("EXPANSION BUY/SELL") trigger at the exact moment of the volatility breakout.
Static Midline: A bold white axis representing the market's fair-value equilibrium during the consolidation phase.
Aqua/Orange Axis: Real-time tracking of the volatility-adjusted trigger levels.
📊 TECHNICAL SPECIFICATIONS
Strategy Type: Volatility Breakout / Momentum Expansion.
Instruments: Highly optimized for XAU/USD (Gold), BTC/USD, and high-beta Equities.
Timeframe: 15m (Scalp/Intraday) or 1H (Swing).
Execution: Orders utilize process_orders_on_close=true for realistic backtesting and to eliminate "repainting" illusions.
🛠️ HOW TO USE
Identify the Box: Observe the gray consolidation zone. This is where the engine is "Decoding" the current volatility.
Monitor the Triggers: Watch the Aqua (Upper) and Orange (Lower) lines. The closer price gets to these lines, the closer the system is to an "Armed" expansion state.
Risk Calibration: Adjust the Outlier Multiplier (default 1.5). Increase it for highly volatile news events to avoid "whipsaws," or decrease it for tighter, low-volatility sessions.
Target Setting: Set your Target Profit based on your specific asset's average daily range (ADR).
📜 VERSION HISTORY
V1.0 (Current): Initial release of the Decoded Expansion Engine with V6 syntax and hybrid visual labels.
⚖️ DISCLAIMER
This is a quantitative strategy for educational and research purposes. Trading high-volatility assets like Gold or Crypto involves significant risk. Always utilize proper position sizing and risk management.
Author: AHTISHAM_EE
Version: PineScript v6
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.