Computational complexity of stock pairs
With appropriate effort, a stock pair calculation table using the basic Ratio model can be put together in any spreadsheet program, for example in MS Excel. The model uses basic mathematical and statistical tools that most of us remember from school. Evaluating the statistics of the transactions executed is also not difficult. So what is the big deal?
Stock Pair Builder
The Stock Pair Builder program is designed for searching, testing, and analysing stock pairs and for putting together a trading portfolio. The program has been continuously developed since 2006. The author of the program himself is an active trader. Since 2016, he has been cooperating with a team of experts from the Czecho-Slovak investment fund QuantOn Solutions a.s., which uses StockPairTrading itself for its own trading.
Searching for stock pairs (stock screening)
Screening is used for searching for stock pairs that meet the set criteria. Criteria can be divided into three groups:
- Fundamental – stock price and average daily volume
- Strategic – minimum value of correlation of the stock in a pair, assessed for two different periods
- Performance-based – total profit / loss of the pair, average profit per transaction, number of transactions, percentage of profitable transactions, profit and drawdown ratio, percentage amount of drawdown, equity stability
Selection criteria can be combined as necessary, turned on or off. Screening can run on any time slot, with any setup of pair calculation model. All stock pair calculation models are available: Ratio, Residual, Log-Residual. Thanks to this, it is possible to make very quickly various analyses, model comparisons, a walk-forward analysis, etc.
Pair back testing
Once we have identified stock pairs, we can go on to the second program tab – pair back testing. The back test shows detailed graphs and tables with the performance characteristics of pairs. Naturally, it shows the equity curve, a detailed calculation table for the pair, and a detailed list of all transactions. A pleasant function is the visualisation of the calculation model used, including the transactions executed, the course of correlation in up to four different periods, a histogram of the standard relative deviation distribution, a histogram of the profit / loss in individual transactions and pairs.
In this article, we have demonstrated basic tools for back-testing and evaluating stock pairs in the Stock Pair Builder program. In our next article, we will show you how a back test of a portfolio is done, talk about the strategy of capital allocation to pairs, and show you the pair selection process.
Petr Tmej a Petr Slepička
Previous chapter: Statistical approach to portfolio building
Next chapter: Building profitable portfolio of stock pairs