Quant tradingQuant Lab · Quant / Global

Backtesting a Crypto Strategy: The Pitfalls Specific to Digital Asset Markets

A basic bitcoin trend strategy shows 211% a year in a naive backtest, and 41% once corrected. Using real data, we isolated each pitfall behind the gap: look-ahead, fees, funding, exchange choice and parameters.

By Alain LegrandAudited methodologyPublished on · 7 min read

Last methodological review:

#crypto#backtesting#funding rate#slippage
Backtesting a Crypto Strategy: The Pitfalls Specific to Digital Asset Markets

Quantitative Research · Quant Lab

Backtest & DSR Analyzer

Photo : Hugovanmeijeren — Wikimedia Commons (CC BY-SA 3.0)

Executive Summary

Key Takeaways (TL;DR)

  • Result: 211.4% a year, a maximum drawdown of 25.2% and a Sharpe ratio of 3.02.
  • At a cost of 0.15% per change, 0.10% in commission and 0.05% of slippage between the quoted price and the price obtained, the annualized return drops from 59.3% to 54.9%.
  • On Binance's BTCUSDT perpetual, the rate was positive, and therefore paid by longs, in 86% of the 7,711 funding periods since September 2019.
  • On March 12, 2020, the day's low was $4,410 on Binance and $4,644 on Coinbase, a 5% gap.

A basic bitcoin trend strategy, going long when the price closes above its 50-day moving average and staying in cash otherwise, shows a 211.4% annualized return since September 2019 in a naive backtest. Corrected for classic errors, it falls to 40.9%, barely better than simply holding bitcoin over the same period (35.2%), with a maximum drawdown of 59%, versus 77% for holding. Using real data from Binance and Coinbase, we isolated, one by one, the pitfalls behind this gap.

The pitfall that multiplies everything: deciding with a close you do not know yet

The costliest error fits in one line of code. In the naive version, the signal is computed with the day's close and applied to that same day's return: the backtest already "knows" whether the day will end higher. Result: 211.4% a year, a maximum drawdown of 25.2% and a Sharpe ratio of 3.02. Deciding on the previous day's close, the only thing possible in real life, the same strategy returns 59.3% a year, with a maximum drawdown of 56.9% and a Sharpe of 1.35. A result that looks too good to be true almost always is.

Candlestick chart for trading analysis
Photo: Rafael Minguet Delgado (Pexels)

Fees and slippage: 19 round trips a year

The strategy changes position 18.9 times a year on average. At a cost of 0.15% per change, 0.10% in commission and 0.05% of slippage between the quoted price and the price obtained, the annualized return drops from 59.3% to 54.9%. That assumption remains optimistic: crypto liquidity is fragmented across many exchanges, and slippage explodes precisely on crash days, when a trend strategy sells.

Funding, a cost invisible to the naive backtest

Many traders run these strategies with perpetual contracts, which require paying or receiving funding every 8 hours. On Binance's BTCUSDT perpetual, the rate was positive, and therefore paid by longs, in 86% of the 7,711 funding periods since September 2019. On average, that amounts to 11.6% a year for a long position, with peaks of 30.6% in 2021 and 17.2% in 2020, versus 2.9% in 2026 so far. Applied to the days the strategy is invested, this cost takes its return from 54.9% to 40.9% a year and its Sharpe from 1.28 to 1.05. It peaks during bull markets, exactly when a trend strategy is in position.

The same strategy, from naive backtest to realistic version

Annualized returnMaximum drawdown
The same strategy, from naive backtest to realistic version0 %100 %200 %300 %211 %25 %Naive59 %57 %Previous-day decision55 %59 %+ fees41 %59 %+ funding35 %77 %Buy-and-hold
50-day moving average on BTC/USDT (Binance), September 2019 – September 2026. Fees: 0.15% per position change. Funding: BTCUSDT perpetual.

The price depends on the exchange

There is no single bitcoin price. On March 12, 2020, the day's low was $4,410 on Binance and $4,644 on Coinbase, a 5% gap. The next day it was $3,782 on one and $3,858 on the other. A stop at $4,500 was triggered on Binance but not on Coinbase: a backtest run on one exchange's data and executed on another does not describe the same reality. Histories do not start on the same date either, and pre-2017 data often come from defunct exchanges of dubious quality.

Stacks of cryptocurrency coins
Photo: DS stories (Pexels)

A market open 365 days a year: mind the conversions

Bitcoin trades every day, weekends included. Annualizing a Sharpe ratio with the square root of 252, the equity-market convention, instead of the square root of 365, understates it by 17%: for our realistic strategy, it goes from 1.35 to 1.12. The opposite error inflates the result. Comparing a crypto strategy and an equity strategy only makes sense if each is annualized with its own trading calendar.

The "best" parameter changes every year

Every year since 2019, we tested eight moving-average lengths, from 10 to 200 days, fees included, and kept the best for the following year. The winner changed every time: 100, 30, 50, 200, 50, 150 and then 75 days. The following year, the previous year's winner ranked 8th out of 8 in 2020, 4th in 2021, 7th in 2022, 3rd in 2023 and 2024, 4th in 2025 and 1st in 2026. Its average rank, 4.3 out of 8, does no better than a random pick (4.5). In 2022, the 50-day average, the 2021 champion, lost 50.5%.

One year's champion parameter, tested the following year

Return in the selection yearReturn the following year
One year's champion parameter, tested the following year-100 %0 %100 %200 %300 %400 %133 %166 %2019-2020335 %45 %2020-2021124 %-51 %2021-20220 %94 %2022-2023138 %75 %2023-202493 %-10 %2024-20259.3 %36 %2025-2026
Best moving average among 8 lengths (10 to 200 days), fees included. 2026: January to September 22, annualized.

The lesson: fine-tuning a parameter on the recent past mostly captures noise. It is better to look for a range of parameters where the strategy works steadily, validate out of sample year after year, and publish only those results.

Statistical analysis of market data
Photo : Frank Schulenburg — Wikimedia Commons (CC BY-SA 4.0)

What an honest crypto backtest must include

Decisions based on data available at trading time; realistic fees and slippage, heavier on stress days; the cost of funding if execution goes through perpetuals; data from the exchange you actually trade on; 365-day annualization; rolling out-of-sample validation; and, always, a comparison with simply holding over the same period. The backtest analysis tool available on /tools/backtest-analyzer applies this kind of statistical safeguard to your own results. Method: daily spot BTC/USDT closes and BTCUSDT perpetual funding rates published by Binance, daily BTC-USD candles from Coinbase; test from September 10, 2019 to September 22, 2026. Past results do not predict the future and do not constitute investment advice.

Frequently asked questions

Why is my crypto backtest much better than my real results?

Most often because of a decision made with information not yet available. On our trend strategy, that error alone lifts the return from 59% to 211% a year. Fees then take off 4 points, and perpetual funding another 14 points.

How much does funding on a bitcoin perpetual contract cost?

On Binance's BTCUSDT perpetual, the rate has been positive in 86% of funding periods since September 2019, or 11.6% a year on average paid by longs. It reached 30.6% in 2021 and stands at 2.9% in 2026 so far.

Should a crypto strategy be annualized over 252 or 365 days?

Over 365 days, since the market trades every day. Using the 252-day equity convention understates the Sharpe ratio by about 17%. What matters most is comparing strategies computed with the same convention.

Quant Lab · CSV Audit

Backtest & DSR Analyzer

Audit Deflated Sharpe Ratio, Monte Carlo distributions, and selection bias directly on your return series.

Analyze a Backtest
AL

Author & Methodological Lead

Alain Legrand

Founder & Quantitative Financial Engineer · TrueVerdikt

Last methodological review: editorial@trueverdikt.com

Independent financial engineer based in Quebec, Canada, Alain Legrand builds and audits TrueVerdikt's deterministic models: Series A/F mutual fund vs. TSX ETF fee comparisons, RRSP/FHSA tax arbitrage, Canadian mortgage actuarial schedules, and statistical overfitting detection (Deflated Sharpe Ratio & CPCV).

Primary Regulatory & Academic Sources