Skip to content

PullbackContinuation hourly backtest is pathologically slow (38+ CPU-minutes, 5-year window) #352

Description

@eaitbrahim

Found 2026-08-17 while measuring hourly trade rates per family: backtest() of PullbackContinuation on a 5-year hourly window (44,537 bars, shipped defaults, market-fill model) ran 38+ CPU-minutes at 100% single-core without completing — versus the same window's turtle backtests finishing in seconds. The measurement had to be killed; the corpus numbers were used instead (so the repo's own records are unaffected — their runs completed on the #257-era engine or with different fixtures).

Suspect: the pending-setup/offset-entry machinery's per-bar scan on long windows (the same machinery #256/#257/#258 iterated on — see strategy/engine.py's pending lifecycle).

Acceptance

  • Reproduce: time backtest(PullbackContinuation(...), hourly_candles) on a 1-year and 5-year window; profile the hot loop.
  • Identify the complexity class (the 1-year vs 5-year ratio answers quadratic-vs-linear immediately).
  • Fix or document the constraint; a tests/ timing pin if the fix lands (a smoke bound, not a benchmark suite — the repo has no perf harness and shouldn't grow one for this).

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions