Range Compression and Expansion Strategy by AIScripts
By AIScripts
Performance Metrics
- Author: AIScripts
- Symbol: BIVA:GME
- Timeframe: 1 minute
- Net P&L: +878.27 MXN (+0.88%)
- Win Rate: 44.4%
- Profit Factor: 1.615
- Max Drawdown: 551.69 MXN (0.54%)
- Total Trades: 27
Description
What This Strategy Focuses OnMarkets don’t move randomly all the time. They often alternate between quiet phases (low volatility, tight candles) and expansion phases (strong directional moves).This strategy is built around that idea. It identifies periods where price is compressed into a tight range and waits for a confirmed breakout before entering a trade.How It Works1. Detecting CompressionThe script measures volatility using ATR.When ATR drops below its recent average, the market is considered compressedThis usually means price is building up for a moveInstead of relying on indicators like Bollinger Bands, this uses pure volatility contraction + price structure.2. Defining the RangeDuring compression, the script tracks:Highest high (resistance)Lowest low (support)This creates a clear structure zone.3. Expansion BreakoutTrades are triggered when price breaks out of that range:Break above range → potential bullish expansionBreak below range → potential bearish expansionOnly confirmed breakouts are considered.4. Risk ManagementThe strategy uses ATR for exits:Stop-loss adapts to volatilityTake-profit is based on a fixed risk-to-reward ratioThis keeps behavior consistent across different markets.Key CharacteristicsFocuses on volatility shifts (calm → expansion)Uses structure instead of indicator-heavy logicWorks on crypto, forex, and stocksDesigned for testing and refinementWhen It May Work BetterBefore strong trending movesDuring breakout phasesAfter long consolidation periodsIt may produce fewer signals in already trending markets.Important NoteThis script is for testing and educational use. Results depend on market conditions and settings. Always test across multiple assets and timeframes.If you want to push this furtherYou can upgrade this idea by adding:trend filter (EMA or HTF bias)volume spike confirmationsession-based filteringfake breakout detection