Backtesting Crypto Strategies: Data Sources, Common Traps, and Validation
A beautiful equity curve is often a portrait of overfitting. It sounds counterintuitive, but every crypto quant eventually crashes into this wall: the more parameters you tune and indicators you stack, the smoother the backtest looks—and the worse it behaves live. If you’re tempted to go all-in because your backtest shows 200% annualized, read this first. Most of what your strategy “earned” in the past is sitting in a market that no longer exists.
What a Backtest Actually Solves
A backtest is not built to prove your strategy makes money. Its real value is threefold:
- Eliminate obviously bad ideas. Anything that loses consistently in the past won’t suddenly come alive in the future.
- Set rough expectations. Win rate, payoff ratio, max drawdown—at least you know what magnitudes to plan for.
- Expose dependency on market regimes. If it earns 80% in bull and bleeds 60% in bear, it’s not “all-weather.”
Treat the backtest as a medical checkup, not a promise of future returns. It’s one stage of the broader quant trading workflow, not the whole thing.
Where the Data Comes From
Crypto has one underrated advantage—most historical data is free and public:
| Source | What | Notes |
|---|---|---|
| Binance / Bybit / OKX history APIs | OHLC, tick, depth snapshots | Mainstream, long history, broad coverage |
| Archive datasets (Tardis, Kaiko) | Tick, order book, trade flow | High fidelity, paid |
| On-chain (Dune, Allium, own node) | Balances, transfers, contract calls | Essential for on-chain strategies |
| CryptoCompare, CoinGecko | Aggregated quotes | Fine for coarse, long-horizon work |
Quality details that matter:
- OHLC vs tick: candles only approximate; HFT or short-term work needs tick/orderbook.
- Timezones and timestamps: exchanges mostly use UTC—never mix with local time.
- Contract rolls: futures expiries and perp funding materially alter PnL.
- Delisted assets: failing to include tokens that died is survivorship bias.
Traps You Can’t Skip
Almost everyone steps on these at least once.
1. Look-ahead bias
The strategy uses information that wasn’t actually available at decision time. The textbook version: signal on close, execute on the same close—you can’t trade at the close before it’s known. The fix is to strictly separate the “signal bar” and the “execution bar.”
2. Overfitting
Parameters tuned to fit history perfectly—flawless in-sample, disaster out-of-sample. Defenses:
- In-/out-of-sample split: train on one slice, test on a slice you never touched.
- Walk-forward: simulate periodic re-tuning and check stability.
- Parameter robustness: perturb optimal parameters ±10%; results shouldn’t collapse.
3. Ignoring slippage and fees
Backtests often assume market orders fill at theoretical prices for free. In reality:
- Shallow books: your order moves price.
- Funding rates (perps) eat directional carry.
- Maker/taker fees compound and can devour half the alpha.
Conservative defaults: assume taker fees, model 0.05%–0.2% slippage, and discount the final PnL by another 20% as a mental buffer.
4. Survivorship bias and revised data
Backtesting only “coins that are still alive today” overstates returns. Worse, if your on-chain data has been revised after the fact (wrong txs corrected, reorgs rewound), you’re using today’s view of yesterday. Always use raw, point-in-time snapshots.
5. Liquidity illusion
A strategy that works on BTC may instantly die on a small-cap with $200k daily volume—slippage and impact will wreck it. Check the volume profile before moving a strategy to a new ticker.
6. Regime shifts
Crypto changes personality periodically—halvings, ETF approvals, regulatory shocks all reshape volatility structure. Mean reversion that worked in 2021 may be dead in 2024. Slicing data by macro regime helps; the bitcoin halving cycle is a useful natural splitter.

Validating a Strategy That “Seems to Work”
Run this pass and you’ll filter out roughly 80% of self-deception:
- In-sample + out-of-sample: always keep a slice that’s never touched by parameter search for the final check.
- Walk-forward analysis: re-optimize every N months and inspect rolling performance.
- Monte Carlo trade reshuffling: randomize trade order or perturb entries; the curve should still trend up.
- Cross-market portability: a logic that works on BTC should also work on ETH, SOL. If not, it’s relying on single-name noise.
- Friction stress test: raise fees, slippage and funding by a notch. If it still earns, you have more confidence.
- Small-size live: 4–8 weeks of paper trading or minimum-size live, watching execution and real slippage, not absolute PnL.
Only after passing all six should you talk about scaling up.
Engineering Reminders
- Event-driven engines beat shortcutting with vectorized ones. Vectorized code hides bugs around order-book state.
- Log everything: every signal, every order, every reject. Without logs you cannot debug live.
- Share order logic between backtest and live to avoid drift between the two systems.
- Keep grounding yourself in market fundamentals and trading basics—your backtest assumptions ride on market microstructure.
FAQ
- Is 300% annualized in backtest a green light? Usually it signals overfitting or ignored frictions. The higher the number, the more suspicious you should be.
- How much history is enough? At minimum a full bull-bear cycle; in crypto, ideally two halving cycles.
- Is one year enough? Only as a side check. It tells you “the strategy worked in that regime”—change the regime and it likely breaks.
- Can non-coders do it? Yes, on tools like TradingView’s strategy tester—but read the docs and understand the fill assumptions.
A Backtester’s Self-Audit
- Are signal bar and execution bar clearly separated?
- Is there an out-of-sample slice untouched by tuning?
- Are fees, slippage and funding modeled?
- Are delisted tokens and point-in-time snapshots included?
- Has the strategy passed multi-market, multi-regime robustness checks?
- Before deployment, did it pass 4+ weeks of paper or minimum-size live runs?
On Being Honest With Yourself
The hardest part isn’t technical—it’s admitting you can be fooled by your own results. Every indicator you choose, every parameter you sweep, carries the bias of wanting it to work, and the market won’t reward that bias. An honest report reads more like a clinical chart than a victory speech: here are the issues, here is what we don’t know, here is what we’re guessing. Strategies written that way survive contact with live markets best.
Backtests tell you what would have happened. Only live trading tells you what’s happening now.