Deploy QuantScript strategies as live trading bots with real broker execution, automatic position reconciliation, audit trails, and built-in risk guardrails.
A QuantScript strategy that runs in live mode is the same script you backtested and paper traded. The trading logic, indicator computations, and trade.* calls are identical — only the mode declaration and broker adapter change:
// Before (backtest):
mode(mode_type: "backtest", script_name: "My Strategy");
broker(adapter: "sim", config: { initial_capital: 10000 });
// After (live):
mode(mode_type: "live", script_name: "My Strategy");
broker(adapter: "demotrader");There is no separate “production codebase”. The strategy you validated on historical data and forward-tested on streaming markets is exactly what runs against your broker — eliminating the entire class of bugs introduced by rewriting for deployment.
Live strategies trade through the Canonical Trading Model — a provider-neutral layer of orders, fills, positions, accounts, and instrument definitions. Strategy code never touches broker-specific APIs:
trade.orderSend(), trade.buy(), trade.sell() — submit market and pending orders.trade.closePosition(), trade.modifyPosition() — manage open positions.trade.positions(), trade.orders(), trade.fills() — introspect broker state.trade.account() — equity, balance, margin, and free margin.Broker adapters translate between this universal API and the connected broker — FX/CFD brokers, crypto exchanges, and stock brokers all behind one interface. Switching brokers means changing the adapter declaration, not rewriting trading logic.
Before execution begins, the runtime performs capability discovery: instrument constraints, supported order types, and account properties are loaded from the broker, so strategies can adapt to what the connected account actually supports.
Live mode wraps every trade in a layered safety architecture:
reason, context, and tags metadata for full explainability.Deployments run as continuously monitored cloud processes on quantscript.com — with start/stop lifecycle controls, health monitoring, and a dashboard showing live positions, equity, and per-strategy performance.
Live mode supports running multiple independent strategies on the same broker account through Virtual Trading Accounts — ownership tags isolate each strategy’s positions while capital and margin remain pooled. Each strategy sees its own equity, P&L, and drawdown as if it had a dedicated account.
mode(mode_type: "live", script_name: "EMA Cross Live");
candles("BTCUSD", resolution_type: "1h", bars: 200);
broker(adapter: "demotrader");
risk(max_position_pct: 25, daily_loss_limit: 3);
event.onCandle((candle) => {
if (ta.crossover(ta.ema(candle.close, 20), ta.ema(candle.close, 50))) {
trade.orderSend({
side: "buy",
qty: 0.1,
stopLoss: candle.close * 0.98,
reason: "EMA20 crossed above EMA50"
});
}
});Deploy from the platform dashboard in one click — or start with a ready-made automated strategy and study how it works.