feat: live-test scorecard and frozen strategy settings

Pre-registers the real-money test that starts 2026-09-24, the first session
without commission drag. PASS needs at least 80 round trips with a positive
mean R and positive P&L. FAIL is any session the equity floor halts. Changing
any strategy setting in live_test_freeze.json restarts the count, and the
scorecard reports that drift.

The settings were frozen, not tuned, because a study of 239 real fills
re-simulated under the current exit found nothing worth changing:
  - Capping how far above the trigger an entry may fill lost R at every cap
    from 0.25% to 10%, with either skip or resting-limit handling. Fills more
    than 5% above the trigger were the best bucket (+0.66R).
  - No break-time factor (spread, price, VWAP distance, stop width, L1
    bid/ask size, premarket range) kept its sign across both date halves and
    both accounts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
momentum devandClaude Opus 5.5 committed 2026-09-25 10:53:39 -05:00
1 parent 42ca523053
commit e2e9687c45
3 files changed
+247

No files matched your search

@@ -0,0 +1,30 @@
"""Live-test scorecard: pure verdict / drift logic."""
from research.live_scorecard import config_drift, load_freeze, verdict
def test_running_until_target():
assert verdict([0.5] * 10, 5.0, 0, target=80).startswith("RUNNING: 10/80")
def test_floor_halt_fails_immediately():
assert verdict([2.0] * 100, 50.0, 1).startswith("FAIL: the equity floor")
def test_pass_needs_positive_r_and_pnl():
assert verdict([0.2] * 80, 10.0, 0).startswith("PASS")
assert verdict([0.2] * 80, -1.0, 0).startswith("FAIL")
assert verdict([-0.1] * 80, 5.0, 0).startswith("FAIL")
def test_drift_ignores_safety_knobs_and_catches_new_strategy_keys():
frozen = {"TRADING_EXIT_TRAIL_PCT": "0.12", "TRADING_EQUITY_FLOOR": "215"}
current = {"TRADING_EXIT_TRAIL_PCT": "0.12", "TRADING_EQUITY_FLOOR": "190",
"TRIGGER_GAP_MAX": "40", "OLLAMA_MODEL": "x"}
assert config_drift(frozen, current) == {"TRIGGER_GAP_MAX": (None, "40")}
def test_freeze_file_is_valid():
f = load_freeze()
assert f["frozen_on"] == "2026-09-24"
assert f["settings"]["TRADING_EXIT_TRAIL_PCT"] == "0.12"