backtest: raise session clamp 45 -> 300 (env BACKTEST_MAX_SESSIONS)

The stored minute-bar history is 273 sessions (~13 months); the 45-session
clamp blocked months-scale ranges now that the nightly labeler keeps
setup_events current. Requests stay serialized behind _backtest_lock; a
full-history run takes minutes by operator choice.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
momentum devandClaude Fable 5 committed 2026-07-22 09:29:55 -05:00
1 parent ed176b3712
commit 9d0a9df60e
1 file changed
+4 -1
+4 -1
View File
@@ -581,7 +581,10 @@ class DashboardState:
from strategy.exits import ExitConfig
from strategy.population import PopulationConfig
MAX_SESSIONS = 45
# cap protects the (serialized) request thread; 300 spans the full stored
# minute-bar history (~273 sessions) so months-scale ranges work via
# since/until — a full-history request runs minutes, operator's choice.
MAX_SESSIONS = int(os.environ.get("BACKTEST_MAX_SESSIONS", "300"))
pop = PopulationConfig.from_env()
regime_on = os.environ.get("TRADING_REGIME_GATE_ENABLED", "0").strip().lower() in {
"1", "true", "yes", "on"}