DEV Community

Cover image for Bitcoin Trading Bot Backtest: Testing a Down Day
Bot LAB
Bot LAB

Posted on Originally published at botlab.org.uk

Bitcoin Trading Bot Backtest: Testing a Down Day

To backtest a Bitcoin trading bot for a day like today, a moderate down day for BTC, split your historical data into regimes (down days, up days, flat days) and check how the bot behaved in each one, after fees and slippage. A bot that only looks good in one regime is usually riding the market rather than showing an edge.

A moderate down day is not a crash, and it says nothing about what BTC does next. This guide does not predict prices and does not tell you to buy or sell anything. It shows how to use an ordinary down move as a prompt to test your bot properly.

Why a moderate down day is a useful test case

Most backtests are judged on one number: total return over the whole period. That hides how the bot behaves when conditions change. Ordinary down days are a good stress test for three reasons:

  • They are common. You will see many of them, so you can measure a bot's behaviour on them with a real sample instead of relying on one dramatic crash.
  • They expose direction bias. A long-only bot in a rising period can look skilled when it is only holding market exposure.
  • They are where costs show up. Choppy, mildly negative days often trigger many entries and stops, and fees add up.

If you want the fundamentals first, read How to Backtest a Crypto Trading Bot and Python Trading Bot Backtest: How to Do It Honestly.

Step 1: Label every day by regime

Before you look at bot results, label your data. Keep it simple and decide the rules before you see the bot's numbers:

  • Down day: BTC close-to-close change at or below -0.5%
  • Up day: at or above +0.5%
  • Flat day: everything in between

The thresholds are your choice. What matters is that you fix them in advance. If you tune thresholds after seeing results, you are fitting the test to the answer.

Then tag each bot trade with the regime of the day it was opened. Now you can ask a better question than "did it make money?" You can ask "where did the money come from?"

Step 2: Add realistic costs

A backtest without costs is a drawing, not a test. For a Bitcoin perpetual futures bot, include at least:

  • Taker and maker fees on both entry and exit
  • Slippage, meaning the gap between the price you expected and the price you got, which grows with order size and in fast markets
  • Funding payments, which you pay or receive while holding a perpetual position

Funding matters most for bots that hold positions for hours or days. For more on this, see Do Funding Rate and Open Interest Filters Improve a Crypto Bot?.

Run the test twice: once with your best-guess costs and once with costs 50% higher. If the result flips from positive to negative, the edge is thinner than the first run suggested.

Step 3: Look at drawdown, not just return

Max drawdown is the largest peak-to-trough fall in your equity curve. It tells you how much pain the bot produced on the way to its final number. Ask:

  • What was the worst drawdown, and in which regime did it start?
  • How long did the bot take to recover?
  • Could you, or your risk limits, have tolerated that path?

A bot with a decent final return and a deep drawdown during down days may not be usable with real money, however good the total looks. See How to Read a Trading Bot's Equity Curve for what a healthy versus fragile curve looks like.

Worked example (illustration only, no real data)

This example describes a pattern only. It contains no figures, is not BOTLAB results, and is not a claim about any real bot.

Imagine a simple long-biased trend bot backtested over a long stretch of BTC data. You label the days and tag the trades, then fill in a table like this with your own numbers:

RegimeDaysTradesNet result after costsUp daysyour countyour counta gainFlat daysyour countyour counta small lossDown daysyour countyour counta larger loss*Totalyour countyour countslightly positive*

What a pattern like this would tell you:

  • The total looks mildly positive, but almost all of it came from up days. That is what market exposure looks like, not necessarily skill.
  • The bot lost money on both flat and down days. Its edge, if any, depends on a rising market.
  • If the down-day bucket holds only a small number of trades, even its loss figure is uncertain.

Now run the cost stress test. With fees and slippage higher, the flat-day loss grows and the total may fall close to break-even. That is a useful finding, and you learned it before risking money.

Possible next steps: test whether a filter reduces trades on flat days, or check whether the bot behaves differently when it is allowed to short. Make one change at a time and rerun the whole test, not just the part you changed.

Step 4: Check for overfitting

If you tuned parameters until the down-day bucket looked better, you may have fitted noise. Basic protections:

  • Out-of-sample data: reserve a period you never touched while tuning, and test on it once.
  • Walk-forward testing: tune on one window, test on the next, then roll forward.
  • Fewer parameters: every extra knob is another way to fit the past.
  • Deflated Sharpe ratio: adjusts for how many variations you tried. See Deflated Sharpe Ratio Explained.

Also read How to Detect Look-Ahead Bias in Your Own Backtest. Look-ahead bias is the most common reason a backtest looks too good.

Step 5: Move to paper trading before real money

A backtest is a hypothesis. Paper trading on live candles with simulated money is the next test, because it shows how the bot handles prices as they arrive, without risking capital. It still has limits: simulated fills are not real fills, and results can differ once real orders hit the book.

At BOTLAB we run bots through 6 statistical gates (G1–G6), defined on the site, before any bot is called ready for a micro-live test; the details are on /platform. As of 2026-12-02 we track 301 bots: 0 are ready for micro live, 4 are on WATCH, and 297 are NOT_READY.

One example from our published paper results: the bot mr4h/long recorded 254 simulated trades over 108 days (2026-08-16 to 2026-12-02), with a 64.2% win rate and 4 of 6 gates passed. Its status is WATCH, and our verdict is that the sample is too small to conclude anything. It is paper trading, it is simulated, and a win rate alone does not show an edge. This is why we pair it with the other checks above.

A short checklist before you trust any result

  • Did you label regimes and report results per regime?
  • Are fees, slippage and funding included, and did you stress them?
  • Is the trade count large enough in each bucket you are drawing conclusions from?
  • Did you look at max drawdown and recovery time?
  • Did you test on data you did not tune on?
  • Have you paper traded it before any live use?

FAQ

Does a moderate BTC down day tell me anything about what happens next?

No. One day's move is not a signal. Use it as a reason to test how your bot behaves in similar conditions historically, not as a forecast.

How many trades do I need in the down-day bucket?

There is no magic number, but dozens are better than a handful, and a bucket with fewer than about 30 trades should be treated as a hint, not a conclusion. See How Many Trades Does a Backtest Need?.

Should I use a trade-only API key when I connect a bot?

Yes. Any key you give a bot should have trading permission only, withdrawals disabled, and IP restrictions if the exchange supports them. Never share a key that can withdraw funds. See Bybit Bot API: Set Up a Trade-Only Key Safely.

Is a high win rate a sign of a good bot?

Not by itself. A bot can win often and still lose money if its losses are larger than its wins. Compare win rate with profit factor and drawdown, as explained in Profit Factor vs Win Rate for Trading Bots.

Key takeaways

  • Split your backtest by market regime, including ordinary down days, and see where the results come from.
  • Include fees, slippage and funding, then stress them by 50%.
  • Judge drawdown and recovery time, not just the final return.
  • Small samples in any bucket mean uncertain conclusions.
  • Protect against overfitting with out-of-sample and walk-forward tests.
  • Paper trade first. Simulated results are a hypothesis, not proof.

Paper trading results are simulated. Past results don't predict future results. Crypto trading can lose money, including all capital. Not financial advice. Not available in restricted jurisdictions (see the Service Agreement). You trade with your own exchange account; BOTLAB never holds funds.

Want these checks run on your own strategy? See the strategy and backtest audit.


Originally published on BOTLAB. Score your own bot's trade log free: Check your bot.

Top comments (0)