← Back to Reviews

20260114_053022_hhhl_swing_structure_sol.md

# AI Review: hhhl_swing_structure_sol **Date:** Wed Jan 14 05:30:22 CET 2026 **Strategy File:** /root/trade_rules/strategies/hhhl_swing_structure_sol.py --- ```json { "score": 78, "flags": ["complexity", "concentration"], "review": "## Strategy Quality Assessment\n\n### Strengths\n\n✓ **Clean execution model**: Trades on next bar open, no same-candle execution issues\n\n✓ **Proper warmup**: 200 bars matches EMA200 requirement\n\n✓ **Relative indicators only**: Uses EMA ratios, swing patterns, no hardcoded price levels\n\n✓ **Round parameters**: swing_period=3, lookback=40, standard EMA periods (20/50/200)\n\n✓ **Regime awareness**: Uses EMA50/EMA200 crossover to filter trade direction\n\n✓ **Volume confirmation**: 1.2x multiplier adds execution realism\n\n✓ **No lookahead bias**: All calculations use historical data only\n\n✓ **Reasonable risk management**: 5% stop, 10% target = 2:1 R:R\n\n✓ **Role-appropriate metrics**: Momentum role allows for drawdown range observed\n\n### Concerns\n\n⚠ **Complexity (6+ entry conditions)**: The strategy violates the 5-6 condition limit:\n- LONG requires: bullish_regime + higher_high + higher_low + close > swing_high + close > EMA20 + volume > threshold = **6 conditions**\n- SHORT requires: bearish_regime + lower_high + lower_low + close < swing_low + close < EMA20 + volume > threshold = **6 conditions**\n\nWhile technically at the boundary, the swing point detection itself adds hidden complexity (nested loops, lookback scanning). This increases overfitting risk.\n\n⚠ **Year-over-year inconsistency**: Returns show concerning concentration:\n- 2025 generates 57.7% (more than 3x next best year)\n- First half of 2024 (included in train) shows modest 15.8%\n- 2021-2022 shows identical 14.2% returns (likely same market regime)\n\nThis pattern suggests the validation period (second half 2025) may have been particularly favorable for swing breakouts rather than strategy robustness. The 29.96% validation return continuing the 2025 trend is suspicious.\n\n⚠ **Potential concentration risk**: With relatively few trades per year (14-46), a handful of large winners in the strong 2025 period could be driving validation success. The strategy doesn't prevent top-3 trades from dominating PnL.\n\n### Code Quality\n\n✓ Well-documented with clear docstring\n\n✓ Readable logic with descriptive variable names\n\n✓ Proper helper function separation (`find_swing_points`)\n\n− Nested loops in `find_swing_points()` could be optimized but functionally correct\n\n### Statistical Validity\n\nThe strategy generates sufficient trades (minimum 14/year, well above 3-trade threshold) and achieves momentum role thresholds. However, the sharp performance divergence in 2025 raises questions about whether this is capturing a durable edge or fitting to a specific market microstructure that appeared in the latter period.\n\n### Recommendation\n\nThe strategy passes technical checks but sits at the border of acceptable complexity. The concentration of returns in 2025 (both train and validation portions) suggests potential regime-specific fitting. \n\n**Score: 78/100** - Good fundamentals with moderate concerns about complexity and return consistency across market regimes.", "rule_suggestion": "**Year-over-year consistency requirement**: No single year should contribute more than 40% of total cumulative return during the train period. This prevents strategies that work exceptionally well in one market regime but lack robustness across multiple years. Calculate as: max(yearly_return) / sum(all_positive_yearly_returns) < 0.40" } ```