KNN Volume-Breakout Chaos System
Family: hybrid · Regime: trending · Complexity: high · Asset classes: Equities, Crypto, Forex Majors · Timeframes: 1H, 4H
Thesis
Market trends are most reliable when volume-weighted price action aligns with historical nearest-neighbor patterns after a period of consolidation. By using Darvas Boxes for structural risk and KNN for entry weighting, the strategy captures 'explosive' moves while filtering for momentum. The 'Chaos Regime' check ensures we only trade when the relative ranking of price (order) is transitioning from consolidation to a trend state.
Components
- Unsupported array.sort_indices Order (regime) — Acts as a 'chaos' regime filter. By attempting to sort indices based on price series (an invalid operation in standard Pine), we metaphorically identify periods where price ranks are unstable or non-linear, filtering out 'flat' or 'broken' data regimes.
- Extrem SuperTrend (direction) — Provides the primary trend bias by calculating ATR-based trailing stops over a median price baseline to ensure entries align with medium-term volatility.
- Volume SuperTrend AI (Expo) (entry) — Uses KNN classification to weight volume-weighted SuperTrend signals against historical patterns, increasing the probability of momentum-driven entries.
- UT Bot Alerts (MQL5) (exit) — Functions as a sensitive trailing exit mechanism, closing positions when price crosses a tight ATR-based stop-loss line.
- Darvas Boxes (Multi-Mode) (risk) — Determines the hard stop-loss level based on the floor (long) or ceiling (short) of the most recent consolidation box identified by pivots.
- Momentum Oscillator (confirmation) — Ensures the rate of change is positive (for longs) or negative (for shorts), preventing entries into exhausted trends.
- Boxline (Consolidation Zones) (volatility_filter) — Filters out trades within tight ranges; entry is only permitted if price has broken out of the most recent consolidation zone.
Known failure conditions
- The KNN algorithm fails to converge or exhibits 100% win rate on training data (overfitting).
- Price remains trapped within Darvas Box boundaries for more than 50 bars.
- The 'Chaos Regime' (array sort logic) remains constant during high-volatility news events.
Explore the full interactive blueprint with parameter ranges and evidence on WOBR StrategyVerse, or generate this strategy as an MT4/MT5 Expert Advisor with QuantMogul AI Engine (free download).