Crypto backtest data deserves a check before the result does. Record the market-data source, interval, start and end time, and expected candle count. Then inspect missing intervals and the still-open final candle. A smooth equity curve cannot tell you whether the historical series was complete, aligned, or comparable with the next run.
Gimmer’s Running Backtest guide frames a run around the strategy settings and historical period you selected. This checklist adds a data question before you interpret the report: did the run receive the candle sequence you meant to test?
Why crypto backtest data quality comes first
A candlestick compresses market activity into an interval: open, high, low, close, and usually volume. A backtest turns that sequence into indicator values, entries, exits, and a historical account path. Change the sequence and you can change every later calculation.
That does not mean every gap is corrupted data. Coinbase’s official candle documentation says its historical rates may be incomplete and that it does not publish data for intervals without ticks. The official CCXT OHLCV manual likewise explains that returned candle lists may contain missing periods when no trades occurred. A gap is a question to classify, not automatic proof of a broken feed.
Define the candle contract before the run
Write a small data contract before you look at performance. It should be specific enough that another person could request the same series.
| Field | What to record | Why it matters |
|---|---|---|
| Market | Exact asset pair and market type | Similar symbols can represent different instruments or liquidity. |
| Source | Venue or dataset and retrieval date | History depth, corrections, and interval rules vary by source. |
| Interval | For example, one hour, anchored to UTC | Indicator periods and expected candle counts depend on it. |
| Range | Inclusive start and exclusive end timestamps | Date-only labels can hide timezone and boundary differences. |
| Gap policy | Reject, preserve, or repair, with a stated method | Filling a bar can invent price or volume behavior. |
| Final candle | Closed bars only, or an explicit partial-bar rule | The current candle can change before its interval closes. |
The goal is repeatability, not false precision. If the source cannot provide the requested range or interval, record that limitation and choose a comparable range. Do not quietly accept a different window because it produces a cleaner chart.
A six-step crypto backtest data checklist
- Confirm the requested market and interval. Make sure the symbol, market type, timeframe, and timezone match the strategy definition.
- Calculate the expected interval grid. For a continuous two-day range of closed one-hour bars, the simple expectation is 48 timestamps before source-specific exceptions.
- Compare expected and observed timestamps. Count duplicates, missing periods, out-of-order rows, and bars outside the requested boundaries.
- Classify each gap. Check whether it reflects no trading, a venue outage, an unavailable historical segment, a pagination limit, or a retrieval failure.
- Exclude or label the open final candle. CCXT notes that the current candle may be incomplete until the next interval begins. Mixing open and closed bars can make two runs disagree.
- Save the contract with the result. Keep the source, retrieval time, range, interval, observed count, gap decision, and strategy revision together.
This checklist does not claim that Gimmer automatically detects or repairs gaps. It is a review method for the operator who is deciding what a historical result can support.
A 48-candle example with one missing interval
Suppose a strategy test requests two complete UTC days of one-hour candles. The expected grid contains 48 timestamps. The returned series contains 47, with no bar at 03:00 on the second day.
Do not insert a flat candle immediately. First classify the absence:
- If the source publishes no candle when there are no ticks, the gap may accurately describe an inactive market.
- If the source normally publishes every interval, the missing bar may indicate a retrieval or pagination problem.
- If the market was unavailable, the gap may represent an operational event that a smooth replacement would hide.
- If another source has a candle, the two datasets may use different construction or boundary rules. One is not automatically the correction for the other.
Now consider the strategy. A moving average, volatility measure, or time-based exit may behave differently if the gap is preserved, removed, or filled. A zero-volume flat bar can be a useful explicit convention in one model and an invented observation in another. Document the choice, rerun the same locked strategy, and label the comparison.
Keep data checks separate from strategy selection
Data cleaning can become another form of tuning. If you change the gap policy, timezone, or range after seeing the outcome, you have changed the experiment. Keep the strategy revision fixed while you resolve the data question.
Then protect a later period from repeated tuning. The guide to using out-of-sample data explains why the unseen range should stay closed until the revision is locked. Data quality and out-of-sample discipline solve different problems: the first checks what entered the test; the second checks whether you kept later evidence independent.
Costs are a separate boundary too. After the candle set is understood, use the crypto trading bot fee checklist to record fees, spread, slippage, and other execution assumptions. Clean candles do not turn candle closes into actual fills.
Compare candidates on one documented dataset
When several parameter sets are tested, they should see the same documented range, interval, gap policy, and closed-bar rule. Otherwise the ranking mixes strategy differences with dataset differences.
Gimmer’s Strategy Optimizer guide is the next useful reference when you are comparing candidates. Keep the source revision and search space beside the candle contract. A top historical candidate remains a candidate, not a forecast.
After backtesting, controlled simulation can reveal order timing, state transitions, and operational behavior that candle history cannot reproduce. The Simulation and Live guide describes that next stage. Simulation is another test, not proof of a future outcome.
Crypto backtest data FAQ
Are missing crypto candles always data errors?
No. Some sources omit intervals with no trades. A gap can also come from source limits, outages, pagination, or retrieval failure. Classify it against the source’s current documentation before deciding how to handle it.
Should I fill missing candles?
Only with an explicit, defensible rule. Forward-filling price or inserting zero volume changes the dataset. Preserve the original series, document the repair, and compare the same locked strategy under both versions when the distinction matters.
Can I include the current candle in a backtest?
A current candle may still change before it closes. Closed bars are easier to reproduce. If a model intentionally uses partial bars, state that rule and do not compare the run directly with a closed-bar-only test.
Conclusion
Crypto backtest data should be traceable before a result is persuasive. Define the market, source, interval, timezone, range, expected count, gap policy, and final-candle rule. Then read the strategy outcome with those limits attached.
Next step: open Gimmer’s Running Backtest guide and write down your data source, interval, start and end timestamps, and expected candle count before the next run.
The Gimmer Team