diff --git a/bench/BENCH_DEEPSSEEK_V4_1_FLASH.md b/bench/BENCH_DEEPSSEEK_V4_1_FLASH.md new file mode 100644 index 0000000..e58c1f4 --- /dev/null +++ b/bench/BENCH_DEEPSSEEK_V4_1_FLASH.md @@ -0,0 +1,32 @@ +# Bench: AgentQuant harness driven by DeepSeek V4.1 Flash (`deepseek-v4-1-flash-1017`) + +Unmodified harness (cloned HEAD). The in-process LLM planners have no API key in this +environment, so `deepseek-v4-1-flash-1017` (Mistral-hosted) acted as the proposer/reflector +via a Vibe session pinned to that model; all backtests ran through the harness's own +`src.backtest.simple_backtest.basic_momentum_backtest` on SPY daily, search slice = +first 80% of dates (2021-12-03 → 2025-12-02), sealed trailing 20% holdout +(2025-12-03 → 2026-12-02) graded exactly once per run. Gates: min Sharpe 0.3, max DD 0.20. + +## Results + +| Run | Chosen params | In-sample Sharpe | Holdout Sharpe | IS/holdout gap | Max DD (holdout) | Verdict | +| --- | --- | ---: | ---: | ---: | ---: | --- | +| DeepSeek v4.1 Flash — run 1 (session ff5b72e2) | 30/150 | 0.947 | **-0.194** | 1.14 | 11.5% | watch | +| DeepSeek v4.1 Flash — run 2 (session eafc68a8) | 10/50 | 0.829 | **+0.169** | 0.66 | 5.7% | watch | +| Baseline: harness grid search (10 configs) | 63/252 | 1.039 | **-0.349** | 1.39 | 12.3% | watch | + +Run 1 proposals (in-sample Sharpe): 20/100 → 0.548, 10/50 → 0.829, 50/200 → 0.815, +20/50 → 0.171, 30/150 → 0.947. +Run 2 proposals: 50/200 → 0.815, 20/60 → 0.257, 15/80 → 0.571, 25/100 → 0.504, 10/50 → 0.829. + +## Takeaways + +- Both the model-driven runs and the grid search overfit the search slice: every pick has + a large in-sample/holdout gap and none clears the 0.3 Sharpe gate on the holdout. +- The model's picks degraded less out-of-sample than grid search (gap 0.66–1.14 vs 1.39; + run 2 even stayed positive on holdout), consistent with the harness's thesis that the + sealed-holdout gate, not in-sample Sharpe, is the honest score. +- Regime context given to the model: bull trend (+10.9% vs SMA200, SMA50>SMA200 +9.2%), + mild 21d pullback (-0.08%), VIX 16.6 (37.7th pctile of 1y). + +Full machine-readable report: `bench/bench_deepseek_report.json`. diff --git a/bench/bench_deepseek_report.json b/bench/bench_deepseek_report.json new file mode 100644 index 0000000..e6b867f --- /dev/null +++ b/bench/bench_deepseek_report.json @@ -0,0 +1,189 @@ +{ + "model": "deepseek-v4-1-flash-1017", + "harness": "AgentQuant @ cloned HEAD, unmodified, no-LLM in-process planners (model acts as proposer)", + "asset": "SPY", + "holdout_fraction": 0.2, + "search_slice": { + "start": "2021-12-03", + "end": "2025-12-02", + "bars": 1003 + }, + "holdout_slice": { + "start": "2025-12-03", + "end": "2026-12-02", + "bars": 251 + }, + "proposals": [ + { + "fast_window": 20, + "slow_window": 100, + "reasoning": "A 20/100 pair reacts to the 6-15% intermediate uptrend faster than 50/200 while still filtering noise, which typically lifts Sharpe on a 4-year bull slice with only a mild pullback.", + "confidence": 0.66, + "in_sample": { + "sharpe": 0.54817190863022, + "total_return": 0.24917240398397866, + "max_drawdown": 0.2321255044475794, + "num_trades": 5 + } + }, + { + "fast_window": 10, + "slow_window": 50, + "reasoning": "The 10/50 crossover sits close to the 21-day pullback horizon, re-entering quickly after the shallow -0.08% dip while VIX near 16.6 keeps whipsaw risk low.", + "confidence": 0.6, + "in_sample": { + "sharpe": 0.828833410649044, + "total_return": 0.41197954093091327, + "max_drawdown": 0.11864790809522727, + "num_trades": 13 + } + }, + { + "fast_window": 50, + "slow_window": 200, + "reasoning": "The canonical golden-cross is the lowest-turnover, most robust baseline here, capturing the 10.88% price-above-SMA200 trend with few false signals and strong drawdown control against the 0.2 gate.", + "confidence": 0.55, + "in_sample": { + "sharpe": 0.8148893785711429, + "total_return": 0.4584571373485997, + "max_drawdown": 0.1875524241069513, + "num_trades": 2 + } + }, + { + "fast_window": 20, + "slow_window": 50, + "reasoning": "Slightly faster than classic, 20/50 balances the persistent 50>200 spread of 9.18% against the flat recent month, aiming for higher exposure time than 50/200 without 10-day chop.", + "confidence": 0.52, + "in_sample": { + "sharpe": 0.17115000219864104, + "total_return": 0.052711821230641, + "max_drawdown": 0.2888702128991367, + "num_trades": 10 + } + }, + { + "fast_window": 30, + "slow_window": 150, + "reasoning": "A mid-speed pair hedges the unknown holdout regime: slower than 20/100 to avoid late-cycle whipsaw but fast enough to stay long through the 126-day +15% run.", + "confidence": 0.45, + "in_sample": { + "sharpe": 0.9472587017916024, + "total_return": 0.4674305752522212, + "max_drawdown": 0.10170507898622155, + "num_trades": 3 + } + } + ], + "chosen": { + "params": { + "fast_window": 30, + "slow_window": 150 + }, + "in_sample_sharpe": 0.9472587017916024, + "holdout": { + "sharpe": -0.19443527067321684, + "total_return": -0.03389981634895789, + "max_drawdown": 0.1145952665537557, + "num_trades": 2 + }, + "is_holdout_gap": 1.1417, + "verdict": "watch" + }, + "baseline_grid_search": { + "best_params": { + "fast_window": 63, + "slow_window": 252 + }, + "in_sample_sharpe": 1.039257737894098, + "holdout": { + "sharpe": -0.34889937596579557, + "total_return": -0.05188612295784234, + "max_drawdown": 0.1225143697875436, + "num_trades": 1 + }, + "is_holdout_gap": 1.3882 + }, + "wall_clock_seconds": 0.0, + "run2_session_eafc68a8": { + "model": "deepseek-v4-1-flash-1017", + "run": "session eafc68a8 (second proposal set)", + "proposals": [ + { + "fast_window": 50, + "slow_window": 200, + "reasoning": "Established bull trend (+10.9% vs SMA200, SMA50>SMA200 by 9.2%) with low VIX favors a slow golden-cross filter that stays long through the mild 21d pullback instead of whipsawing.", + "confidence": 0.72, + "in_sample": { + "sharpe": 0.8148894887580502, + "total_return": 0.4584570850783667, + "max_drawdown": 0.18755225912219026, + "num_trades": 2 + } + }, + { + "fast_window": 20, + "slow_window": 60, + "reasoning": "The 63d momentum (+6.2%) is positive but shallow, so a mid-speed 20/60 cross captures the trend while reacting to the 126d up-leg without the noise of very fast windows.", + "confidence": 0.66, + "in_sample": { + "sharpe": 0.25716697720283327, + "total_return": 0.09612286413016968, + "max_drawdown": 0.25823817501108703, + "num_trades": 10 + } + }, + { + "fast_window": 15, + "slow_window": 80, + "reasoning": "Wide fast/slow separation smooths the transition around the recent 21d flat patch while still responding faster than a 200d anchor in an 18% vol regime.", + "confidence": 0.6, + "in_sample": { + "sharpe": 0.5711151410462801, + "total_return": 0.26335977460563287, + "max_drawdown": 0.21601782525450808, + "num_trades": 6 + } + }, + { + "fast_window": 25, + "slow_window": 100, + "reasoning": "A ~5 month anchor matches the 126d positive momentum horizon and should keep drawdown under the 20% gate during trend resumptions.", + "confidence": 0.55, + "in_sample": { + "sharpe": 0.5038071998398602, + "total_return": 0.22408238505557665, + "max_drawdown": 0.26572930251300736, + "num_trades": 4 + } + }, + { + "fast_window": 10, + "slow_window": 50, + "reasoning": "Higher turn count but a good hedge in case the trend re-accelerates quickly out of the pullback; included as a faster alternative if slower crosses lag.", + "confidence": 0.45, + "in_sample": { + "sharpe": 0.8288353055975025, + "total_return": 0.41198021067046176, + "max_drawdown": 0.11864793573423313, + "num_trades": 13 + } + } + ], + "chosen": { + "params": { + "fast_window": 10, + "slow_window": 50 + }, + "in_sample_sharpe": 0.8288353055975025, + "holdout": { + "sharpe": 0.16948500715037654, + "total_return": 0.011645967094177534, + "max_drawdown": 0.05685387979983724, + "num_trades": 4 + }, + "is_holdout_gap": 0.6594, + "verdict": "watch" + } + } +} \ No newline at end of file