Test clean S/R as production rank overlay
This commit is contained in:
@@ -59,6 +59,7 @@ def _parse_args() -> argparse.Namespace:
|
||||
"production_range504", "rewrite_range504_legacy_primary",
|
||||
"rewrite_range504_structural_legacy_primary",
|
||||
"rewrite_range504_structural_primary2",
|
||||
"production_structural_overlay",
|
||||
),
|
||||
default=None,
|
||||
help="Research-only S/R detector/gate arm.",
|
||||
@@ -160,6 +161,27 @@ def _print_summary(report: dict) -> None:
|
||||
f"trades {row.get('trades')}"
|
||||
)
|
||||
|
||||
monitor_rows = [
|
||||
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"
|
||||
)
|
||||
]
|
||||
if monitor_rows:
|
||||
print(" live-path full-period comparison:")
|
||||
for row in monitor_rows:
|
||||
print(
|
||||
" "
|
||||
f"{row.get('strategy')}: "
|
||||
f"Sharpe {row.get('sharpe')}, "
|
||||
f"CAGR {_pct(row.get('cagr_pct'))}, "
|
||||
f"DD {_drawdown_pct(row.get('max_drawdown_pct'))}, "
|
||||
f"trades {row.get('trades')}"
|
||||
)
|
||||
|
||||
|
||||
async def _main() -> None:
|
||||
args = _parse_args()
|
||||
|
||||
@@ -100,6 +100,11 @@ def _args() -> argparse.Namespace:
|
||||
help="Run current production and the frozen candidate over the full snapshot.",
|
||||
)
|
||||
_add_common(full)
|
||||
overlay = commands.add_parser(
|
||||
"overlay",
|
||||
help="Test the frozen 5% clean-structure rank overlay on production breadth.",
|
||||
)
|
||||
_add_common(overlay)
|
||||
validate = commands.add_parser(
|
||||
"validate",
|
||||
help="Run production control and one locked arm from 2024-07-01.",
|
||||
@@ -210,6 +215,16 @@ def _full(args: argparse.Namespace) -> None:
|
||||
print("Full-period production comparison complete.")
|
||||
|
||||
|
||||
def _overlay(args: argparse.Namespace) -> None:
|
||||
_run_arm(
|
||||
"production_structural_overlay",
|
||||
args.snapshot,
|
||||
args.workers,
|
||||
output=ROOT / "reports" / "backtest-sr-overlay-full.json",
|
||||
)
|
||||
print("Full-period structural ranking overlay complete.")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
args = _args()
|
||||
if args.command == "train":
|
||||
@@ -225,6 +240,8 @@ def main() -> None:
|
||||
_train(args, arms, "backtest-sr-range-residual-train")
|
||||
elif args.command == "full":
|
||||
_full(args)
|
||||
elif args.command == "overlay":
|
||||
_overlay(args)
|
||||
else:
|
||||
_validate(args)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user