Volatility Expansion Strategy 30M [MNQ] by ZenOutMan
By ZenOutMan
Performance Metrics
- Author: ZenOutMan
- Symbol: CME_MINI:MNQ1!
- Timeframe: 30 minutes
- Net P&L: +10,786.50 USD (+10.77%)
- Win Rate: 38.5%
- Profit Factor: 1.221
- Max Drawdown: 6,083.00 USD (5.37%)
- Total Trades: 483
Description
This script is designed to exploit the cyclical nature of market volatility—specifically the transition from "coiling" phases (low volatility) to "expansion" phases (high volatility). Here is the technical breakdown of how the engine handles the data:The Mathematical Core: The Volatility RatioInstead of looking at raw price, the script calculates a Volatility Ratio. This is the core engine:volRatio = ta.atr(20) / ta.sma(ta.atr(20), 40)We are comparing a short-term volatility window (20 periods) against a long-term baseline (40 periods).The Squeeze ($ 1.02$): We look for a 2% increase in relative volatility to confirm that the "spring" has been released.Level Locking & Execution LogicMost breakout strategies fail because they buy any high/low. This script uses Conditional Level Locking:While isCompressed is true, the script continuously updates breakoutHigh and breakoutLow to the high/low of the current bar.The moment the market leaves the squeeze phase, those levels "freeze."The Trigger: A trade is only executed if we have a volatility expansion (volRatio > 1.02) occurring simultaneously with a price crossover of those frozen levels. This ensures we aren't just buying a slow drift, but a high-velocity move.Risk & PrecisionFor a fast instrument like MNQ, fixed price stops often fail due to slippage. I’ve programmed this to use Tick-Based Offsets. The risk is calculated dynamically using ATR \times 1.5$, then converted into the smallest possible unit of movement (ticks). This ensures that the strategy.exit orders are hard-coded into the broker's matching engine the millisecond you enter, protecting you from "stuck" trades during high-volatility spikes.