What is Paper Trading#

Paper trading is QuantScript’s forwardtest mode: your strategy runs against real-time (or replayed) market data with simulated order execution — exactly like live trading, except no real orders reach a broker and no real capital is at risk.

Forwardtest mode answers the question backtesting cannot: does my strategy behave correctly when it must react to unfolding market conditions, incomplete candles, and streaming data? It is the natural validation step between historical simulation and live deployment.

  • Live market data — candles arrive in real time (or from a replay feed), including forming-bar behaviour.
  • Simulated fills — orders are matched by the same SimEngine used in backtests.
  • Zero broker risk — no broker connection is required; nothing leaves the platform.
  • Full observability — virtual positions, equity curve, run journal, and audit trail all work identically to live mode.

Same Runtime as Live#

The critical property of forwardtest mode is runtime equivalence. The simulated broker (SimBrokerAdapter) sits behind the exact same BrokerAPI interface used by live broker adapters. Your strategy calls the same trade.orderSend(), trade.closePosition(), trade.positions(), and trade.account() functions in both modes — only the adapter behind the interface differs.

This means:

  • Order lifecycle events (event.onFill(), event.onReject(), event.onPositionOpened()) fire identically.
  • Position and account introspection returns the same shapes.
  • Risk controls (risk.*) evaluate every simulated order just as they would a live one.
  • Promoting a validated strategy to live mode requires changing one declaration — not rewriting logic.

SimEngine composes its fill behaviour from named execution profiles (bar-match-netting, bar-match-hedging, crypto-spot, and more), so paper trading can approximate the broker you intend to deploy to. See Sim Engine Config for details.

Declaring Forwardtest Mode#

A paper-trading script declares forwardtest mode with a simulated broker:

QuantScript
mode(mode_type: "forwardtest", script_name: "My Paper Strategy");

candles("ETHUSD", resolution_type: "15m", bars: 200);

broker(adapter: "sim", config: {
  initial_capital: 10000,
  execution_strategy: "bar-match-hedging"
});

event.onCandle((candle) => {
  // Strategy logic — identical to live mode
});

Run it in the Strategy Playground or deploy it to the cloud platform, where it runs continuously against streaming market data — the Strategy Arena compares forward-test performance across strategies.

Backtest → Paper → Live#

QuantScript’s three trading modes form a graduation path. The strategy logic stays the same; only the mode declaration and broker adapter change:

StageModeDataExecutionPurpose
1. BacktestbacktestHistoricalSimulatedValidate edge over years of data, deterministic and repeatable
2. Paper tradeforwardtestReal-timeSimulatedValidate behaviour on unfolding markets, no capital at risk
3. Go liveliveReal-timeReal brokerDeploy with risk guardrails, reconciliation, and audit trails

Because all three modes share one language and one trading API, there is no “rewrite for production” step — the script you validated is the script you deploy.

Next Steps#