Buying or coding a trading bot is easy; knowing whether it really works is another story. Almost any system can show a spectacular equity curve in the past if it is tuned enough. The right question is not "did it win in the backtest?" but "what evidence do I have that the edge is real and will keep existing?". This is a practical process — the same one we apply to our own systems — for answering it.
1. Define the hypothesis before looking at results
Every bot should be explainable in one sentence: "it buys pullbacks within an uptrend in stock indices" or "it fades false breakouts of the Asian range in forex". If you cannot explain why it should make money — which market behaviour it exploits — any positive result is suspect of being luck. Write down the hypothesis and the rules before running the first test.
2. Backtest with real costs
A backtest is a simulation of the rules on historical data. For it to be worth anything:
- Include spread, commissions and swap. A system that makes 2 pips per trade can disappear with a 1.5-pip spread.
- Model slippage, especially for market-order entries and around news.
- Use quality data, ideally from the same broker or feed you will use live.
- Avoid look-ahead bias: the bot cannot use information that did not yet exist at the moment of the decision (for example, the close of the current bar).
3. Separate in-sample and out-of-sample data
Split history into two parts. With the first (in-sample) you design and tune. The second (out-of-sample) you set aside without looking and use only once, at the end, to check whether the system keeps its behaviour. If out-of-sample results collapse, the system is probably overfitted to the past.
4. Walk-forward: test as if it were live
Walk-forward analysis repeats the previous process on a rolling basis: optimise on a window (say, two years), test on the following period (six months), move the window forward and repeat. At the end, all the test segments are joined. It is the most honest way to simulate what would have happened if you had recalibrated the bot periodically, and it reveals whether the "good" parameters change too much from one period to another.
5. Look at the right metrics
Total profit is the least informative metric. Check:
- Maximum drawdown: the largest fall from a peak. Could you live with it, emotionally and financially?
- Profit factor: gross profits divided by gross losses. Below 1.2 the margin is very thin against real costs.
- Number of trades: with 30 trades there are no statistics; with several hundred, there start to be.
- Expectancy per trade in money and in multiples of risk (R).
- Consistency: does it win evenly, or does it depend on two or three huge trades?
- Worst streak of consecutive losses.
6. Robustness tests
A robust system should not depend on one exact parameter. Some useful tests:
- Sensitivity: nudge each parameter up and down. If a 20-period average works and a 22-period one loses, be suspicious.
- Similar markets: an idea that works on the S&P 500 should show something similar on the Nasdaq 100.
- Monte Carlo: randomly reshuffle the trades to estimate plausible drawdowns worse than the historical one.
- Crisis periods: check how it behaved in 2008, in March 2020 or during the yen spike of August 2024.
7. Demo account, then small capital
Even if the backtest is solid, going live introduces differences: latency, rejected orders, disconnections, server time. Run the bot on demo for several weeks and compare trade by trade with what the backtest would have done over the same period. Then go live with the minimum size and increase only if execution matches expectations.
8. Decide when to switch it off
Before turning it on, decide what evidence will make you stop it: for example, a drawdown 50% larger than the historical maximum, or three consecutive months below expectations. Deciding in advance avoids changing the rules in the middle of a losing streak.
Keep a log
Keep a record of every version of the bot: what you changed, why and on which data you tested it. Without that history it is impossible to know whether an improvement is real or whether you simply found another combination that fits the past. A simple log — date, change, in-sample and out-of-sample results — is enough to avoid repeating tests and to notice when you are forcing the numbers.
Red flags when buying a bot
- Results without costs included or without the number of trades.
- Promises of a fixed monthly return.
- Martingale or grid strategies without a stop (we explain them in another article in this series).
- No live track record verifiable by third parties.
Conclusion
Validating a bot is a process of elimination: each test looks for a reason to reject it. The few systems that survive realistic costs, out-of-sample data, walk-forward analysis and a demo stage do not guarantee profits, but they are far more likely not to be a mirage of the past.
Educational content. Automated trading involves a risk of capital loss; past results do not guarantee future results.
