Skip to content
Request a Demo

Backtesting is an important part of any trading operation. Most traders have new trading strategy ideas all the time. Some will make money; others will not. The sooner a trader can tell which is which, the better. The fastest way to learn is by backtesting the strategy against historical data before putting any capital into it.

Crypto Vs Equities

So, how can you use data to backtest crypto trading 5 strategies?  

Let's take this in two parts. Backtesting crypto trading strategies is similar to backtesting in equity trading but with some significant additional complications. Typically, you would first define your specific strategy, be it a pairs trade (which is quite popular in crypto), a rebalance, or a buy/sell based on directional indicators/triggers.

Then, you go out and obtain the data necessary to test that strategy. For instance, if you’re looking at a pairs trade between Apple and Microsoft, you would get the historical trading data for some period of time, (the longer the better) for both Microsoft and Apple. Now you would load that data into a spreadsheet, or pass the data through an analytic program you’ve written specifically for this purpose, see the results, and then decide if you want to deploy the strategy.

Besides the returns, the results you would seek would be accompanying return statistics, such as Sharpe Ratio, Alpha and Beta, Distribution of Returns, and so forth. Based on these results, you’d either fund the strategy, trash it, or refine it and backtest again.  And that's basically it. Essentially, you’re just defining the strategy, getting the data that you need, and writing some code to work the data.

Data Complications in Backtesting Crypto

Simple, right?

Not quite. With crypto, that middle part—getting the data that you need—is not so simple. For a few reasons.

Equities generally trade on a single exchange that has uniform and standard hours of operation. One opening price, one closing price, and, because that exchange is regulated, accurate trade data. That is, the trades that the exchange says were executed were in fact‌ executed.

Crypto, not so much. 

For starters, crypto trades on multiple centralized and decentralized exchanges. Because of this, you have a data availability and consistency problem. Also, some of these exchanges can have liquidity problems, which will distort prices.  (If an illiquid exchange shows an asset price at $1.00 and the liquid exchanges show it at $1.25, which is the price you want to use?). This happens all the time with lower cap crypto coins, and even once in a while with Bitcoin.  This slippage creates a lot of noise in the data. You need to factor this somehow into your backtesting. 

Another issue is that crypto trades constantly. There is no actual open and close, so how do you define a trading “day?” How you do can make a big difference in your results. Again, a lot of noise. Also, data needs to be compared through time zones, which can be an issue simply because there are volume spikes during the day related to waking and sleeping hours, even though the exchanges never close.

Then there’s the issue that quite a lot of crypto hasn’t been around that long, so there’s not a significant time period of data to work with.  With equities, any backtest with less than ten years of data will get you some side-eye from your boss.  In crypto, only a few assets have as much as ten years of trade data. And for many (read: “thousands”) of smaller alt-coins there’s always a serious question as to the reliability of trade data.

There’s also the issue of whales causing price spikes.  In the equity markets, spikes often occur as the result of some definable macro issue or internal corporate issue.  With crypto, spikes can seem to happen randomly, especially in thin markets, often when one or two wallets make a big move, for inscrutable reasons.

And finally, you have a great deal of regulatory-based volatility in crypto.  A market regulator or politician somewhere makes an offhand comment, and boom! market volatility jumps.  This is all part of the daily life in crypto, but backtesters need to make decisions about how to deal with it because from a testing point of view they’re distortions that you just don’t see in more mature markets.

Noise, noise, and more noise.  And then there are forks.  One day there’s one blockchain; the next day there are two. ‌Don’t even ask.

As you can see, backtesting crypto strategies can get complicated in a hurry, mostly because the clean, consistent, verified trade data can be difficult to get.

Benefits of Using a Crypto Data API

That’s where Amberdata comes in. Amberdata is your lens into the entire crypto economy. We deliver comprehensive digital asset data and insights into blockchain networks, crypto markets, and decentralized finance. This empowers financial institutions with critical market or DeFi data for research, trading, backtesting, risk management, and institutional-grade crypto derivatives analytics.

We provide you with the data and infrastructure to drive algo trading strategies on DEXs, CEXs, spot markets, and derivatives exchanges. With our on-chain data and trade/time data series, you can build a crypto alpha generation platform to develop quantitative financial models or trading strategies that generate consistent alpha, and backtest everything before you deploy capital. 

We collect data from hundreds of centralized and decentralized exchanges. See our DEX coverage here

This means we can help you obtain the data for every protocol we support as far back as you want to go. We also offer lenses into some of the top protocols, which gives the time series and analytical ability to dig into all activity on a protocol, a pool, or a user's participation.

Market data for these exchanges is served through our market data endpoints. ‌We also cover eight of the largest blockchains.

To learn more about Amberdata, please contact us to book a demo, hear about our products that can help your business, or receive pricing information.


DISCLAIMER: The information provided in this blog is for educational purposes only and is not investment or financial advice. Please do your own research before making any investment decisions. None of the information in this blog constitutes, or should be relied on as, a suggestion, offer, or other solicitation to engage in, or refrain from engaging in, any purchase, sale, or any other investment-related activity. Cryptocurrency investments are volatile and high risk in nature. Don't invest more than what you can afford to lose.

Amberdata crypto snapshot #8

Amberdata Blog

View All Posts