Documentation
37. v0.17.0 — Offline bracket catch-up
- Created
- Sep 21, 2026
- Updated
- Sep 21, 2026
Release candidate prepared 2026-09-21. Paper trading now reconstructs the time your chart was closed, so a take profit or stop loss that the market reached while you were away is filled where it was reached instead of being missed. Follows v0.16.4.
Added
-
Brackets are honoured for the time the chart was closed. The paper engine is driven by the chart, so nothing was evaluated while the tab was shut. Open a position with a take profit and a stop loss, close the browser, come back two days later, and the position was still open however many times the market had crossed either level.
Each account now records, per symbol, the clock of the last price it evaluated. When you open a chart whose symbol has working orders and that mark is stale, the stretch since then is loaded as bars and walked through the ordinary fill path before the live feed resumes. The first level the market touched fills at its own price, its OCO sibling is canceled, and the execution is booked with the time it happened — so the marker lands on the bar where it belongs and the journal reads in order.
The gap is reconstructed at the finest resolution it allows: minute bars for an absence of up to about two days, stepping to 5-minute, hourly and coarser for longer ones. Within one reconstructed bar, which of two levels came first is the usual intrabar assumption (open → nearer extreme → farther extreme → close).
-
The Journal says what was checked. Every walk adds a line — the symbol, how many bars over how long a closure, and what filled. A position with no working bracket has nothing to catch up and is simply re-marked.
Fixed
- A chart reopened past its stop filled at the reopen price. The same blind spot had a second, more expensive form. If you came back and the market was already below your stop, the position did not survive — it was closed at whatever the price was when you looked. A long with a stop at 90, reopened at 70, booked −30 instead of −10, because the first live price after a reload looked to the engine like the market gapping straight through the level. Walking the gap reaches the stop at 90 first, so the loss is the one you set.
Changed
-
An order placed or moved while the chart was closed is only matched against what followed it. Reconstructed bars carry a marker that stops the engine filling an order against prices that predate its current terms, so a level you dragged mid-gap cannot be filled by the market that came before the drag.
-
Catch-up never invents a fill. If the stretch cannot be reconstructed — the provider has no history that far back, the request fails, or the absence is longer than the chart can walk — nothing is filled. You get a notification and a journal line naming the window that went unchecked, and the working orders are left exactly as they were. Local (CSV) charts have no live feed to fall behind and no history service to ask, so they are never caught up.
Verification
- The complete automated suite (391 files / 3,382 tests), TypeScript, the zero-warning ESLint baseline, and the optimized production build (131/131 static pages) passed on the release-preparation tree.
- The catch-up is covered by 38 new tests: the planning layer (which window an account owes, the timeframe ladder, sample construction and its monotonic clock, coverage judgement, watermark bookkeeping), the engine walk end to end (first-hit ordering in both directions, both levels inside one bar, brackets the gap never reached, an order dragged mid-gap, an entry order filled and its brackets activated), and the broker seam (the watermark surviving a session, the journal line, the unverified-gap path, and replay accounts staying out of the live watermark).
- Checked in a real browser against live Binance data, on a seeded two-day absence whose window broke the stop first and only later ran past the take profit — with the price today above the take profit, so a wrong answer would have booked a profit. The walk read 2,974 one-minute bars, filled the stop at its exact price, timestamped it at the minute it happened, canceled the take profit, and placed the marker on that day's bar. The mirror case, brackets the same window never reached, left the position and both orders untouched.
Next steps
See how the engine treats the time you were away.