Start a strategy on a live market feed
Starts your strategy against a live market feed. A new run begins in the sandbox
stage — a short trial that compares an independent second execution against the first for
agreement — before it is eligible for promotion to the live stage where it actually
publishes signals other systems can act on. Poll GET /strategy/{strategyId}/live (or
PATCH/DELETE/live/{runId} once you have the runId) to watch stage move from
SANDBOX to LIVE.
A strategy that has already been through that trial does not go through it again. When an
earlier run of yours of the same compiled strategy was promoted to LIVE, and none of that
compilation's runs was stopped for using more resources than allowed, the new run starts in
LIVE at once: the response says stage: LIVE and carries the earlier verdict in gate.
The parameters, sources and instruments may differ from the earlier run. Submitting the
strategy again (POST /strategy) compiles it anew, and a new compilation goes through the
sandbox like a first run. Send sandbox: true to start in the sandbox anyway — for
example to read the run's signals back over the connection while you debug it, which the
live stage does not keep.
Only one run per strategy at a time — starting again while one is already running is 409;
stop the current one first.
sources takes exactly one entry today (multi-source strategies are not supported yet).
type is ticker or kline; anything else is rejected. Both connect to the lightest
(fastest) cadence available for the exchange — today that is 1 tick/second on every
supported exchange; choosing among several cadences is not offered yet.
venueType is cex (a centralized exchange) or dex (one pool on a decentralized exchange). A dex source reads one
pool, takes only kline, and needs the pool's address as its single instrument. See the "Live execution" guide,
"Sources".
venueType, exchange and segment have to be ones GET /exchanges lists together: the exchange under that
venue type, and the segment among its liveSegments. Case and the spaces around a value do not matter, and the
run reports them back in lower case (cx, the older spelling of cex, is still read). Anything else is refused
with 400, naming what the list has.
instruments can be left out, except for a dex source. A QTScript strategy can declare which instruments it accepts with an instruments
line in its source; when the compilation of the strategy records that selection as a list of pairs, a
start that leaves instruments out, or sends ["*"], takes that list, and otherwise the run reads every
instrument the exchange/segment offers. A list you send is taken as sent. Either side of an entry can be *
(any base paired with USDT). The instruments the run reads come back in sources. See the "Live execution" guide, "Sources".
params is passed straight through to the strategy at start — the same free-form object
POST /strategy/{strategyId}/validate and the backtest endpoints already accept. To change
a parameter while the run is live, use PUT /live/{runId}/params instead; this endpoint
only sets the values a run starts with.
Consuming a run's own output — its signals, and updating its parameters over a live
connection instead of polling — is a WebSocket protocol on top of these REST endpoints; see
the "Live execution" guide linked from this tag's description for the full flow (minting a
connection token, the channel and RPC method).
Paper trading. Pass a paper block to have the run's hints executed in simulation from
its first tick, as a backtest would execute them: fills, closed trades, equity and KPIs,
with one simulated account per quote currency. Omitted, the run has no paper trading. It
takes the same economics as a backtest's baseConfig plus where its output goes; read it
back with GET /live/{runId}/paper. A strategy that listens to its own execution events
(it overrides getExecutionCallback()) has no other execution venue, so it cannot start
without a paper block.
Warming up. Pass warmFrom to choose how many seconds before its start the run replays the market
feed from, so that its indicators and windows have history when the first live tick arrives. 0 replays
nothing: the run delivers its first signal as soon as it is running, but its indicators start empty and the
first bar of a window can be partial. Omitted, the platform replays from the start of the current 15-minute
block, which is between 0 and 900 seconds before the run's start, so the first bar of a 15-minute window is
complete. The value in effect, yours or the platform's, comes back as warmFrom. It can be set only here,
when the run is started. See the "Live execution" guide, "Warming up".
A plain WebSocket stream. Pass stream: true to get a secret URL for this run's signals that a simple
client, or a service that passes them on to others, can open as an ordinary WebSocket, from the sandbox stage
on. The URL is in the response (streamUrl) and in GET /strategy/{strategyId}/live; treat it like a
password. See the "Live execution" guide.
Start a strategy on a live market feed Starts your strategy against a live market feed. A new run begins in the sandbox stage — a short trial that compares an independent second execution against the first for agreement — before it is eligible for promotion to the live stage where it actually publishes signals other systems can act on. Poll
GET /strategy/{strategyId}/live(orPATCH/DELETE/live/{runId}once you have therunId) to watchstagemove fromSANDBOXtoLIVE.A strategy that has already been through that trial does not go through it again. When an earlier run of yours of the same compiled strategy was promoted to
LIVE, and none of that compilation's runs was stopped for using more resources than allowed, the new run starts inLIVEat once: the response saysstage: LIVEand carries the earlier verdict ingate. The parameters, sources and instruments may differ from the earlier run. Submitting the strategy again (POST /strategy) compiles it anew, and a new compilation goes through the sandbox like a first run. Sendsandbox: trueto start in the sandbox anyway — for example to read the run's signals back over the connection while you debug it, which the live stage does not keep.Only one run per strategy at a time — starting again while one is already running is
409; stop the current one first.sourcestakes exactly one entry today (multi-source strategies are not supported yet).typeistickerorkline; anything else is rejected. Both connect to the lightest (fastest) cadence available for the exchange — today that is 1 tick/second on every supported exchange; choosing among several cadences is not offered yet.venueTypeiscex(a centralized exchange) ordex(one pool on a decentralized exchange). Adexsource reads one pool, takes onlykline, and needs the pool's address as its single instrument. See the "Live execution" guide, "Sources".venueType,exchangeandsegmenthave to be onesGET /exchangeslists together: the exchange under that venue type, and the segment among itsliveSegments. Case and the spaces around a value do not matter, and the run reports them back in lower case (cx, the older spelling ofcex, is still read). Anything else is refused with400, naming what the list has.instrumentscan be left out, except for adexsource. A QTScript strategy can declare which instruments it accepts with aninstrumentsline in its source; when the compilation of the strategy records that selection as a list of pairs, a start that leavesinstrumentsout, or sends["*"], takes that list, and otherwise the run reads every instrument the exchange/segment offers. A list you send is taken as sent. Either side of an entry can be*(any base paired with USDT). The instruments the run reads come back insources. See the "Live execution" guide, "Sources".paramsis passed straight through to the strategy at start — the same free-form objectPOST /strategy/{strategyId}/validateand the backtest endpoints already accept. To change a parameter while the run is live, usePUT /live/{runId}/paramsinstead; this endpoint only sets the values a run starts with.Consuming a run's own output — its signals, and updating its parameters over a live connection instead of polling — is a WebSocket protocol on top of these REST endpoints; see the "Live execution" guide linked from this tag's description for the full flow (minting a connection token, the channel and RPC method).
Paper trading. Pass a
paperblock to have the run's hints executed in simulation from its first tick, as a backtest would execute them: fills, closed trades, equity and KPIs, with one simulated account per quote currency. Omitted, the run has no paper trading. It takes the same economics as a backtest'sbaseConfigplus where its output goes; read it back withGET /live/{runId}/paper. A strategy that listens to its own execution events (it overridesgetExecutionCallback()) has no other execution venue, so it cannot start without apaperblock.Warming up. Pass
warmFromto choose how many seconds before its start the run replays the market feed from, so that its indicators and windows have history when the first live tick arrives.0replays nothing: the run delivers its first signal as soon as it is running, but its indicators start empty and the first bar of a window can be partial. Omitted, the platform replays from the start of the current 15-minute block, which is between 0 and 900 seconds before the run's start, so the first bar of a 15-minute window is complete. The value in effect, yours or the platform's, comes back aswarmFrom. It can be set only here, when the run is started. See the "Live execution" guide, "Warming up".A plain WebSocket stream. Pass
stream: trueto get a secret URL for this run's signals that a simple client, or a service that passes them on to others, can open as an ordinary WebSocket, from the sandbox stage on. The URL is in the response (streamUrl) and inGET /strategy/{strategyId}/live; treat it like a password. See the "Live execution" guide.