Default online backtest to production GTL

This commit is contained in:
2026-07-13 16:51:55 +02:00
parent 8e09f239c8
commit 9d362bd568
4 changed files with 25 additions and 2 deletions
+11 -2
View File
@@ -176,8 +176,17 @@ SR_RESEARCH_VARIANTS = {
def _sr_research_variant() -> str:
"""S/R policy arm for local research; never read by the live scanner."""
value = os.getenv("BACKTEST_SR_VARIANT", "rewrite").strip().lower()
"""Backtest target policy; research arms require an explicit override.
The unconfigured online/scheduled backtest must replay the same transient
Gate Target Ladder as the live scanner. Clean Structural S/R remains an
opt-in research arm here because it is intentionally chart/alert structure,
not the production gate's target source.
"""
value = os.getenv(
"BACKTEST_SR_VARIANT",
EXPLICIT_TARGET_LADDER_VARIANT,
).strip().lower()
if value not in SR_RESEARCH_VARIANTS:
allowed = ", ".join(sorted(SR_RESEARCH_VARIANTS))
raise ValueError(f"Unknown BACKTEST_SR_VARIANT={value!r}; expected one of {allowed}")