ramseshk
|
7517163142
|
feat: configurable grid params + auto walk-forward optimizer
Track 1 — Grid param sweep in vbt_runner:
- _generate_signals accepts params dict: grid_levels, spacing_bps, rebalance_every
- run_strategy passes params through to signals
- _strategy_params reflects actual runtime params
- Grid param sweep results: spacing is critical, levels don't matter
Tight spacing (1-2bps) = 1 trade, positive EV
Wide spacing (20bps+) = many trades, negative EV
Candle simulation can't model grid MM fills accurately
Track 6 — quant/optimizer.py:
- ParanOptimizer: automated IS/OOS parameter walk-forward
- add_param() to define parameter grid
- Composite score: Sharpe × sqrt(trades) for robustness
- IS optimization per window, OOS testing per window
- WFParamWindow + OptimizerReport with consistency + stable params
Grid MM walk-forward results (3 windows):
W0: IS S=-3.75 → OOS S=+2.23 (+12.7%, 1t)
W1: IS S=+2.52 → OOS S=-3.49 (-19.0%, 11t)
W2: IS S=-3.30 → OOS S=0.00 (0t)
Consistency: 33.3%, Stable params: {levels=5, spacing=1bps, rebalance=5}
Verdict: Candle-based grid MM is fundamentally unreliable.
Real fills require queue simulation with L2 data.
|
2026-08-10 16:47:09 +08:00 |
|
ramseshk
|
543537e33f
|
feat: quant validation framework — DSR, PSR, Haircut, regimes, walk-forward
Three-module quant framework replacing 'sort by Sharpe' with proper
statistical validation:
quant/significance.py (15 tests):
- deflated_sharpe_ratio(): adjusts for N trials (Harvey & Liu 2015)
- probabilistic_sharpe_ratio(): P(True SR > benchmark) given T, skew, kurt
- sharpe_haircut(): expected OOS Sharpe after selection bias deflation
- QuantVerdict: DEPLOY / SIMULATE / DISCARD with 5-point scoring
- validate_strategy(): one-shot validation function
quant/regimes.py (8 tests):
- classify_regime(): trending_up/down, ranging, volatile
- RegimeClassifier: stateful rolling-window classifier
- conditional_performance(): per-regime trade statistics
quant/walkforward.py (5 tests):
- WalkForwardRunner: sequential IS/OOS window optimization
- WFWindow/WFReport: structured walk-forward results
- consistency score, performance decay, concatenated OOS equity
- significance_report() integration
Walk-forward results (real HL data with date-sliced windows):
grid_mm 1h: 2/4 pos, OOS S=-0.45, 74t, haircut=-22.66 → DISCARD
momentum 4h: 2/4 pos, OOS S=-1.47, 116t, haircut=-45.35 → DISCARD
composite_mm 1h: 2/4 pos, OOS S=+2.97, 6t, haircut=+43.25 → SIMULATE
28 tests total
|
2026-08-10 16:20:56 +08:00 |
|