DeployQuant and DQengine: plain-English trading strategies on an open source engine
Automate your trading in plain English.
Two things with one engine
DeployQuant is a hosted trading platform at deployquant.com. You describe a strategy in plain English, snap when/if/then blocks together, or write Python. The platform backtests it on years of minute-resolution US stock data and deploys it live in your own brokerage account at Webull, Charles Schwab or Alpaca. Several strategies run side by side in one account, each with its own cash, positions and P&L. DeployQuant never holds your money.
DQengine is the engine underneath it, published on GitHub and installable with pip. It is the same code the hosted platform runs, not a cut-down copy. On its own it backtests, and from version 0.2 it trades one strategy per broker account live.
The speed claim
DQengine is the fastest event-driven backtester we know of for US stocks on bars. All four engines in the benchmark ran the same strategy on the same SPY minute bars, 2021-01-04 to 2026-06-09, about 530,000 bars, on an Apple M5 Mac with 32 GB.
| DQengine | LEAN | NautilusTrader | backtrader | |
|---|---|---|---|---|
| Strategy that does nothing | 1.80 s | 3.35 s | 4.33 s | 18.15 s |
| Crossover, 66 trades | 2.66 s | 4.59 s | 4.54 s | 19.37 s |
| Crossover, 22,796 trades | 2.66 s | 5.42 s | DNF in 10 minutes | 21.42 s |
| Bars per second (66 trades) | 199,000 | 115,000 | 117,000 | 27,000 |
| CPU cores used | 1 | 2 to 3.5 | 1 | 1 |
DQengine's and LEAN's times include reading the bars from disk. NautilusTrader's and backtrader's do not. DQengine also used the least memory of the four. The quick-start example in the README is a 5.5-year minute-bar backtest of TQQQ and runs in about 2 seconds and 70 MB on a laptop. The benchmark scripts are in the repo under tools/bench_engines/.
What the hosted platform adds
The engine runs one strategy per broker account. The platform adds the parts most people actually need:
- An AI builder. Type a sentence like "Buy TQQQ at the first open of the week, sell at +7%, and get out Thursday at 2pm if it's losing" and the builder turns it into when/if/then blocks. Every block reads back as a sentence, and the AI converts between blocks and Python in both directions, checking the trades still match.
- Sleeves. Several strategies share one brokerage account without interfering. Each has its own cash allocation, its own positions and its own P&L. The combiner that folds their target positions into one order set is not part of the open source package.
- A decision journal. Every backtest and live decision is logged so you can see why each trade happened.
- Broker connections. Webull, Charles Schwab and Alpaca today, with more on request from inside the app. Paper trading needs no broker.
Pricing is Free, with unlimited drafts and backtests and one live strategy, or Pro at $10 a month for unlimited live strategies side by side.
Live trading in the open source engine
The part of DQengine that took the most care is not the backtester. It is what happens when real shares are involved.
The live runner replays the algorithm from its start date on every bar, compares what the replay holds against what the broker holds, and sends the difference. That design means a restart is harmless. There is no state to recover, because the state is recomputed from history every bar.
It also means an account that already holds shares is dangerous. An algorithm pointed at an account with 74 TQQQ in it reads "want 0, have 74" on its first sweep and sells them. So DQengine refuses. Until you run dqengine adopt, which reads the account's own trade history from the broker, prints what the replay holds next to what the account holds symbol by symbol, and asks for the account's label typed back, the executor will not send a sweep that touches a position nothing accounts for.
Paper trading and dry runs take one command. Real money takes two. --dry-run computes the real orders and sends none. --max-order-usd and --max-position-usd refuse anything above a size. dqengine status exits non-zero on a tick error, a rejected broker connection, an order that never resolved or a feed that went silent during the session, so a cron job or container healthcheck can watch it.
Broker credentials are encrypted in Postgres under a key derived from an environment secret. Live bars come from a bundled Alpaca websocket feed, and when the stream goes quiet during market hours the worker says so and fetches the missed minutes over REST on the same account.
What is not there yet
Second-resolution strategies backtest but do not trade live. The multi-strategy combiner is only in the hosted platform. The engine covers US stocks and ETFs. These are on the issue tracker at github.com/praneetsah/deployquant/issues.
Why publish the engine
The hosted platform is the product. Publishing the engine means anyone can verify the benchmark, run a backtest without an account, and read the exact code that will touch their broker before they connect it. For a product whose whole pitch is "your money stays at your broker", that is the right kind of transparency.
DeployQuant is at deployquant.com. DQengine is pip install deployquant.
Building something like DeployQuant?
Book a call