backtest: add min target-probability sweep
Deploy / lint (push) Successful in 7s
Deploy / test (push) Successful in 40s
Deploy / deploy (push) Successful in 26s

Re-applies the activation gate at several min_target_probability thresholds
(60→30, other conditions fixed) over the already-replayed candidates, so the
trade-off between how many setups qualify and their expectancy is visible in one
table — the cheap "optimize" half of Phase 2. Candidates now carry meets_core +
best_prob so the sweep needs no re-replay. New sweep table in BacktestPanel with
the current threshold starred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-16 06:13:30 +02:00
parent 9d2e1e74bf
commit 050abc6f71
4 changed files with 81 additions and 3 deletions
+6 -1
View File
@@ -108,10 +108,15 @@ async def test_run_backtest_smoke(session):
# well-formed report
assert report["tickers"] == 1
assert isinstance(report["candidates"], int)
for key in ("overall_qualified", "overall_all", "by_direction", "calibration"):
for key in ("overall_qualified", "overall_all", "by_direction", "calibration", "sweep"):
assert key in report
# the oscillating series should yield at least some resolved setups
assert report["candidates"] >= 1
# sweep: lowering the threshold can only add qualifiers, never remove them
sweep = sorted(report["sweep"], key=lambda r: r["min_target_probability"], reverse=True)
counts = [r["total"] for r in sweep]
assert counts == sorted(counts) # ascending as threshold descends
# every calibration row is internally consistent
for row in report["calibration"]:
assert 0 <= row["realized_hit_rate"] <= 100