Selecting markets for backtesting

  1. Home
  2. Docs
  3. Goods
  4. Statistical Arbitrage
  5. Selecting markets for backtesting

Selecting markets for backtesting

To select the markets that we will test, let’s first define what characteristics the markets should have to meet the trading conditions of the strategy. Our strategy enters two markets simultaneously, with one position being long and the other short, so we do not suit markets that do not have short positions. Also, the markets themselves must have the same or tightly linked quote asset. For example, in the pair of perpetual futures BTC/USDT, the quote asset is USDT, so we can test this market with any other market that also has short positions and has USDT, USD or any other asset whose value is tied to it, as the quote asset.

The trading idea of statistical arbitrage is based on the assumption that if the spread of two trading markets does not diverge above some value and always converges back after divergence on a statistically significant period of time, then we can assume that this relationship will persist for some period of time in the future. However, we cannot randomly test all trading markets with the same quote assets, because there will be too many of them and most of them will be unprofitable. We need to filter out most of the markets that are obviously not suitable for trading according to this strategy and we will use the assumption that if two markets move close to each other then they are likely to be strongly correlated with each other. We will look for correlation using the correlation matrix which is a module of the Quantower trading platform.

We have already defined the necessary markets that we will research and we will add them to our matrix, but for the full setup we also need to define the time interval that we consider statistically significant and the chart period. I empirically selected these values and I got that the interval that I consider statistically significant is one year, and the chart period is one hour. With these settings we will proceed to the research of pairs of trading markets.

Now we have a correlation matrix from which we will get the pairs of markets that we will research by testing on history, and in the research we will take only those markets whose correlation values are greater than 0.85.

Thus, we will immediately filter out 9 out of 10 values, which will significantly reduce the amount of further work on market research by means of backtesting. Although we still have to test several pairs of such markets, but not thousands.

In the next article, we will test all these markets on history and study their profitability charts to understand which of them can be taken to real trading.

How can we help?