Skip to content

Add configurable backtest warmup#8

Merged
luisleo526 merged 1 commit into
mainfrom
codex/configurable-backtest-warmup
Jul 10, 2026
Merged

Add configurable backtest warmup#8
luisleo526 merged 1 commit into
mainfrom
codex/configurable-backtest-warmup

Conversation

@luisleo526

Copy link
Copy Markdown
Contributor

Summary

  • add --warmup-bars to fetch and retain user-selected pre-start OHLCV history
  • keep indicator/Pine initialization separate from broker execution by forwarding trade_start_time_ms through local Docker, FastAPI, and direct-library runtimes
  • report requested and loaded warmup counts, the expanded provider start, and the effective trading boundary
  • document the CLI and direct API behavior

Why

The backtest harness previously conflated the data window with the trading window. Filtering output trades after execution could not undo pre-window positions or stateful trade counters, which caused the corpus moderate/weak results. The release runtime already supports suppressing order commands before a boundary; this PR exposes that boundary and lets users choose the preceding warmup length.

User impact

Users can now pass --warmup-bars N. Those bars initialize indicators, higher-timeframe feeds, and Pine state, while order execution remains disabled until --start. The default remains zero for backward compatibility.

Validation

  • ruff check src tests
  • ruff format --check src tests
  • mypy src
  • pytest — 86 passed, 2 optional Docker tests skipped
  • real pineforge-release:0.1.12 container run confirmed the configured trade_start_ms in runtime provenance

@luisleo526 luisleo526 marked this pull request as ready for review July 10, 2026 17:38
@luisleo526 luisleo526 merged commit 6e13aa4 into main Jul 10, 2026
4 checks passed
@luisleo526 luisleo526 deleted the codex/configurable-backtest-warmup branch July 10, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant