Dual-clock backtesting: minute-level signals with a 1-second risk clock

Signals fire on closed minute bars; stops, targets, and trailing logic are evaluated on 1-second closes with a strict per-second event order. Validation showed minute-only risk evaluation distorts tight-stop strategies by −55% while leaving wide-stop profiles almost untouched.

The architecture

The high-fidelity backtest engine runs two clocks against one canonical data source:

A four-state machine (FLAT → PENDING_ENTRY → OPEN → PENDING_EXIT → FLAT) ties the clocks together with a fixed per-second event order: fill pending orders at the second’s open, then process signal-bar closes, then check risk triggers at the second’s close. One unified rule prevents lookahead at the boundary: in any single second, at most one of {exit fill, new entry acceptance} may happen.

What minute-only risk evaluation gets wrong

Validation re-ran the same strategies with risk evaluated on 1-minute bars instead, across 778 trading days. For a tight-stop scalper profile (1m signals, 5-point stop, 3/5-point trailing):

The same comparison on a wide-stop rider profile (30m signals, 10-point trailing) deviated by only +0.6% — minute bars are fine when triggers are much larger than typical intrabar ranges.

Rules that keep the engine honest

The lesson

Clock fidelity must match stop tightness. A minute-bar backtest is not “approximately right” for a 5-point intraday stop — it is a different strategy. Decide the risk clock first, then ask whether your data can support it.