Paper trade QuantScript strategies in forwardtest mode: real-time market data, simulated execution, identical runtime to live mode. Validate before risking real capital.
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.
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:
event.onFill(), event.onReject(), event.onPositionOpened()) fire identically.risk.*) evaluate every simulated order just as they would a live one.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.
A paper-trading script declares forwardtest mode with a simulated broker:
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.
QuantScript’s three trading modes form a graduation path. The strategy logic stays the same; only the mode declaration and broker adapter change:
| Stage | Mode | Data | Execution | Purpose |
|---|---|---|---|---|
| 1. Backtest | backtest | Historical | Simulated | Validate edge over years of data, deterministic and repeatable |
| 2. Paper trade | forwardtest | Real-time | Simulated | Validate behaviour on unfolding markets, no capital at risk |
| 3. Go live | live | Real-time | Real broker | Deploy 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.