Currencies have been around for a while. For developed markets we have had freely floating currencies since the 1970s, so you have copious amounts of data to backtest. Many emerging markets currencies also have a reasonable history. There are of course complications, such as different currency regimes, where currencies have been pegged for part of the history and then emerged into a more managed float style environment. Whilst, this is predominantly an EM issue, even within G10 FX, it has happened, such as with EUR/CHF, which had a floor at 1.20 for many years, defended by the SNB. The Euro has been around since 1999, and it’s possible to create a synthetic version of the Euro before that. As well as spot data, there is a considerably amount of forwards/futures and deposit data (you need to have that for calculating the carry). Obviously, it’s questionable whether you’d want to backtest a trading going back several decades. It can be informative for some concepts such as carry or trend. However, we need to be aware that liquidity has changed in the market significantly during that period. Also the drivers of currencies can fade in and out of fashion. One of the most pertinent for developed markets are changes in interest rate differentials, which can be seen as proxy for monetary policy divergence and hence relative growth. However, even here, it is not always the key driver, as noted in a recent Bloomberg column by Cameron Crise.
Whilst, I’m always going to be most focused on “traditional” currencies, I’ve started to dabble a bit more in cryptocurrency currencies recently and to trade small sizes (that’s the best way to learn!). So how does analysing and backtesting cryptocurrencies differ from “real” or fiat currencies? In my earlier column, I tried to frame it purely from a perspective of what drives cryptocurrencies. Here I’ll try to focus on it from how they differ from a data perspective. For a bit more the technical side, I recommend you read some of Ed Silantyev’s blog posts on backtesting cryptocurrency based strategies. He goes through various ways to backtest them, and also ways of collecting cryptocurrency data, which are well worth a read. I’ve also added a way to download cryptocurrency data using my Python library findatapy from Bloomberg (see example here). I’m also seeking to add other cryptocurrency data sources in findatapy. I also have a simple backtest for trading currencies with trend here in Python which uses my finmarketpy library, which can be easily adapted for cryptocurrencies.
For cryptocurrencies, we obviously have a much smaller dataset, than what I’ve described earlier for traditional currencies. Even for bitcoin, we have only a few years of data. For the smaller cryptocurrencies, which have only recently had ICOs, it might be a very small time series. Furthermore the number of cryptocurrencies keeps increasing, so in a sense, this is more like the equities market, where you regularly have new assets. You could also argue that even if we have several years of data, the cryptocurrency market has changed quite considerably. Hence, the relevance of using data from 2013 for backtesting a strategy running in 2018, is probably less relevant than it would be in traditional FX space. There is also the question of where you get your cryptocurrency data from. The market is fragmented across many different exchanges and the prices can vary markedly across them (this might also prove to be a trading opportunity!) – is our strategy robust enough to work on different cryptocurrency datasets. If you’re trying to get an idea of volume, just using one exchange might not give you the right idea. The good point though with cryptocurrencies, is that the data is often much more freely available than in traditional FX space. Hence, you can quite easily get high frequency data from many different exchanges. This page from bitcoincharts has a massive history for example from many exchanges. It is also possible to collect live data (or historical data) from exchanges via APIs. From a backtesting perspective, we should also note that it is not always possible to short cryptocurrencies, a point elaborated on in Ed’s blog posts. Some exchanges do allow this, but this is relatively unusual. With the introduction of more cryptocurrencies futures markets, such as CBOE and CME, which have recently started trading, it should become easier to short bitcoin (admittedly, with relatively large margins). With futures, we can also try to determine the costs of carry associated with being long or short bitcoin. In terms of liquidity, cryptocurrencies aren’t going to be as cheap to trade as something like EUR/USD and this needs to be factored in the backtest. The costs of trading also vary between exchanges.
Cryptocurrencies are obviously different to fiat currencies. It’s more challenging to understand what’s going on for someone used to FX, as the drivers seem different, although in time you do begin to notice patterns. However, there’s lot of data out there to number crunch, which is great if you like building quantitative trading strategies. I’m not going to claim to know what will happen to bitcoin in a year or two years time, but we don’t need to know that far out if we are trading shorter timeframes anyway. This is also true of FX.