Finalize GTL and retire S/R research harness

This commit is contained in:
2026-07-13 17:58:04 +02:00
parent 9d362bd568
commit bee5a5ce89
35 changed files with 374 additions and 5385779 deletions
+12 -44
View File
@@ -47,38 +47,13 @@ def _parse_args() -> argparse.Namespace:
)
parser.add_argument("--quiet", action="store_true", help="Hide progress output.")
parser.add_argument(
"--sr-variant",
choices=(
"production_control", "rr_aligned_control", "rewrite",
"soft_zones", "confirmed_rounds", "gate_v2",
"rewrite_legacy_primary", "soft_zones_legacy_primary",
"confirmed_rounds_legacy_primary", "gate_v2_legacy_primary",
"legacy_geometry_neutral", "legacy_pivots_only",
"legacy_traffic_grid_only", "legacy_range_grid_touch",
"legacy_range_grid_neutral",
"production_range504", "rewrite_range504_legacy_primary",
"rewrite_range504_structural_legacy_primary",
"rewrite_range504_structural_primary2",
"production_structural_overlay",
"explicit_target_ladder",
"--target-model",
choices=("production_gtl", "structural_sr"),
default="production_gtl",
help=(
"Target source: production_gtl matches the live scanner; "
"structural_sr is a comparison-only chart-S/R model."
),
default=None,
help="Research-only S/R detector/gate arm.",
)
parser.add_argument(
"--entry-start",
default=None,
help="Include entries on/after YYYY-MM-DD.",
)
parser.add_argument(
"--entry-end",
default=None,
help="Include entries on/before YYYY-MM-DD.",
)
parser.add_argument(
"--sr-audit",
action="store_true",
help="Include candidate-level S/R audit rows for paired comparison.",
)
parser.add_argument(
"--holdout-split",
@@ -171,10 +146,7 @@ def _print_summary(report: dict) -> None:
row
for row in ((report.get("portfolio_monitor") or {}).get("runs") or [])
if row.get("lookback") == "all"
and (
row.get("is_production")
or row.get("strategy") == "production_structural_overlay5_atr3"
)
and row.get("is_production")
]
if monitor_rows:
print(" live-path full-period comparison:")
@@ -198,14 +170,6 @@ async def _main() -> None:
os.environ["BACKTEST_SNAPSHOT_OFFLINE"] = "1"
if args.allow_spawn:
os.environ["BACKTEST_ALLOW_SPAWN"] = "1"
if args.sr_variant:
os.environ["BACKTEST_SR_VARIANT"] = args.sr_variant
if args.entry_start:
os.environ["BACKTEST_ENTRY_START"] = args.entry_start
if args.entry_end:
os.environ["BACKTEST_ENTRY_END"] = args.entry_end
if args.sr_audit:
os.environ["BACKTEST_SR_AUDIT"] = "1"
if args.holdout_split:
try:
date.fromisoformat(args.holdout_split)
@@ -240,7 +204,11 @@ async def _main() -> None:
try:
async with Session() as db:
report = await run_backtest(db, progress_cb=progress)
report = await run_backtest(
db,
progress_cb=progress,
target_model=args.target_model,
)
finally:
await engine.dispose()