November 26, 2026 · research

We Paper-Traded a Volatility Breakout. The First Failure Was Our State File.

We Paper-Traded a Volatility Breakout. The First Failure Was Our State File.

We expected our first paper-trading problem to be a bad fill. Instead, a process restart changed the strategy’s mind about whether it owned a position.

The strategy was a plain volatility breakout on a liquid crypto perpetual: calculate a rolling range, enter when price closes above the upper band, exit when it falls back inside. The backtest behaved. Paper trading did too, until we restarted the worker between signal and reconciliation. Then the strategy submitted an entry it had already submitted once.

Here’s the sequence that turned a small recovery bug into a useful lesson about paper-versus-backtest parity.

Monday morning: the backtest looked almost too simple

We used one-minute bars, a 60-bar rolling high and low, and a close-confirmed breakout. A signal at 10:14 created an order for the next decision cycle. We modeled taker fees and a small impact charge; the paper account used the same signal and order rules.

The test harness replayed each bar once, in order. It kept the position and pending order in memory. That was enough for a backtest. We had not yet asked what should happen if the process vanished after sending an order but before recording the response.

There’s an unglamorous reason this slipped through: the strategy’s central logic fit on a screen, and the recovery code lived somewhere else. We reviewed the former more carefully.

Tuesday: the worker restarted in the gap

At 10:14, the breakout signal fired. The paper worker sent an entry request. The venue simulator accepted it, but the worker stopped before saving the acknowledgement. On restart, its in-memory state said “flat, no pending order.” Its next cycle saw the same breakout condition and sent another entry.

The simulator had a position. The strategy believed it had none. The second order increased exposure, while the backtest had entered only once. No single calculation was wrong; the two runs had different histories.

1signal event
2entry requests after restart
0recovery checks in our replay harness

We first blamed duplicate bar delivery. It was a plausible suspect: the worker restarted near a cycle boundary, and the same completed bar was processed again. But the log showed one signal evaluation before restart and one after. The missing fact was the order’s uncertain status.

Wednesday: we made recovery an explicit state transition

We stopped treating process memory as the source of truth. Before evaluating a new signal after startup, the worker now loads its durable strategy state and reconciles open orders and positions against the paper account. An order request gets a stable client identifier derived from the strategy instance and signal event, so retrying the same event can be recognized as a retry.

We also wrote the event trail we had wished we already had. Each decision records the bar timestamp, signal inputs, intended order, client identifier, acknowledgement or unresolved status, and resulting position. That makes “why did it trade?” answerable without reconstructing the worker’s memory from scattered logs.

Recovery questionUnsafe assumptionWhat we now check
Was an entry sent?The process would have saved the responseLook up the stable client identifier
Is a position open?In-memory quantity survivedReconcile against account positions
Can this bar create another order?Bars arrive exactly oncePersist the last processed event and deduplicate

Thursday: the restart test exposed a second mismatch

We replayed the same market data, stopping the worker at different points: before sending, after sending, after acceptance, and after saving the acknowledgement. At each interruption, we restarted it and compared the final event stream with an uninterrupted run.

The duplicate entry disappeared. The test then caught a quieter discrepancy: on restart, the worker rebuilt its rolling range from only the latest bars available in its warm-up buffer. One bar had not been loaded, so the upper band shifted slightly. The signal was still true in that case, but it would not always be.

We fixed recovery to restore the feature window or rebuild it from a defined historical range, then record the resulting feature values. Determinism has a practical limit here: if the underlying feed revises a bar, a replay needs the original observation or an explicit correction policy. “Same code” alone cannot guarantee the same input.

Friday: what we’d skip next time

We’d skip polishing the equity curve before testing interruption points. A strategy’s paper state is part of its behavior. If a restart changes pending orders, positions, or rolling features, the live paper run is no longer replaying the backtest’s decisions.

For this breakout, the useful parity check became concrete: replay the same bars, inject restarts at order boundaries, and compare decisions and resulting positions. It took less time than debating whether the extra trade was “just a simulator quirk.”

A paper strategy should be able to explain what it believed after a restart, and which durable events made it believe that.

That test won’t prove a strategy has an edge. It will tell you whether the strategy you paper-traded is the one you backtested, even after the worker forgets what happened five seconds ago.

paper tradingstrategy statevolatility breakoutbacktest parity
← All posts