RoboQuant Engine
The RoboQuant Engine is the compiled runtime behind strategy authoring, backtesting, optimization, replay, and live trading. A strategy is written once as a .rq source file, compiled into a .rqc artifact, and then run by the same engine in every stage.
The engine workflow
1. Author Edit one .rq strategy source
2. Compile Verify it and produce a .rqc artifact
3. Backtest Run on bars, ticks, or L2 market data
4. Optimize Search and validate parameter ranges
5. Deploy Run the same artifact on Demo or Live
6. Monitor Follow orders, P&L, logs, and status
There is no Pine Script or MQL rewrite between testing and deployment. Parameters can change from run to run, but the executable strategy remains the compiled .rqc artifact produced from your .rq source.
Files and formats
| Format | Purpose | Edit it? |
|---|---|---|
.rq | RoboQuant strategy source | Yes |
.rqc | Compiled strategy artifact used by Backtest, Optimize, and Deployments | No — regenerate it with Compile |
.params.py | Generated parameter metadata for the dashboard | No |
.py strategy | Legacy interpreted strategy | Only when maintaining an existing legacy strategy |
.py indicator | Custom RoboCharts indicator | Yes — indicators use a separate sandboxed compute model |
New strategies use the compiled .rq format. Existing .py strategies remain readable and backtestable, but the compiled format is the supported authoring path for new work.
Current capability map
| Capability | Backtest | Optimize | Live |
|---|---|---|---|
| Single-symbol bar strategies | Yes | Yes | Yes |
| Single-symbol tick strategies | Yes | Yes | Yes |
Multi-symbol on_bars strategies | Yes | Yes, bar mode | Not yet |
| Higher-timeframe indicators | Yes | Yes | Yes |
| Market, limit, stop, SL, TP, trailing, OCO, partial exits | Yes | Yes | Yes |
| L2 book reads and depth-walked fills | Yes | Not exposed in the Optimize form | Not exposed to compiled live strategies yet |
| Strategy drawings and logs | Yes, including replay | Not collected during sweeps | Logs and status stream live |
| Engine-enforced prop-firm rules | Yes | Yes | Deployment risk limits use live account controls |
What runs where
| Product area | What happens |
|---|---|
| Strategies → Code | Edit .rq, compile it, and inspect the generated artifact |
| Strategies → Backtest | Configure data, costs, parameters, and Run or Replay |
| Strategies → Optimize | Search parameter ranges with grid or sampler optimizers |
| Strategies → Deployments | Start or stop Tradovate sessions and open live monitoring |
| Indicators | Run separate vectorized chart indicators; these do not trade |
| Workspace | Use a full project workspace when the Code tab is not enough |
Execution model
The engine controls market data, time, indicators, account state, and order routing. CME is the only market-data source in both research and live runtimes; broker integrations only route orders and return account state. Strategy code has no direct filesystem or network access. This keeps runs deterministic and makes backtest/live behavior easier to compare.
The runtime also enforces causality:
- In
on_bar, the supplied bar andctx.bar(0)are the bar that just closed. - In
on_tick,on_timer, andon_trade,ctx.bar(0)is the forming bar as known at that instant. It never contains the future final close or extremes. - Higher-timeframe indicators expose the previous completed higher-timeframe value until the next higher-timeframe bar closes.
- Tick orders are evaluated without reading future prints.
What to review before deployment
- The
.rqsource compiles successfully and a matching.rqcexists. - Every order builder ends with
.send(). - Indicator values are guarded during warmup with
let Some(value) = ... else { return };. - Tick strategies implement both
on_tickandwants_ticks() -> true. - Position sizes are contracts, and the strategy respects the instrument multiplier and tick size.
- The backtest uses realistic commissions, slippage, fill data, and an appropriate date range.
- Live deployments set order, position, and daily-loss limits appropriate for the connected account.
Documentation map
| Guide | Topic |
|---|---|
| Strategies | .rq structure, parameters, hooks, and patterns |
| Indicators | Separate custom indicators for RoboCharts |
| Backtesting | Fill modes, replay, metrics, and optimization |
| Live deployment | Tradovate Demo/Live sessions and safety controls |
| Runtime reference | Compiled strategy API tables |
The TradingView webhook workflow is still available for older integrations, but it is separate from the RoboQuant Engine. See Pine strategies for that legacy path.
Next steps
- Building a strategy → Strategies
- Running realistic research → Backtesting
- Looking up a method → Runtime reference
- Going live → Live deployment