How to backtest a crypto trading bot honestly

A backtest replays a bot’s settings on past prices to see how they would have traded. It is useful for rejecting bad settings, but easy to fool yourself with: the best result on one stretch of history is usually partly luck. Test on enough data, include fees, and check the chosen settings on a later period they were not picked on.

In short

  • A backtest shows what would have happened, not what will happen.
  • Include fees and use at least several weeks of data across different market moods.
  • The more settings you try, the more the best one is fitted to noise (overfitting).
  • Forward testing, on days the settings never saw, is the honest check.

What a backtest does

The backtest walks through historical candles and, at each step, does what the bot would have done: open a deal, fill a safety order when the price reaches it, close at the take profit or stop loss. At the end it reports the profit, the number of deals, the deepest drawdown and how long money stayed locked in open deals.

Five rules for reading a backtest honestly

  1. Include fees. A strategy with many small trades can turn from profit to loss once 0.05–0.1 % per trade is counted.
  2. Mind the candle size. On 1-hour candles the backtest cannot know whether the low or the high came first; finer candles are closer to reality.
  3. Use enough history. A week that only went up flatters every long bot. Cover rises, falls and sideways stretches.
  4. Look at the worst deal, not only the total. The deepest drawdown and the longest open deal tell you whether you could have lived with it.
  5. Distrust the single best result. If you tried 200 settings, the top one is partly luck.

Overfitting, in plain words

Every price history has noise: random wiggles that will not repeat. Searching many settings for the best past result finds the ones that happened to fit that noise. They look excellent on the data they were chosen on and ordinary, or worse, afterwards. Simpler settings that do decently on many coins and periods usually hold up better than a perfect fit on one.

Forward testing: the honest check

Split the history: pick settings on the earlier part, then run them unchanged on the later part. Only the second result is evidence. Running the bot live with a small amount, or on a demo account, is the same idea in real time.

QuantPhi’s live results page works this way: alongside users’ live bots (shown anonymously), it lists backtests that were checked again on days they never saw. Returns are shown in percent, and only as what happened, not as a promise.

Backtesting on QuantPhi

Backtests on QuantPhi replay your DCA settings on a pair’s price history on the exchange you trade on, with fees, before you open a bot. The market scanner does the same for the most traded coins on your own settings and ranks them. Paid plans and the trial include a daily backtest allowance.

Before backtesting, you can sketch the ladder in the DCA bot calculator.

Questions

Is backtesting reliable for crypto bots?

It is reliable for rejecting settings that would clearly have failed, and unreliable as a forecast. Results depend on the period tested; a forward test on later data is the better guide.

How much data should a backtest use?

Enough to include rising, falling and sideways stretches: usually several weeks to several months for short-term bots, on fine candles.

What is forward testing?

Running settings, unchanged, on a period after the one they were chosen on, either on later history or live with a small amount. It shows how much of the backtest result was real.

Try it on your own exchange account

QuantPhi runs DCA, grid, rebalance and Hedge Stop bots on Bybit, OKX, Bitget, Binance, BingX, Coinbase and Hyperliquid. There is a free plan; your funds never leave your exchange.

Create a free account

Crypto trading involves risk; past results and backtests do not guarantee future returns. This guide is education, not investment advice.