SALEUp to 77% off
Bot testing2 min read

Crypto Trading Bot Backtesting With Candle Data

For crypto trading bot backtesting, start with a single spot market and a rule that uses closed candles. Replay signals in order, use the next eligible observation for modeled execution, and report how your assumptions affect the result.

Summarize with AI:

ChatGPTClaudePerplexityGrok
Crypto trading bot backtest on candle data with entry, stop and target levels
A backtest on closed candles, with the stop and target the rule would have used.

Choose the candle interval your rule needs

Save the venue, symbol, interval, start and end times, and time zone with the dataset. Sort rows and check that the bar timestamps advance at the expected interval. Keep gaps in your report, and skip any signal whose calculation needs missing bars. An unfinished candle can change between fetches, so leave it out of tests that depend on a closing price.

Keep signal time separate from fill time

If your rule depends on the close of the 12:00–12:05 candle, the rule can only evaluate once that close is known. Record the decision at that point and apply a consistent later execution assumption. Include fees and an explicit slippage estimate. Compare the same rule with higher costs to see how sensitive it is.

Example: both exit levels fall within one candle

Imagine an open position with a stop at $95 and a target at $105. The next candle has a low of $94 and a high of $106. The candle does not show which level was reached first. You can report both outcomes, use a conservative ordering, or fetch more granular data. Keep the chosen rule in your notes and use it consistently.

Hold out a separate period

Pick settings on one date range, then run them unchanged on a later one. Report signals, modeled fills, skipped trades, costs, and the largest peak-to-trough decline. Save the rules and data so you can reproduce the result before you move to paper testing. A backtest verifies how the rules behave under your assumptions. Real trading can differ on execution, costs, and market conditions.

See the AI Trading Bot Masterclass and guide bundle

The bundle includes the AI Trading Bot Masterclass and four digital guide packs.

Everything Bundle

Keep reading

Up nextCrypto Day Trading for BeginnersLearn what crypto day trading involves, how fees and slippage affect a round trip, and how to plan and review a practice session without risking funds.Up nextCrypto Trading Signals: A Verification ChecklistCheck crypto trading signals against original timestamps, market data and full result histories. Learn to spot missing evidence and common scam red flags.