ox-charts
Trading

Paper trading

A full simulated broker fed by the chart's own bars, live or in bar replay.

The paper broker (createPaperBroker) is a real adapter with an account and a ledger. The shell feeds it the active chart's bars, so live ticks and replay steps both trigger fills.

OrderFills whenAt
MarketImmediatelyThe current bar's close, plus slippage
LimitThe bar's range reaches the levelThe better of the open and the level
StopThe bar's range reaches the levelThe worse of the open and the level, plus slippage
Gap through a levelOn the bar that gappedThe open
  • When a single bar reaches both TP and SL, the broker fills the stop and counts an ambiguous fill. It cannot know which came first inside one bar, so it assumes the worse.
  • One net position per symbol. A reversal closes fully, then opens the other side.
  • Commission is charged on every fill's notional.
  • Reset account in the panel clears orders, positions and history.

In bar replay

Start replay from the toolbar (Shift+R), pick a start bar, and trade from the replay bar's Buy / qty / Sell or with B, S, X. Each step forward hands the new bar to the broker, so pending orders evaluate and brackets trigger. Stepping back does not rewind the account: the ledger is a journal.

The gap after replay is not traded

Ending a session does not evaluate the bars between the replay cursor and the live edge. A bracket the market crossed inside that gap does not fill; the position resumes marking from the live price.

On this page