Live Deployment
Live deployment runs a compiled .rqc strategy in a dedicated trading session connected to Tradovate. Demo and Live use CME data for the same real-time strategy market-data path; the selected Tradovate account determines only where orders are routed and where account, order, position, and fill state comes from. Tradovate is not a Roboquant market-data source.
This is the native Roboquant Engine workflow. The production TradingView webhook connector is a separate product and deployment path; these native plan limits do not change its behavior.
Current live scope
| Capability | Status |
|---|---|
Compiled single-symbol .rqc strategy | Supported |
| Tradovate Demo account | Supported and recommended first |
| Tradovate Live account | Supported with explicit confirmation |
| Bar-close strategy | Supported |
Tick strategy with wants_ticks() -> true | Supported |
| Strategy parameters at deployment | Supported |
Parameter changes on a running .rqc | Supported (Parameters on the deployment page); multi-leg baskets need a redeploy |
Multi-symbol MultiStrategy deployment | Not yet supported |
Live L2 reads in compiled strategy code (ctx.book()) | Supported |
Architecture
Deployments UI
↓
Backend creates a deployment job
↓
Worker starts an isolated trading pod with the .rqc artifact
↓
CME market data → compiled strategy → order-management engine → Tradovate execution
↓
Orders, positions, account P&L, logs, and status → Redis
↓
Backend WebSocket → Deployment detail
Each session gets an isolated pod and session ID. A stable deployment identity (strategy, account, symbol, timeframe, and broker) prevents two bots of the same deployment from running at once. Trades, position, and P&L on a deployment page cover only that deployment's own run: a redeploy starts with an empty history and its own figures.
Before deploying
Confirm that:
- The
.rqsource compiles and a current.rqcartifact exists. - The strategy has completed a realistic backtest with the intended parameters and costs.
- A Tradovate account of the correct type—Demo or Live—is connected.
- The deployment symbol and timeframe match what the strategy expects.
- Contract sizing and risk limits fit the connected account.
- The strategy is not a multi-symbol strategy: live sessions trade one symbol, and Deploy refuses a multi-symbol strategy with: "This strategy trades several symbols, which live trading does not support yet. Deploy a single-symbol strategy instead."
Deploy from the dashboard
From Strategies → select a strategy → Deploy:
- Click New deployment.
- Select a Tradovate Demo or Live mode and a matching connected account.
- Choose a CME symbol and timeframe.
- Set the order size and strategy parameters.
- Set maximum order size, maximum position size, the order-rate limit, and a daily-loss limit.
- For Live, type the displayed confirmation phrase.
- Start the deployment and wait for status to become Running.
The deployment form reads the real Tradovate account balance before launch. This balance anchors live sizing and the equity baseline; Roboquant does not silently fall back to the backtest's starting capital when the broker balance cannot be read.
Plan allowances
| Allowance | Free | Charts | Starter | Pro | Elite | Ultra |
|---|---|---|---|---|---|---|
| Connected broker accounts (all brokers) | 1 Demo only | 5 Demo only | 5 Demo only | 10 | 10 | 20 |
| Native deployment slots | 0 | 0 | 0 | 1 | 3 | 7 |
Demo and Live accounts share the connection allowance. Each enabled sub-account counts separately, even if several share one Tradovate login. Roboquant lists the accounts exposed by that login; when they exceed your allowance, choose which to enable in Accounts.
Demo and Live native deployments share the deployment allowance. Each native deployment runs one strategy on one symbol, on one Tradovate account or on several accounts of the same login. A saved strategy does not consume a slot, and saved strategies have no plan-based count limit. The standalone TradingView webhook connector has its own subscription and execution behavior; Roboquant 2.0 connection and native deployment allowances do not govern that product.
Starting, running, paused, degraded, halted and stopping pods occupy a slot until they terminate. Connection and deployment limits apply to new admissions, and the deployment allowance also applies to running bots. Existing enabled accounts remain usable after a downgrade, even above the current connection allowance. When your plan ends or is downgraded and more bots are running than it allows, you get 3 days of grace. After 6 hours over the allowance, Roboquant sends you a warning email; no bot is stopped until at least 24 hours after that warning was sent and the 3 days have passed. Then the newest deployments are stopped first, only as many as needed to fit the allowance (a deployment on several accounts counts and stops as one, except MT5, where each account is a slot); scheduled deployments that have not started are cancelled instead. When the newest one holds an open position or its position cannot be read, the next-newest flat one is stopped instead. A bot holding an open position is never stopped by this: it is left running, and only when no flat bot could be stopped in its place do you get one email about it and it is stopped once it is flat. A bot that never goes flat, or whose position cannot be read, is never stopped this way. Upgrading or adding deployment slots during the grace keeps every bot running. When Roboquant cannot read your plan, nothing is stopped. Before any warning or stop, Roboquant checks your plan and deployment slots again, with Whop if you pay through Whop; when that check fails, no warning is sent and nothing is stopped. Adding or enabling an account requires room in the connection allowance; starting another deployment requires room in the deployment allowance. Having excess existing connections does not by itself block a new deployment when a deployment slot is available. Closing positions, cancelling orders and stopping bots remain available regardless of plan allowances.
Running the same strategy on multiple accounts
One deployment can run on several accounts (2 to 20) of one broker login, for example all your funded accounts. In the deploy form, pick the main account and tick the others under Also run on. This works on:
- Tradovate: accounts of the same Tradovate login. The deployment uses one plan slot however many accounts it runs on.
- MetaTrader 5: your other MT5 accounts of the same kind (demo or real) that offer the symbol. The bot trades the same instrument on each account (
MT5U.<REF>.<SYMBOL>mapped onto each account's own id); an account that does not offer it is refused by name. Every MT5 account runs its own terminal, so each account takes one plan slot.
The accounts still count against the connection allowance.
Every account runs its own bot: it is sized on its own balance (an account reporting $0, such as a prop-firm funded account, uses the account size you enter; MT5 bots read their own account), and the risk limits (max order, max position, orders per minute, daily loss) apply to each account separately. One account's rejected order, disconnect or daily-loss halt does not affect the others, and identical fills across accounts are not guaranteed. Demo and Live accounts cannot be mixed in one deployment. A basket bot runs on one account only.
Staggered starts (account cycling)
Each account, the main one included, has one start control: Now, +1 day, +2 days, +3 days, +1 week, or a custom number of days (up to 30). Starting accounts days apart means one losing streak does not hit all of them on the same day. The review step shows when each account starts.
- An account set to a later day starts just before the market opens on that day: 15 minutes before the first session open (CME futures: the first Globex open at or after midnight Chicago time; MT5: the 17:00 New York FX day open, Monday to Friday). Exchange holidays are not taken into account. Roboquant checks for due accounts every five minutes, so an account starts 10 to 15 minutes before the open.
- The accounts that start now start all together or not at all: if one cannot start, the others are stopped again and the error names that account.
- A later account is Scheduled until its start. It keeps its plan slot from the moment you deploy, so the slot cannot be taken by another deployment in the meantime (one slot for a Tradovate deployment, one per MT5 account).
- If a scheduled account cannot start on its day (for example its broker connection was removed or its plan slot is gone), it shows Error with the reason and you get a notification; the deployment's other accounts are not affected. Start now tries it again.
Rotate accounts: one account per trade (Beta)
Beta: new and only lightly tested. Watch the first trades of a rotation closely.
On Tradovate, Rotate accounts: one account per trade (under Also run on, once a second account is ticked) makes the accounts take turns instead of all trading every signal:
- Only the account whose turn it is opens the next trade. The others keep running the strategy on every bar but skip its entries, so they stay flat.
- When that trade closes (the account is flat again), the turn passes to the next account in the order shown, then back to the first. A strategy that trades several times a day spreads its trades over the accounts. A reversal (closing and opening the other way in one go) keeps the new trade on the same account.
- An account that cannot trade (its bot is stopped, crashed, or halted by the daily loss limit) is skipped. When no other account can trade, the current one keeps the turn.
- The daily loss limit counts all accounts together: the losses of the trading day on every account of the rotation are added up, and when the total reaches the limit, every account closes its position and pauses until the next trading day (17:00 Chicago time), as above.
- Every account starts now: a rotation has no later starts. It uses one plan slot, like any Tradovate deployment on several accounts.
- An account that cannot read whose turn it is (Roboquant's Redis is unreachable) skips entries until it can, so two accounts never both take a trade because of an outage.
- Exits are never blocked, outage or not: an account without the turn still sends plain exits (no attached stop, target or trail) on the closing side of its open position, no larger than that position. It refuses any other order, including an exit with its own attached stop or target, since that could open a new position.
Each account is still sized on its own balance and gets the other risk limits (max order, max position, orders per minute) on its own. The deployments list marks the rotation's accounts rotating (Beta); each account's log says when it gets or passes the turn.
The deployments list shows each account's bot with its own P&L, together with the other accounts of its deployment. A scheduled account shows its start date with Start now (start it immediately) and Cancel (it never starts and its slot is freed). Stop in the list stops the deployment on all of its accounts and cancels its scheduled accounts; the bot's detail view stops only that account.
The standalone production webhook connector is separate from this native deployment workflow.
Duplicate deployment protection
Roboquant prevents two live pods from running the same strategy/account/symbol/timeframe/broker identity at once. This protects against duplicate orders and mixed trade history. The same strategy can run on a different account as a separate deployment, within the plan's slot allowance.
Stopping cancels working orders and flattens the bot's position (closes it) before the pod terminates. Wait for that shutdown to finish before redeploying the same identity. This duplicate guard is separate from the plan's slot limit; the old blanket five-session cap no longer applies.
MetaTrader 5 accounts
A connected MetaTrader 5 account can run a compiled strategy too. Orders go to your broker through your own account, and the deployment pages show that account's positions, orders and fills.
- Symbols. Deploy on the account's instruments (
MT5U.<REF>.<SYMBOL>, the same ids you backtest on). - Lot sizing. Sizes are lots; round them with
ctx.symbol().round_lots(x)so they respect the broker's minimum and step. A deployment on a real-money account carries a maximum order size and a maximum position size. - Hedging vs netting. Backtest in the account mode of the account you deploy on, so tickets and closes behave the same way in both.
- Demo first. Validate on an MT5 demo account before a live one.
Demo vs Live
| Mode | Order destination | Recommended use |
|---|---|---|
| Tradovate Demo | Tradovate simulated account | First deployment, operational validation, reconnect testing |
| Tradovate Live | Real-money Tradovate account | Only after backtest and Demo validation |
The old generic Paper mode is no longer used. Tradovate Demo is the paper-trading path because it exercises the same account, contract, and order semantics as Live. Market data remains CME in both modes.
Bots on Roboquant Sim practice accounts
A bot can also run on a Roboquant Sim practice account: pick the practice account in the deploy form like any other account. Orders are filled by Roboquant Sim on CME data; no broker is involved. The rules:
- One bot per practice account. A second deployment on the same practice account is refused.
- Flat account to deploy. The practice account must have no open position and no working orders when the bot starts.
- The account trades only for the bot. While the bot runs, manual orders on that practice account are refused, and Reset and Delete are unavailable. Stop the bot to trade the account by hand again.
- Deleting a practice account. Delete on the Accounts page needs a flat account: no open position and no working order. It frees the account's slot on your plan and cannot be undone. Past bot runs on the account keep their results.
- Orders are GTC. Working orders stay until filled or cancelled.
- Brackets need both legs. A bracket order needs both a stop and a target, or neither.
- Prices are rounded to the tick. A bot's limit, stop, stop-loss or take-profit price that falls between two ticks is rounded to a valid tick, as on a live broker: a limit or take-profit to the less aggressive tick, a stop or stop-loss to the tick further from the market. Orders you place by hand must already be on a tick.
- Not supported yet on practice accounts: trailing stops and break-even.
Order book in live strategies
Compiled strategies can read the live L2 order book with ctx.book(). It returns the latest MBP-10 snapshot from Roboquant's own CME feed, not from the broker, so a strategy sees the same book on Tradovate Demo and Live. The BookView API is the same as in backtests.
- The book is subscribed only when the compiled strategy's code reads
ctx.book(). - Snapshots are published at most every 250 ms (up to 4 per second).
- There is no book callback. Read the book from
on_bar,on_tick, oron_timer. ctx.book()returnsNoneuntil the first snapshot arrives after the deployment starts, and while the feed is stale for more than 10 seconds (the book is cleared rather than served frozen). Always handleNone.
Live bars are never held behind trade processing: if on_tick falls more than 2 seconds behind the feed, the oldest pending trades are skipped rather than delivered late, so a slow on_tick can miss trades live that a backtest would see. Keep on_tick fast.
Tradovate prop-firm accounts use the same execution connection as personal accounts when the authorized login exposes them and the account permits API execution. Choose the actual Demo or Live environment for the account; a prop firm's “funded” label alone does not determine which API environment it uses. Confirm the firm's current automation rules and account agreement before deploying.
Safety controls
Compiled deployments include controls outside strategy code:
- Broker reconciliation at startup — the engine reads cash, net liquidation value, and the open position from Tradovate before it starts processing new signals. A clean stop flattens the position and cancels its stop-loss and take-profit orders. At startup, a position the broker already holds on the bot's contract is adopted as the bot's own, and the Deployment Logs say so ("Adopted an existing long 2 MNQZ6 at startup as this bot's position."); this is the only time the bot takes over a position it did not open (see Shared accounts). After an unplanned restart, the engine picks up the open position and its working stop-loss and take-profit orders — each is picked up only when exactly one working order of that type is on the exit side — resizes them to the position, and later stop/target changes modify those orders instead of placing duplicates. Other working orders are left untouched and listed in the Deployment Logs. Trailing-stop state is not restored; call
ctx.set_trailing_stopagain after a restart if the strategy uses it. A partially filled entry order stays working and can still be cancelled. - Maximum order size — rejects a single order larger than the configured contract count when it could add exposure.
- Maximum position size — blocks an order that could take the net position beyond the allowed exposure.
- Order-rate limit — supported by the deployment API and enforced before orders reach the broker.
- Daily-loss halt — when the configured dollar loss is reached, the engine pauses the strategy, cancels working orders, flattens, and halts the session. On Tradovate bots, the loss counts per CME trading day, which starts at 17:00 Chicago time, measured from the account value the bot sees first that day (the day open, or the deploy). At the next trading day the bot resumes on its own: entries are unpaused, the status returns to
running, and the new day measures from a new starting value. It resumes only when the halt's close succeeded, the bot's position is flat, its broker login works, it is not held as degraded and no contract-roll halt is active; while the position is still open it stays paused, logs once that it waits for a flat position, and resumes once flat. A bot you paused, before or during the halt, stayspausedwhen the halt ends; resume it yourself. You can also pause a bot while this halt holds: it stayshalteduntil the next trading day and then stayspausedinstead of resuming. Other halts cannot be paused; stop the bot instead. When the close failed, the position may still be open, so the bot stayshalteduntil you stop it. Multi-symbol basket bots and MT5 bots still stay halted until they are redeployed. - Exchange-resident protection — stop loss, take profit, and trailing protection are maintained at the broker where supported.
- Rejected stop-loss — Tradovate rejects a stop that is already on the wrong side of the market. When the open position's stop-loss is rejected and the market is at or through the stop, the bot closes the position at market, as a backtest would; otherwise it places the stop again, once per position, sized to the smaller of the bot's position and the account's position on the same side (it is not placed again when the account is flat or on the other side). A stop that a strategy sets on the wrong side of the market is refused before it is sent: the working stop is kept, at its own price, so a trailing stop keeps tightening from it, or, when no stop is working, the position is closed at market. A market entry whose bracket stop is already through the market is refused. These checks use the last price only while it is younger than the stale-price limit (
RQ_STALE_TICK_SEC, 30 seconds by default; a bar close is as old as the bar's close time), and only a price of the bot's own contract: in roll week, ticks of another month on the market-data feed never count. A bar-only bot learns its feed's contract from the feed's contract key before each bar, or from the first tick when it also gets ticks; while that key is unknown, it bases these checks only on its own fills. With no such price the stop is sent and Tradovate judges it. When the bot cannot close after refusing a strategy's stop, it does not try again for that position until the position changes. The close cancels only that position's stop and target; the stop and target of an entry order that has not filled stay with that entry. The close only exits the bot's own position: when Tradovate reports a different position on the contract (another bot or a manual trade on the same account), the bot sends a market order for at most its own size. It cancels the strategy's resting reduce-only exit orders first, waits up to 2 seconds until Tradovate reports each of them cancelled or filled, and reads the account position again. When one of them cannot be cancelled or is not yet reported cancelled or filled (an order waiting to be cancelled can still fill), it sends no market order, since both could fill and reverse the position, and reports that this order is still working at Tradovate, naming it; the bot staysdegradedwith that message until the order reaches a final status at Tradovate (filled, cancelled, rejected or expired); then, if the position is still open with no stop-loss working, it staysdegradedand says so. When the account position moved toward flat during the cancel, one of those exits may have filled: the bot sends a market order that much smaller, or none, and reports that the position may be open with no stop-loss. The bot sends nothing when the account is flat, on the other side, or cannot be read, and reports that no stop-loss is working; it does the same when its market order cannot be sent (for example over the order-rate limit). When Tradovate answers the liquidation with an error, the bot sends no market order (Tradovate may still have run the liquidation, so an order sized from a new read could reverse the position). It pauses new entries and retries the liquidation for about 15 seconds, only while Tradovate's position on the contract still equals the bot's own (otherwise another holding shares the contract and nothing is sent); the retry never cancels the strategy's resting entry orders. If every retry fails, the bot staysdegraded(a halted or paused bot keeps its status) with entries paused and an error in the Deployment Logs so you can check the account; it does not return torunningon its own. When a retry succeeds, entries resume, unless the bot is halted or paused. While such a close at market is in flight (for up to 30 seconds, or until its order ends), the bot sends no other order for that position and logs any stop or target the strategy sets meanwhile; an order it skips is logged once per close. The bot does not close at market when the strategy's own market exits, sent in the last 30 seconds, already cover the position. When they cover only part of it, the bot sends a market order for the rest and never liquidates the account position. When the close order ends with the order status Rejected, Canceled or Expired, or fills but leaves part of the position open, the bot sends the latest stop and target that the strategy set during the close; that order can no longer fill, so the position is never closed twice. After a fill, they are sized to the smaller of the bot's position and the account's position on the same side, and not sent at all when the account is flat, on the other side, or cannot be read: a stop on a flat account could open a new position. If no stop is then working, it reports that the position is open without protection, with Tradovate's rejection text. When the 30 seconds pass and the same position is still open with no stop working, the bot reports that the position is open without protection and sends nothing: the close may still fill. When the bot cannot cancel its own stop or target before closing at market, it still closes and retries the cancel once afterwards. It reports any stop or target still working at Tradovate by its order number. A refused stop is logged once per price, not on every tick. When a take profit or stop fills, the bot cancels or resizes any exit order that Tradovate does not cancel with it, such as a stop placed again. Tradovate's rejection text is shown in the Deployment Logs. A stop that is cancelled or expires at the exchange is not placed again; the bot reports that no stop-loss is working. - Stale-price guard — a tick that arrives more than 30 seconds after it traded (
RQ_STALE_TICK_SEC) never reaches the strategy, compiled or Python, so no order is placed on an old price. The bot logs that it skipped stale ticks and trades again once its feed has caught up. Bars are never skipped. Each bot logs its price lag once a minute. - Trap/stop flattening — a fatal strategy failure, a daily-loss halt or an explicit stop cancels working orders and flattens the position through the broker's liquidation of its confirmed position. It never sends a fallback close sized from the bot's own records, which could open a position in the opposite direction. When the position cannot be read or the liquidation fails, nothing is sent and the bot retries: after a failure or halt it pauses new entries and retries for about 15 seconds; on stop it retries for at most about 30 seconds, inside the pod's shutdown time. On a compiled Tradovate bot, when every stop retry fails or times out, the bot reads the broker's position once more, within that time; when the broker reports it flat, the close only answered slowly, so the stop is not reported as failed and the Deployment Logs say so. A compiled Tradovate bot whose strategy failed (
error) is still flattened when you stop it. The bot closes only its own position (see Shared accounts): it uses the broker's liquidation, which acts on the contract's whole net position on the account, only when the broker's position equals the bot's. If every retry fails, the bot reportsdegradedwith an error saying the position may still be open, and keeps new entries paused until you stop it; a bot that already failed (error), is halted or paused, or is stopping (stopped) keeps that status and still logs the error. On Python Tradovate bots, a failed liquidation is retried, each attempt with a fresh read of the broker's position: on stop up to four attempts in about 30 seconds, after a run-time failure up to five. Nothing else is sent in its place. If every attempt fails, the bot logs the error and reportsdegraded; its final status (stoppedafter a stop) follows. When the broker's liquidation reports the account flat, nothing more is sent. A Python Tradovate bot liquidates only when a fresh read of the broker's position equals its own; otherwise it sends nothing and reportsdegraded(see Shared accounts). When the broker has no liquidation, a Python bot closes only its own size, capped at the broker's confirmed position on the same side, so another bot's or a manual position on the same contract is left untouched; when that read fails it sends nothing. - Broker-truth equity — the live equity stream is periodically corrected from Tradovate's account values rather than relying only on the latest market-data mark.
- Position mismatch guard — transient broker reads do not create phantom closes; reconciliation waits for repeated mismatches. When Tradovate reports a fill the bot did not place (a manual exit or a prop-firm liquidation), the bot re-reads the account every few seconds and lowers its own position to a confirmed flat one quickly; if that close also cancelled the bot's stop and target, it logs that the position was closed outside the bot instead of warning that no stop-loss is working. When the bot adopts an open position at startup, its trade counter counts that round trip once the position closes. The closed trade records the broker's entry price for the adopted position; its open time shows as "--" unless the bot opened the position itself.
- Tradovate request limit — when Tradovate answers a request with HTTP 429 (too many requests), it pauses that login for an hour, and every further request restarts the hour. Roboquant then stops calling Tradovate for that login for one hour, for every bot and account on it, with one exception: if the login's token would expire before the pause ends, the token renewer tries to renew it (once or twice) in the last 10 minutes before expiry, so the connection survives the pause. If that renewal also gets a 429, the pause keeps its original end time and the connection is left on; it is switched off only if the token really expires. A deploy onto a paused login is refused with the time the pause ends. A bot that starts on a paused login stops before it calls Tradovate, and a bot whose start-up contract lookup gets the 429 stops right after it; both stop with the reason "Tradovate paused this login until HH:MM UTC after too many requests — deploy again after that." A running bot stays
degradedwith the pause and its end time, places no new order and keeps no account connection open until the pause ends. Its own exit, liquidation, cancels and a protective stop or target on an open position are still let through once per pause, together with the position and order reads they need; if Tradovate refuses any of those calls with another 429, nothing more is sent for that pause — close the position in Tradovate's own app or by phone.
Exits are exempt from both size caps, so a position the caps allowed is always closable. Both caps count the bot's own position only, so on a shared account they apply per bot, not to the account's total on the contract. An exit is a close_position() / close_partial() / reduce-only order, or an order on the opposite side of the open position that has no stop-loss, take-profit or trailing stop attached and is no larger than the part of the position that other working exits (other plain exits and closes in flight) do not already cover. A stop and target placed as one OCO group count once, at the larger of the two, because only one of them can fill. An order that would reverse the position is checked against both caps as before. The order-rate limit applies to every order.
Shared accounts
A bot's position is the position it opened itself: it is built only from fills of orders the bot placed. A manual trade, another platform, or anything else on the same account and contract is not the bot's, even on the bot's contract. Roboquant does not let two of your live bots trade the same instrument on one account (same account and instrument root, any contract month); bots deployed before that check existed are not covered by it. A shared contract is not supported: the rules below limit the damage when something else does hold it.
- What the strategy sees.
ctx.position(), the entry price, equity and the size caps all use the bot's own position. The account's position on the contract can be larger, smaller or on the other side. - At startup only, a position the broker already holds on the contract is adopted as the bot's, with a Deployment Logs line saying so. After that, the bot never takes over a position it did not open.
- A fill the bot never received. When the account's position grows within 3 minutes of the bot's own order while the bot is still flat, the bot treats it as its own fill that never reached it. It pauses new entries and reports
degradedwithorder_outcome_unknown, so it cannot enter again and stack positions it does not manage. The hold ends when the fill is booked or the account is back where it was before the order, or when the user resumes the bot. An order that gets no fill or status event for 5 s also has its fills read from the broker's fill list. - Mismatches only lower. When the broker keeps reporting less than the bot's position on the same side, or flat, or the other side, for several reads in a row, the bot lowers its own position to match (to flat for the other side); it never raises or flips it. One read never changes it. A larger broker position is someone else's and never counts as a mismatch.
- Closing. A stop, safety flatten or close retry closes only the bot's own contracts and leaves the rest open, with no stop of the bot's protecting them:
- the broker's position equals the bot's → the broker's liquidation of the contract, as before (a bot alone on its account and contract behaves exactly as before);
- the broker holds more on the same side → a market order for the bot's own size (compiled bots);
- the broker holds less on the same side → a market order for the broker's size, and the bot's position is lowered only by the repeated-read rule above;
- the broker is flat → nothing is sent;
- the broker is on the other side, or cannot be read → nothing is sent, and the bot reports
degraded; - an earlier close of the bot that may still fill, or whose outcome is unknown → nothing more is sent until it is resolved, so the position is never closed twice.
- Python bots close only when the broker's position equals the bot's; in every other case they send nothing and report
degraded. - A close larger than the bot's position. The broker's position can change between the bot's read and its close (a manual trade at the same moment). A close is then booked only down to flat; the rest is reported as an error, and the position left on the account is not the bot's. Tradovate does not treat these closes as reduce-only (and other brokers may not either), so in that race a close can also reverse the account's position: check the account when the Deployment Logs report it.
- After an unclear close. When an earlier close of the bot was cancelled, expired or rejected at the broker before it was fully booked, the running bot sends no further close and reports
degraded. When you stop it and that earlier close was a liquidation of the whole contract (sent while the broker's position equalled the bot's), it liquidates again only if a fresh read shows the broker's position equal to the bot's and none of its closes is still working (a liquidation cannot reverse a position). After an earlier close sized to the bot's own position, or in any other case, nothing is sent. When the outcome of an earlier close is unknown (its send failed without a clear answer, or its status cannot be read), nothing more is sent, on stop too. - After a liquidation without an order id (common when the account holds only this bot's position), a stopping or flattening bot counts itself flat at once and sends no new order until the broker reports the contract flat.
- Working orders. A compiled bot cancels only its own orders. A Python bot's shutdown still cancels every open order on its symbol, except when its close will be refused (the broker's position is not the bot's): then it keeps working only its own stop-loss and take-profit orders that are no larger than its position, since that position stays open, and cancels its other orders (entries, and any order that could reverse the position). Whether the broker's liquidation also cancels other working orders on the contract has not been confirmed for every broker: treat any other order on the bot's contract as possibly cancelled when the bot liquidates.
Parameters and code updates
Deployment parameters are applied when the .rqc session is created. While the bot is running (or degraded), Parameters on its deployment page changes them without a redeploy:
- The session creates a fresh instance of the same
.rqcwith the full new parameter set, runs itson_init(so indicators whose period comes from a parameter are registered again) and computes its indicators over every bar the session holds. Only then does it replace the running instance, between two market events. - Kept: the broker connection, the open position, working stop-loss / take-profit and other orders, cash, trades, the equity curve, the bar history and a paused state. The session and its deployment page stay the same.
- Reset: every non-parameter field of the strategy (it starts from its default value, as on a new run), plots, tables and drawings. The new instance reads the position from the broker like any callback; nothing is replayed, so the change itself sends no order. A timer with the same interval keeps its schedule. With live warm-up enabled, the new instance first replays the bars the session holds without placing orders, so its own fields are rebuilt as in a backtest; the change itself still sends no order.
- If the new instance cannot start (for example it traps in
on_init), the running instance keeps trading with the previous parameters and the logs say so.
Multi-leg baskets and crypto paper bots cannot change parameters while running: stop and redeploy them.
To change code:
- Stop the current deployment.
- Edit the
.rqsource. - Save and compile a fresh
.rqcartifact. - Start a new deployment.
This makes the deployed artifact explicit. Editing a source file does not mutate a pod that is already trading.
Live warm-up
Live warm-up is rolling out gradually. Until it is enabled for your bots, a bot starts as described above: it computes its indicators over the history it loads at start (about 5 days of 1-minute bars), and on_bar first runs on the first live bar, so state kept in the strategy's own fields starts empty. When live warm-up is enabled:
- Depth. The bot loads up to 5,000 past bars of its own timeframe before it trades. The depth is the larger of 2,000 bars and what the strategy's indicators need (an indicator's length times the ratio of its timeframe to the bot's, three times that for EMA-family recursive ones such as EMA or MACD, five times that for Wilder-smoothed ones: RSI, ATR, ADX/DI, CMO, Keltner, SuperTrend and Chandelier), capped at 5,000.
- Source. CME bots take these bars from the same CME archive backtests use, joined to the live feed's recent bars (the live feed wins where both have a bar). If the archive ends before the live feed starts, the two are not joined across the hole: the bot warms up on the live-feed bars only. MetaTrader 5 bots, and other bots whose market data comes from the connected account, use only that account's feed, so they warm up on the bars that account provides (usually a few days).
- Replay. The bot runs your strategy's
on_bar(and its timers) over every past bar against a simulated account, as a backtest without warm-up would. Nothing reaches the broker, and the replay records no trades, equity points, notifications or alerts. Strategy log lines from the replay are counted and replaced by one summary line. Plots keep only their most recent past points (up to 2,000 per series, fewer when a strategy has many plots), and drawings and tables keep their final state.ctx.is_warmup()returnstrueduring the replay andfalseonce the bot is live (and always in backtests). - Switch to live. At the first live event the simulated account is dropped: its position and working orders are discarded, and
ctx.position()reads the bot's real position from the broker. Cancelling or modifying an order placed during the replay does nothing. If the replay ended holding a position the broker does not show (or the reverse), the logs say so. A strategy that tracks its own position in a field (anin_tradeflag, an entry price) can carry a replayed value into live trading: readctx.position(), or skip that bookkeeping whilectx.is_warmup()istrue. - Deployment page. The first log line reads "Connected — warmed up on N of M bars (timeframe) from <date> (source)". When fewer bars were available than the strategy needs, it adds that the available history ends there and signals that need more history may differ from the backtest.
- Restarts and parameter changes replay the same way, so they no longer reset the strategy's own state.
- Feed reconnects. Bars missed while the live feed reconnects are added to the history and the indicators are recomputed, without running
on_barfor them and without orders. The logs report how many bars were caught up. - Not covered: multi-leg (multi-symbol) bots keep today's start-up. Contract rolls are not applied to the warm-up history, so higher-timeframe values close to a roll can differ slightly from a backtest.
Contract rolls
A CME bot on a continuous symbol trades the contract month the live market feed carries when it starts, and keeps that month for the life of the session. If the feed's month can't be read at start (at weekends and in the daily break), it takes the month of the last live trades when those are under 6 hours old, otherwise the month the roll rule picks, and holds new entries until the feed shows a month. A bot can't start on a contract inside its cut-off: it reports that it is waiting for the feed to move, and that any position already open stays at the broker with its broker stops, unmanaged. Deploy it again once the chart shows the new month.
The bot halts when either comes first:
- the feed moves to another month, or
- the cut-off arrives: 24 hours before the contract's expiry, or its first intent date if that is earlier. For CME bitcoin and ether futures (MBT, MET, BTC, ETH), which are cash-settled monthly contracts whose feed moves to the next month only after expiry, the cut-off is 4 hours before expiry.
On a halt, new entries stop, the status names the contract, and you get one email about it.
- If the bot is flat, its pending orders are cancelled.
- If a position is open, it stays open: a roll halt never closes it. The strategy's own exits are paused, and only stop and target orders already resting at the exchange remain active. Manage that position yourself. Stopping the bot closes it at market, as long as the bot has not restarted since the halt.
- A bot sees and orders only its own month. Where the bot can read the whole account, as on Tradovate, a bot not deployed on a dated contract checks it at start: if it holds another month of the bot's root, for instance after a restart with a position left on the old month, the bot goes
halted, opens no trades and names that month in its status and Deployment Logs. It never orders that month, and Stop does not close it: close it in your broker's app or from the order ticket on the RoboCharts chart, then deploy again. A failed account read at start does not stop the bot. - Prices from another month never reach the strategy, and they don't move the bot's trailing stop.
While the feed's month is unknown, a flat bot holds new entries and carries on by itself when the feed returns on its month. An entry order already resting at the broker can still fill: that fill ends the hold, so the strategy sees it and can manage the position. A bot with an open position keeps running so its exits are still attempted, which means the strategy can also add to the position, and it logs one warning.
A halt is expected at each roll. Stop the bot and deploy it again once the chart shows the new month. A bot deployed on a dated contract starts on that month and does not follow the feed, so another month on the feed never halts it. It halts only at that contract's cut-off.
Live monitoring
Click a deployment row to open its detail view. The WebSocket stream carries:
| Event | UI effect |
|---|---|
| Status | Starting, running, paused, degraded, halted, stopping, stopped, or error |
| Bar | Extends the live chart |
| Order | Shows accepted, filled, and cancelled orders. An order that never reached Tradovate because Tradovate refused the login (HTTP 401) shows as ORDER NOT SENT: … — Tradovate login expired, not as cancelled |
| Position | Updates side, size, entry, and unrealized P&L |
| Trade | Adds a completed round trip |
| Equity | Updates net liquidation, realized P&L, and unrealized P&L |
| Log | Shows strategy messages and engine/broker warnings |
The detail view provides Overview, Chart, Trades, and Logs views. Strategy ctx.log(...) messages are sent to both the live stream and pod logs. Before a line reaches the Logs view, internal network addresses (connection URLs, IP addresses, localhost:<port> and host.domain:<port>) are replaced with [internal endpoint], and error tracebacks are kept to the pod logs; your own file and line references such as main.rq:42 stay readable.
Bot performance vs. account equity
The deployment page shows only the bot's own performance for the current run. Trades, position, realized and unrealized P&L, win rate, and the P&L curve come from Tradovate fills of orders this run's pod placed. Manual orders, other deployments, and earlier runs of the same deployment are never included.
The only shared figure is Account equity (shared): the Tradovate account's net liquidation value. It includes manual trading and every other deployment on the account.
If a position the bot opened is closed outside the bot (for example by a manual order), the bot detects that it is flat. The same happens when the run stops or errors while still holding a remainder. The remainder then appears in the trades list as Closed outside the bot: no exit price or time, P&L shown as "—", and excluded from bot performance. The page never shows a position the bot no longer holds.
Status meanings
| Status | Meaning |
|---|---|
starting | Pod or broker session is being created |
running | Strategy and broker connection are active |
paused | The pod and broker connection remain active, but strategy callbacks are paused. A degraded bot can be paused too; it stays paused when broker reads recover |
degraded | Repeated broker account reads are failing. With no open position, strategy callbacks pause so no new entries are sent; with a position open, the strategy keeps running so its exits are still attempted. The session returns to running on its own once broker reads recover. The message names the cause: Tradovate not responding (wait; it resumes by itself), login expired (reconnect the account), or account not found (stop the bot). When a compiled (.rqc) Tradovate bot can no longer get a working login on its own, the message is one of two: "Tradovate connection expired — open Accounts, reconnect this Tradovate account and make sure it is enabled. New entries are paused; the bot can't manage an open position until then." (reconnect the account under Accounts, and click Enable when the plan's account limit requires it), or "This bot's Roboquant session expired — stop and redeploy it. The bot can't manage an open position until then." (stop and redeploy the bot). When such a bot (Tradovate connection expired) tries to send an exit while a position is open and Tradovate refuses the login, the message becomes "An exit could not be sent: the Tradovate login expired. Reconnect this Tradovate account under Accounts now — the bot can't close this position until then. Any stop or target already working at Tradovate is still active.", the Deployment Logs get one error with the same text, and its owner gets one urgent email within about 5 minutes (once per open position, never resent; not for an expired Roboquant session, which keeps its stop-and-redeploy message). The bot still retries its exits: once the account is reconnected, the next exit goes out. In that state the bot backs off to reading its Tradovate account once every 5 minutes (its first retries come after 60 s and 120 s), never flattens or cancels anything on its own, and returns to running within about 3 minutes of a reconnect. A compiled (.rqc) Tradovate bot that stays held with no open position and the "account not found" text for 12 hours stops itself, but only when its own records show no position and, while it still has a working login, Tradovate's position list for the account is empty (once Roboquant has switched the connection off as "account no longer exists", that confirmation replaces the position-list read, which needs a login). It ends as error (below) and its owner gets one email. A transient failure text in between (Tradovate not responding, login expired) keeps the 12-hour count running; a successful account read, a position opening, a user pause or stop, or a halt resets it. A failed check is retried after 5 minutes. Bots deployed before this release do not stop on their own |
halted | A safety rule stopped new trading. The daily-loss halt flattens first and, on futures bots, ends at the next trading day (17:00 Chicago time); a contract-roll halt leaves an open position in place |
stopping | Kubernetes accepted the stop and the engine is flattening or terminating |
stopped | The session was intentionally stopped. A plain stop carries no reason |
error | The strategy or session failed; safety cleanup is attempted. A bot that could not look up its contract at Tradovate (the lookup is retried three times, including when Tradovate rate-limits it), or that was shut down before it received any market data for its symbol, ends here with that reason. When Tradovate refuses the lookup, the reason says so: login expired (reconnect the account) or market access refused for the account. A Tradovate account that Tradovate no longer lists for its login (closed or reset by a prop firm), or an expired Tradovate login, is refused at deploy before any pod starts; a compiled (.rqc) bot that meets either when it connects ends here with "Tradovate account … no longer exists (closed or reset by your prop firm?) — reconnect and pick the current account", "Tradovate refused access to account … — reconnect your Tradovate account, then pick the current account" (Tradovate answered the account lookup with a permission error) or "Tradovate login expired — reconnect your Tradovate account". Interpreted Python-lane bots keep their earlier connect error wording until a follow-up. A bot stopped by the account-not-found auto-stop (see degraded) ends here with "Stopped: Tradovate has reported for 12 hours that this account no longer exists (closed or reset by your prop firm?). The bot had no open position. Deploy it again on your current account." Its stop flatten cannot reach an account Tradovate no longer has; the log then says the bot was verified flat just before stopping instead of warning that a position may be open |
The pod exposes /live for liveness and /ready for readiness. A halted or degraded engine remains live so Kubernetes does not restart it into trading, while readiness fails until the engine is running or paused.
Status reason codes
A status's text can be replaced by a later status, so engines also report a fixed code for systems that act on status, such as alerts. It never changes the status or its text.
| Code | Meaning | Published with |
|---|---|---|
broker_read_failed | Broker account reads are failing, the login is lost, or the account is gone | degraded |
missing_stop | A protective stop is missing, or an order was left working | any status below |
safety_flatten_failed | A safety flatten failed, so a position may still be open | any status below, and the final stopped or error |
order_outcome_unknown | An order was sent and its outcome isn't known | degraded |
login_paused | Paused until the broker login recovers | degraded |
roll_halt, daily_loss_halt | The safety rule that halted the bot | halted |
reason_codeis in the status keyrq:trading:status:{sid}, written whole on each status publish. It is not in thelive_statusmessage sent to the browser. No code means none or unknown: bots deployed before this release have none until their pod is recreated.missing_stopandsafety_flatten_failedcome from engine state at publish time, on any status exceptstoppedanderror, so they can appear onrunning,pausedorhaltedand can disagree with the text. Check the code before the status. Onlysafety_flatten_failedcarries over to the finalstoppedorerror.reason_codechanges only on a publish, so it can go stale.critical_codein the state snapshotrq:trading:state:{sid}holds only those two critical codes and is refreshed about every 10 s and at shutdown, with no publish. It isnullwhen clear and absent on older pods, and it reaches the owner's state in the API and MCP. The snapshot expires after 24 hours, so treat an absent field as unknown, not as cleared.- A final snapshot of a
stoppedorerrorbot can still readmissing_stopafter the order was cancelled, because no check runs on those statuses. Treat it as "may need checking". status_updated_atresets on every publish, including a text refresh, so it does not time how long a state has lasted.
Bot alerts
Off unless RQ_STATUS_SWEEP_ENABLED is on for the worker-agent (on in Preview and Beta) and RQ_NOTIFICATIONS_ENABLED for the backend. One worker-agent replica at a time (rq:trading:status-sweep:lease) reads every watched session's keys every 30 s and tells the backend's POST /api/internal/deployments/{sid}/status-event what happened, by event name and time. The backend writes the notification to the session's owner, in its own words.
| Event | When | Severity |
|---|---|---|
crashed | A final error, or a record error | critical |
unresponsive | No heartbeat on two passes after the bot was seen alive, about 60 s, and it isn't stopping | critical |
flatten_failed | safety_flatten_failed, on any status | critical |
check_orders | missing_stop. It says "may need checking", because the same code covers an order left working while flat | critical |
order_unknown | order_outcome_unknown | critical |
stopped_unexpectedly | stopped with no stop_requested_at: a drain, a reclaim or an external kill | warning |
broker_trouble | degraded with broker_read_failed, login_paused, or no code, for 10 minutes. It shows the engine's reason, so that text must stay readable by a customer | warning |
halted | halted, naming the daily loss limit or the roll. A roll halt shows in the app only here, because it has its own email | warning |
recovered | An alerted problem cleared on a fresh read of a bot still running or paused. A pause doesn't clear broker_trouble or order_unknown, because it says nothing about them | success |
started, paused, stopped | A status change, or a stop with stop_requested_at | info, no toast |
- Each session has a record,
rq:trading:notify:status:{sid}, so a pod or worker restart replays nothing. A session first seen already ended or stale is recorded silently. - At most one alert per class per session per 30 minutes. A suppressed alert gets no recovery row and goes out if it's still open when the cooldown ends.
- A stop has one notification key,
bot-stop:{sid}, shared withbot_stop_notices:crashed,stopped_unexpectedlyand a finalflatten_failed. A row that owns the stop (account_goneorconnection_dead, not superseded) skips the sweep's generic one. unresponsivehas its own key,{sid}:unresponsive:{since}, because a bot that comes back has not stopped. After an alertedunresponsive, a latercrashedorstopped_unexpectedlysends nothing, since the owner already knows. A finalflatten_failedand astoppedstill send.- With at least 10 live pods and at least half with no heartbeat, the sweep holds their
unresponsivealerts for at most 20 minutes, because that is Redis and not the bots. A pod that left the pod list really is gone, so its alert isn't held. - A failed backend call moves nothing on. The sweep retries each pass, with the same key.
- A dead sweep sends no alerts: watch
rq_trading_status_sweep_last_pass_timestamp_secondswithmax by (namespace), since only the replica holding the lease advances it.rq_trading_status_sweep_events_totalcounts each send by event and result.
Trade opened and rejected order notifications
Off unless RQ_NOTIFICATIONS_ENABLED is on for the backend. Bot pods call the backend's POST /api/internal/deployments/{sid}/order-event with their session token, and the notification goes to the token's user. Only a pod from this release sends these, so a running bot needs recreating.
| Notification | Example | Category | Severity | Email by default | At most |
|---|---|---|---|---|---|
| Trade opened | "NQ Breakout opened a trade": "NQ long: 2 at 21500.25". Outside the app, a CME trade reads "NQ long: 2" | trade_fills | info | off | one per bot per 10 s |
| Order rejected | "NQ Breakout had an order rejected": "Your broker rejected an order from this bot on NQ: Margin exceeded. Check this bot's position at your broker." | bots | warning | on | one per bot per hour |
The pod posts in the background, one attempt with a 10 s timeout, so a slow backend never holds up a strategy. A 404 is quiet, because the route doesn't exist while the flag is off, and the next event tries again. Any other failure logs a warning and counts in rq_live_backend_request_failures_total{op="order_event"}.
Trade opened comes from the engine opening a position, not from fills.
- A scale-in, a later partial fill, an exit and an adopted position send nothing. A flip sends its closed trade and one opened trade.
- The size is what first opened: an order that fills 2 and then 3 shows 2.
- On MT5 each ticket is a position that closes as its own trade, so a second entry on the same side sends its own row.
- A position the bot didn't place sends nothing. A Tradovate session drops other orders' fills, an MT5 session only ever sees the bot's magic, and the Python lane checks each fill's order id against the orders the pod placed.
- The 10 s window is fixed to the backend's clock. A second open in the same window isn't sent, so a very fast flip can show the close without the new open, and a burst across a window's edge can send two.
Order rejected is read from the session's transport_errors text, because that is the only place a compiled bot reports it. The texts are Tradovate rejected order {id}: {reason}, rejected: {reason}, order {id} rejected: {why} and close {seq} rejected: {why}.
- These formats also carry refusals that aren't the broker's, and those send nothing: an order cap, a degraded or stopped session, a missing price or SL/TP on the wrong side, and every transport or HTTP failure. That includes an MT5 close with no server reply, retcodes 0, 10012 and 10031, which the bridge labels rejected. So do
stop-loss leg ...,position {role} ... rejected,modify of,cancel ofandoutcome unknown. - A refused cancel reads as a bare
rejected: {reason}too, so that format counts only when a report shows an order refused before it was accepted. The refusals Tradovate is known to send (Too late to cancel,TooLate,Order is not working) never count. Any other refused cancel's text, in the same drain as such an order, can still be sent as the reason. If the drain runs just before that report is published, that rejection sends nothing. - A rejected stop leg sends nothing, because
missing_stopcovers it. A rejected target leg does send, because nothing else would say so. - On the Python lane, only an order the broker itself refused counts: a login pause, a timeout, an HTTP error or a check on our side doesn't.
- At most one reason per drain, and one row per hour. A later rejection with a different reason in that hour isn't sent. Reasons drop any JSON or HTTP body and stop at 200 characters.
tests/test_order_event_notifications.py reads the Rust format strings, so a changed text fails a test.
Troubleshooting
| Symptom | Check |
|---|---|
| Deploy is disabled | A valid .rqc exists and the selected account type matches Demo/Live |
| Invalid artifact error | Save and compile the .rq source again |
| No orders | Strategy logs, wants_ticks for tick strategies, session filters, and parameter values |
| No live chart updates | Deployment status, market session hours, and selected symbol/timeframe |
| Session is degraded | Logs for repeated Tradovate account-read or transport errors. If the account shows Expired under Accounts, reconnect it; the session resumes by itself. "Tradovate connection expired": a deactivated account appears under Accounts → "Choose accounts to enable" with a Reconnect button; reconnect it (and click Enable if the plan's account limit requires it) and the bot resumes within about 3 minutes, its open position untouched. "Roboquant session expired": stop and redeploy the bot |
| Bot stopped with "Tradovate has reported for 12 hours that this account no longer exists" | The prop firm closed or reset the account. Connect the current account under Accounts and deploy the bot again on it. If the account should still exist, check it with Tradovate or the prop firm first |
| Session halted | Daily-loss or other risk-limit messages in Logs. For a contract roll, see Contract rolls |
| Redeploy is rejected | Wait for the previous pod for the same deployment identity to terminate |
| Deploy says live bots are not available for a symbol | The live feed does not stream that contract yet; pick one of the listed symbols |
| Parameter change is rejected | The bot must be running or degraded. Multi-leg baskets and crypto paper bots need a stop and redeploy. If the logs say the previous parameters were kept, the new values made the strategy fail in on_init |
Related docs
- Strategies — compile the artifact that gets deployed
- Backtesting — validate the same artifact first
- Runtime reference — live-supported hooks and methods