stratester.com

Feature

Bitcoin backtesting

A run replays your bot over real Bitcoin price history, candle by candle, with simulated money. You choose the candle size, the dates and the starting balance; the engine reports every trade, the equity curve and how the bot compares with simply holding BTC.

The data

Runs use Binance spot BTC/USDT: every one-minute candle since 17 August 2017, taken from Binance's checksum-verified monthly archives and topped up daily. Larger candle sizes (5 minutes to 1 week) are built from those candles, aligned to UTC midnight and, for weekly candles, to Monday.

Prices are in USDT, a dollar-pegged stablecoin, so results read in US dollars.

How a run works

On every candle close the engine checks your rules from top to bottom. When a rule's conditions are met its action runs immediately, and the portfolio is updated before the next rule is checked. Conditions only see candles that have already closed, so the simulation never peeks at the future.

Before your start date the engine loads extra history, at least 50 candles and up to 5,000 depending on the longest indicator in your bot (up to 20,000 when a condition reads bigger candles), so that moving averages, RSI and other indicators have settled by the first candle of the run. No rule runs during this warm-up.

Market orders fill at the close of the candle where the rule fired. A take profit or stop loss set to trigger on the wick fills at its level, and limit and stop orders fill when a later candle reaches their price.

Every fill pays the fee and slippage set on the bot. New bots start at a 0.1% fee and 0.05% slippage; bots created before these settings existed keep 0%, so their results are optimistic until you set them.

Positions and risk guards

Bots are long-only: they hold either cash or BTC. By default a bot holds one position at a time and ignores buys while it holds; turning on stacking lets it add to a position.

Every buy passes the bot's risk guards: an optional dollar cap per trade, an optional cap on the share of equity in BTC, and the cash actually available.

What you get back

  • Every fill: time, side, price, amount, the cash that moved, the fee and the rule that fired.
  • Final equity and return, against buy and hold: the starting balance put into BTC at the first candle's close, paying the same fee and slippage once, and held to the end.
  • Maximum drawdown: the largest fall of equity from a peak, measured at candle closes.
  • Round trips and win rate: a round trip runs from flat to a full exit, and it is a win when the sells brought in more than the buys cost, after fees.
  • An animated replay on the chart with buy and sell markers and the equity curve.

Limits of a run

  • Up to 50,000 candles per run (about 5.7 years of hourly candles or 35 days of one-minute candles).
  • Up to 20,000 trades recorded per run.
  • Starting balance from $100 to $10,000,000.
  • Candle sizes and how far back you can go depend on your plan.
  • A run that fails, for example because the bot is incomplete, does not use up a run.

Reading results honestly

A backtest shows how a set of rules would have behaved on past data. It is evidence, not a forecast. Markets change, and a strategy tuned until its backtest looks perfect usually disappoints on new data (overfitting).

Good habits: test on several periods, keep the number of tuned settings small, check that nearby settings give similar results, and compare against buy and hold over the same dates.

Bitcoin backtesting: frequently asked questions

Is the data real?

Yes. Every candle comes from Binance's public BTC/USDT market data, starting 17 August 2017.

Can the simulation see future candles?

No. Rules run on each candle after it closes and only use candles that have already closed.

Are trading fees included?

Yes. Every fill pays the fee and slippage set on the bot: 0.1% and 0.05% for new bots. Bots created before these settings existed keep 0% until you change them.

Can I short Bitcoin?

No. Bots are long-only: they buy BTC with cash and sell it back.

If my bot is profitable in a backtest, will it make money live?

Not necessarily. Simulated results are hypothetical and past performance does not predict future results. Use them to compare ideas, not as a promise.

How long does a run take?

Usually well under a second on the server. The replay you watch afterwards is an animation of the finished result.

Simulated results are hypothetical. They include only the fee and slippage you set on the bot, not every real-world cost or market condition, and past performance does not guarantee future results. Nothing here is financial advice.