Should I use a platform or write my own trading bot?
The choice between a platform and your own code comes down to where you want to spend your hours. A self-built bot gives you full control and a long list of jobs that have nothing to do with trading ideas. A platform takes those jobs and leaves you the rules. Both routes can express the same strategy, so the strategy logic is rarely the deciding factor.
A trading bot is software that watches markets and places orders from a fixed set of rules. The rules are the small part. Around them sits a brokerage API client that has to log in, keep its tokens alive, send orders, read back what happened and cope with the broker saying no. Around that sits hosting, monitoring and a way to check that the bot's idea of your account matches the broker's. Every one of those pieces can fail without the signal being wrong.
This page lays out what each route involves, using the product reference for DeployQuant and the library's measured results where a number helps. The measured figures cover 2021-01-04 to 2026-10-02 on $10,000 of starting capital, and every one is a hypothetical backtest. The comparison between platform and custom code is a judgment about effort and risk, and the numbers support it only in the places where they are cited.
What a self-built bot has to own
Start with the list. A bot that trades real money has to do each of these, and each one has its own failure modes.
- Authentication. Some brokers use API keys. Others use OAuth with tokens that expire and have to be refreshed. Among the brokers DeployQuant supports, Alpaca and Webull use keys and Charles Schwab uses OAuth.
- Order lifecycle. An order is submitted, acknowledged, partly filled, filled, rejected or cancelled. The bot has to track every state, including the case where a reply is lost and the order may or may not exist.
- Data. The bot needs prices at the resolution the rules use, and it has to handle gaps, late bars and halts.
- Error handling. Brokers reject orders for reasons that depend on the account, the time of day and the symbol. A bot that retries blindly can double an order.
- Hosting and monitoring. Something has to run every session, restart after a crash and tell you when it stops.
- Reconciliation. The bot keeps its own books of cash and shares. The broker keeps the real ones. The two have to be compared and brought back into line.
None of this is hard in isolation. The cost is that all of it has to be right at the same time, and the first live run is the first real test. A trading bot that fails here usually fails through an execution bug or an unhandled edge case. The signal is seldom the problem.
What a platform takes over
A platform spreads that engineering across many users and puts the result behind one interface. For DeployQuant, the product reference describes the following pieces.
Broker adapters. Webull, Charles Schwab and Alpaca are supported. Webull has live accounts only, because its API has no paper environment. Schwab is live only. Alpaca offers live and paper. Paper trading on DeployQuant's own mode needs no brokerage account at all. The Alpaca guide, the Webull guide and the Schwab guide list the order types and time-in-force options each one accepts. Alpaca accepts market, limit, stop, stop limit and trailing stop orders. Webull accepts market, limit, stop and stop limit. Schwab adds limit on close and market on close.
An order management system. The OMS sits between strategies and the broker. It tags each order with the strategy that placed it, checks it against limits and available cash, sends it down one connection per broker, tracks it and matches fills back to their owner.
Accounting from broker fills. The platform's books are built from the fill reports the broker sends back, so they record what actually filled.
Safety limits. A live deployment asks you to type a confirmation before any real order goes out. A price band rejects limit orders set too far from the market. Dollar caps apply per order and per position, with a further cap on how many orders one sync may send, and a cap never stops an order that shrinks exposure. A dry-run mode exercises the full order flow while sending nothing to the broker. A pause control exists for a single strategy and another for a whole broker connection.
Permissions. A connection is granted permission to trade and to read. It has no permission to move money out, and you can disconnect whenever you like.
Most solo bots do not have all of these. They are also the pieces that take the longest to build well, because they only show their value on a bad day.
Several strategies in one account
A second strategy is where a home-built bot often starts to strain. A broker account is one pool of cash and one list of positions. With two strategies the bot has to decide which one owns which share and which one may spend which dollars.
DeployQuant handles this with sleeves. In DeployQuant every live strategy gets a sleeve holding its own cash, positions and profit and loss. Orders carry the name of the strategy behind them and are tested against that sleeve's cash. A fill is credited to the strategy that sent the order. Two strategies can even hold the same symbol. Positions you trade by hand stay yours, and the part of the account no strategy manages is never traded.
The Free plan has room for one live strategy. Pro at $10 a month allows up to 20 running together, and adds cash allocation and top-ups for each. A custom bot can do the same bookkeeping, but it is another set of rules to write and another source of mismatch to reconcile.
The strategy logic is the same either way
The part you care about is the rule. Take the 12 templates in the library. The weekly 7% target buys at the first open of each week, rests a +7% profit target and exits Thursday afternoon if the trade is losing. The dip buyer waits for a 10% drawdown from the 20-day high, buys, and takes profit at +8%. RSI(2) snapback buys 2-day RSI washouts under 10 and exits when RSI(2) recovers above 70. All of them are a few lines of rule.
There are three ways to write one on DeployQuant: describe it in English to the AI builder, assemble visual blocks, or code it in Python using the industry-standard algorithm format, a class with initialize and on_data plus scheduled events, indicators, set_holdings and liquidate. One strategy keeps one rule set, shown as Blocks or as Code. When the AI converts between the two it backtests both and compares fills, which catches a conversion that would change the trades. Logic the blocks cannot express can sit in a Python step inside a block strategy.
That matters for the question on this page. A limit that forces you off a platform is rare, because Python on the same engine covers custom logic. The reasons to leave are different: a market the platform does not cover, an asset class beyond US stocks and ETFs, or a wish to own every layer. DeployQuant covers US stocks and ETFs today, and the reference says more asset classes are planned.
What the measured results say about where the effort goes
A backtest can mislead in the same way a hand-built bot can, and the library shows how much the strategy and the fund matter next to the plumbing. Take the median result of each of the 12 templates across the 59 ETFs. Median CAGR ranges from 0% for momentum breakout and 3-month momentum up to 6.61% for the weekly 7% target, which also made a median of 106 round trips and had a median max drawdown of 26.26%. The monthly cycle came second on CAGR at 5.46% and had the deepest median drawdown at 36.63%. The 200-day regime filter managed 1.84% with a 22.16% median drawdown.
Beating buy-and-hold is the harder bar. Two templates led on that count: the weekly 7% target and RSI(2) snapback each beat buy-and-hold on 34 of 59 funds. The monthly cycle managed 14 of 59, and the trend rules landed between 20 and 27. In other words, most rule sets lose to holding on most funds in this window, and writing the order plumbing yourself changes none of that.
The funds differ as much as the rules do. SPY gained 125.29% over the window and its worst drawdown, 24.51%, ran from the 2022-01-03 high to the 2022-10-12 low. QQQ returned 151.07% with a 35% drawdown. TQQQ returned 291.92% with an 81.68% drawdown from 2021-11-19 to 2022-12-28, and it did not recover until 2024-12-04. TLT lost 40.49%. UVXY lost 99.94%. A bot, however well built, runs whatever rule and fund you give it, and those two choices set the size of the swings you sit through.
This is the argument for validating on a platform first. The distance between a 6.61% median and a 0% median is the strategy. The distance between a working order and a duplicated order is the engineering. You want the first one measured quickly, and the second one handled by software that has been tested against real brokers.
The open-source middle path
There is an option between a hosted platform and writing everything. DQengine, the engine DeployQuant runs on, is source-available. It installs with pip install deployquant, and the module and command are dqengine. It is the same code the hosted platform runs, not a cut-down copy.
Version 0.1.0 backtests at second, minute or daily resolution. Live trading of one strategy per broker account comes in version 0.2. Strategies are Python classes in the industry-standard algorithm format. Backtesting needs only Python and free Alpaca API keys for market data, and there is no Docker image to install. The licence is PolyForm Shield 1.0.0: you can read, run and modify the source, but you cannot use it to build a product that competes with DeployQuant.
The reference quick start fetches TQQQ data from 2021-01-04 and backtests a weekly strategy. The printed result shows 1364 sessions, an end equity of $13,603.38 from $1,000.00, CAGR of +61.78%, a max drawdown of 37.90%, 520 fills from 597 orders, and a run time of 1.90s. That window ends on 2026-06-09, which is earlier than the library window, so the figures differ from the TQQQ numbers above.
In a benchmark of four event-driven engines on the same strategy and data, 530,000 minute bars of SPY, DQengine was the fastest in every test and used the least memory. A strategy that does nothing took 1.80 s and 69 MB. A crossover strategy with 22,796 trades took 2.66 s and 102 MB. The engine processed about 199,000 bars a second on one CPU core. The full method and every engine's results are in BENCHMARK.md in the repository. Speed matters here because you will run many tests while you refine a rule, and a minute-bar backtest that finishes in seconds changes how many ideas you can check in an afternoon.
What each route costs
The platform route has a stated price. Free costs $0 and includes one live strategy, unlimited strategies and backtests, live market data and the full decision log. Pro costs $10 a month and adds room for up to 20 live strategies and 20 AI build tokens a month. A build costs one token and only successful builds are charged. Extra tokens come in packs: 5 for $5, 20 for $16 and 100 for $60. New accounts begin with 5 free tokens.
The custom route has no price tag, and its cost is time. The first version of a bot that places a single market order is quick. The costs sit in the later work: token refresh that works for months, handling a rejected order, deciding what happens when the process dies between a submit and an acknowledgement, and keeping a record you can audit. Those jobs are the part-time work the short answer refers to. If building them is the hobby, the time is well spent. If the aim is to run a rule, the time delays the first real result.
DeployQuant is a software product and not a broker-dealer. It holds no customer funds or securities and gives no investment advice. Your cash and shares sit in your brokerage account under your name, which is also true of a custom bot. The difference in who is responsible for the code that sends orders is the main thing to weigh.
How to decide
Write your own when the engineering is the point. That covers learning how a brokerage API behaves, building an unusual data feed, trading something the platform does not support, or wanting every line to be yours. A self-built bot is a good project and a fair way to learn why order handling is hard.
Use a platform when the trading is the point. That covers testing a rule on years of minute data, reading why each trade happened through the decision log, paper trading on the live feed, and then going live with guardrails in place. The reference describes a path that fits most cases: prototype and validate on a platform in an afternoon, and write custom code only when you hit a limitation you can name.
The two routes are not exclusive. A Python strategy on DeployQuant is custom code. The engine is public, so an idea can start on the hosted side and move to a local install with the same strategy file.
Limits of this comparison
The measured numbers on this page describe strategy templates and funds, not platforms and custom bots. No test here compared the reliability of a self-built bot with a hosted one, and no number on this page measures that. The effort and risk points come from the product reference and general knowledge of how brokerage APIs work.
The backtests cover a single stretch of history with daily-decision rules and no margin, and the headline runs charge nothing for fees or slippage. Real accounts pay spreads and sometimes fees. Nothing here predicts what a future year will do. The related question do trading bots actually work covers what a bot adds and what it does not. The strategy library has the full results for each template.
Frequently asked questions
Should I build my own trading bot or use a platform?
Build your own if the engineering is the part you enjoy, and use a platform if the trading is. A custom bot has to handle authentication, order states, data gaps, hosting, monitoring and reconciliation. A platform spreads that work across users, and the strategy rules can be written either way.
What do I have to build myself if I write a trading bot?
You own broker login and token refresh, order submission and the full order lifecycle including partial fills and lost replies, data feeds and their gaps, error handling, hosting, monitoring, and reconciliation of your books against the broker's. The trading rule is a small share of the code. Most failures come from the other pieces.
Can I still write custom Python on DeployQuant?
Yes. Python written in the industry-standard algorithm format runs on the same engine that runs block strategies, both in backtests and live. Blocks and Code are two views of one strategy, and a Python step can be placed inside a block strategy.
Is the engine open source?
DQengine is source-available under the PolyForm Shield 1.0.0 licence. You can read, run and modify it with pip install deployquant, but the licence does not allow building a product that competes with DeployQuant. Version 0.1.0 backtests at second, minute or daily resolution, and live trading of one strategy per broker account comes in version 0.2.
How much does a platform cost compared with writing my own bot?
The Free plan costs $0 and includes one live strategy plus 5 AI tokens at signup. Pro is $10 a month and covers up to 20 live strategies and 20 tokens a month. A custom bot has no subscription, and its cost is the time spent on hosting, error handling and reconciliation.
Does a better bot make a strategy more profitable?
No test in the library shows that. Across 59 ETFs the median CAGR of the 12 templates runs from 0% to 6.61%, and the weekly 7% target and RSI(2) snapback each beat buy-and-hold on 34 funds. Those results come from the rules and the fund. Execution quality protects the result and does not add to it.
Does DeployQuant hold my money?
No. Your cash and shares remain in your own brokerage account. The connection can place orders and read the account, it has no way to withdraw money, and you can end it whenever you want.
Build it from blocks (or type it in English), backtest it on 5.7 years of minute data in seconds, tweak any parameter, then paper trade it on live data. No card, no broker needed to start.
Terms used here
Related questions
Backtests are hypothetical, computed by DeployQuant's engine on minute-resolution consolidated US market data (2021-01-04 to 2026-10-02, $10,000 starting capital, no margin, no fees or slippage in the headline run; buy-and-hold puts 98% of the account in at the first open, as the templates do) and do not guarantee future results. Nothing on this page is investment advice. Live trading involves risk of loss.