🚀 Market Data API vs Enterprise vs Exchange Link:

Compare CoinAPI Solutions
backgroundbackground
August 27, 2025

Backtest Crypto Strategies with Real Market Data (Not Just OHLCV Charts)

featured image

Think of a racing team testing their car in a wind tunnel. If the tunnel only simulates gentle breezes, the car may look fast, but on a real track with sharp turns and high-speed crosswinds, the design fails. Most crypto backtesting is like that: traders test their strategies in simplified conditions using only OHLCV charts, but when they hit real markets - with slippage, liquidity gaps, and order book dynamics - the strategy crumbles.

Most traders and developers start with OHLCV (Open, High, Low, Close, Volume) data. It’s clean, easy to handle, and great for building indicators. But OHLCV is like watching a highlight reel, you see the end results, not the messy plays in between.

What’s missing in OHLCV-only backtests?

  • Execution slippage: OHLCV can’t show if your order would actually fill at the intended price.
  • Liquidity depth: A strategy might look profitable on paper but impossible to execute if the order book is thin.
  • Market microstructure: Spikes, sweeps, and clustering of trades vanish in aggregated candles.
  • Survivorship bias: Without full market coverage, you ignore venues and assets that delisted.

This leads to a dangerous illusion: strategies that backtest well on charts but fail in production.

To make backtests resemble live trading, you need richer datasets:

  • Tick-level trades: Every execution, with price, volume, and aggressor side.
  • Order book snapshots (L2): Market depth at multiple price levels.
  • Full limit order book (L3): Individual order placements, cancellations, and matches.
  • Quotes: Best bid/ask and spread dynamics.

Example: Order Book Snapshot (BTC/USDT, Binance)

Bid PriceBid SizeAsk PriceAsk Size
115021.990.45115022.004.81
115021.501.20115022.503.10
115021.002.75115023.001.50

A strategy that buys 2 BTC at market price would clear the first bid and move into the next level, something OHLCV can’t capture.

If you’re deciding between tick data and order book snapshots, check out our complete guide.

See also our post on L1 vs L2 vs L3 market data.

Traders often try to assemble their own historical datasets. While it’s possible to scrape data from exchange APIs, you quickly run into issues:

  • Inconsistent coverage (many coins didn’t exist before 2019, data starts late).
  • Missing or delisted pairs (introducing survivorship bias).
  • Quality checks and cleaning become a full-time job.
  • Normalizing across multiple exchanges is non-trivial.

CoinAPI removes this overhead: you get tick-level data going back as far as 2010+ for major assets, and thousands of pairs since 2017, across 380+ exchanges, already normalized and quality-checked.

CoinAPI provides both real-time feeds and historical bulk data that make execution-grade backtesting possible. Two products are especially relevant:

  • Market Data API: Best for flexible queries and iterative strategy testing. Use REST to query historical trades, OHLCV, and order books, or WebSocket for real-time replay. Perfect for traders running smaller-scale or exploratory backtests.
  • Flat Files: Best for bulk historical datasets. Delivered as CSV files over S3, they contain trades, quotes, and full limit order book updates. Ideal for quants, ML teams, or academics who need to process large datasets at once.

Together, these options let you backtest however you work: quick API calls for lightweight validation, or full historical downloads for deep research.

CoinAPI also ensures normalization across 380+ exchanges, eliminating symbol mismatches and inconsistent formats.

This means you can model:

  • Slippage under different liquidity scenarios.
  • Smart order routing across exchanges.
  • Arbitrage execution with millisecond precision.

See our full breakdown of Flat Files vs Market Data API to choose the best workflow for your backtesting.

Opinions vary: some quants only trust the last 5–6 years, while others demand 20+ years to cover every cycle. The truth is, it depends on your strategy:

  • Daily swing trading → 8–10 years minimum, to include bull and bear regimes.
  • Intraday or HFT → 1–5 years of tick/order book data is enough, since execution models must adapt to evolving microstructure.
  • Academic/ML research → as far back as possible, with out-of-sample periods (last 3–5 years untouched).

With CoinAPI, you don’t have to choose between short or long histories. Our Market Data API provides millisecond-level trades and order books dating back over a decade for major assets. At the same time, Flat Files deliver bulk daily datasets covering thousands of pairs since 2017- so you can design backtests that truly match your strategy horizon.

For a deeper dive into the quirks of historical data, read our historical crypto data guide.

Use OHLCV-only backtesting when:

  • You’re testing long-term investment strategies.
  • Execution costs are negligible.

Go deeper with tick-level/order book data when:

  • You’re developing arbitrage bots.
  • You need execution-sensitive strategies (scalping, market making).
  • You’re running academic or ML research where microstructure matters.

Comparison Table

Data TypeBest ForExample Use Case
OHLCVTrend following, swing tradingBacktest EMA crossover
Tick-level dataSignal generation, ML featuresTrain AI model on trade flows
Order book (L2)Liquidity-sensitive tradingScalping with depth awareness
Full LOB (L3)Market making, HFTExecution modeling with cancellations

When you run the request in Postman, CoinAPI will return JSON containing trade-level details such as timestamp, price, size, and taker side.

Example response (truncated for brevity):

1[
2  {
3    "symbol_id": "BINANCE_SPOT_BTC_USDT",
4    "time_exchange": "2025-01-01T00:00:00.0100000Z",
5    "time_coinapi": "2025-01-01T00:00:00.0146271Z",
6    "uuid": "1fa5a4b6-3ad5-415b-9463-5017f7c19cf0",
7    "price": 93576,
8    "size": 0.00136,
9    "taker_side": "SELL"
10  },
11  {
12    "symbol_id": "BINANCE_SPOT_BTC_USDT",
13    "time_exchange": "2025-01-01T00:00:00.0740000Z",
14    "time_coinapi": "2025-01-01T00:00:01.6007088Z",
15    "uuid": "e0fe8afa-eae5-4214-a511-fa22ce581989",
16    "price": 93576,
17    "size": 0.00212,
18    "taker_side": "SELL"
19  },
20  {
21    "symbol_id": "BINANCE_SPOT_BTC_USDT",
22    "time_exchange": "2025-01-01T00:00:00.2660000Z",
23    "time_coinapi": "2025-01-01T00:00:01.7281293Z",
24    "uuid": "f3a20cad-7463-4504-9e8f-2e6c98cef167",
25    "price": 93576.01,
26    "size": 0.00182,
27    "taker_side": "BUY"
28  }
29  ...
30]
31
32

Each trade record contains:

  • symbol_id: Market identifier (here, Binance Spot BTC/USDT)
  • time_exchange: The exact timestamp when the trade occurred on the exchange
  • time_coinapi: Timestamp when CoinAPI received and processed the trade
  • uuid: Unique identifier for the trade event
  • price: Execution price of the trade
  • size: Trade volume in base asset (BTC)
  • taker_side: Whether the trade was initiated by the BUY or SELL side

This level of granularity lets you simulate execution, measure slippage, and analyze trade-by-trade dynamics - something impossible with OHLCV candles alone.

Relying on OHLCV charts alone creates blind spots that can break your strategy in live markets:

  • Slippage ignored → Backtests assume fills at ideal prices, but real trades often execute worse.
  • Liquidity hidden → Thin order books mean your “profitable” trades may never fill at scale.
  • Market noise lost → Spikes, sweeps, and order clustering disappear in aggregated candles.

Backtests may look good on paper, but the moment you deploy, they collapse under real-world execution.

A common mistake is assuming you can always fill at the “best price.” In real life, you cross the spread, face slippage, and sometimes get only a partial fill. As traders on r/algotrading point out:

  • Always include slippage and fees in your model.
  • Use bid/ask quotes or full L2/L3 order book history to simulate realistic fills.
  • For scalping or short-term strategies, tick-level data is mandatory - 1m candles won’t cut it.
  • Consider Monte Carlo resampling or walk-forward testing to check robustness beyond cherry-picked periods.

CoinAPI advantage: With millisecond-stamped trades, quotes, and order books from 380+ exchanges, you can model execution with realistic slippage and spreads, not idealized fills.

  • Latency: Sub-100ms updates on live feeds; millisecond timestamps on historical trades and order book data.
  • Coverage: 380+ exchanges, thousands of spot, futures, and perpetual pairs, with symbol normalization to avoid mismatches.
  • Depth: L2 and L3 order book history, not just candles - so you can simulate execution and slippage realistically.
  • Update Frequency: Tick-by-tick granularity; OHLCV intervals from 1 second to 1 day.
  • Pricing: Flexible pay-as-you-go credits for small projects, academic discounts for research, and enterprise SLAs for desks that need guaranteed uptime
  • Historical depth: Data as far back as 2010 for BTC, ETH, and other majors; thousands of pairs available since 2017.

If you test strategies only on simplified charts, you’re practicing in a wind tunnel with no turbulence. Real markets have noise, gaps, and friction, and only real market data can prepare you for that.

CoinAPI makes it possible to run execution-grade backtests with normalized, time-synchronized data across hundreds of exchanges. Don’t just test your strategy - stress test it in real market conditions.

Ready to build trading systems that survive real markets? Start your first backtest today.

  1. Sign up and get $25 free credits to test our API
  2. Get your API key
  3. Pull your first dataset in minutes

For a full overview of how CoinAPI supports backtesting workflows, see our Crypto Backtesting use case page

background

Stay up-to-date with the latest CoinApi News.

By subscribing to our newsletter, you accept our website terms and privacy policy.

Recent Articles

Crypto API made simple: Try now or speak to our sales team