Putting a portfolio together in Stock Pair Builder
A portfolio can be put together in the Builder by simply selecting pairs in the Table of Pairs. The table supports multiple selections based on Windows standards: by holding down the Shift or Ctrl buttons, you can add / take away pairs as required. Use the keyboard shortcut Ctrl+A to select all pairs in the Table. Every time you make a change in your selection, the list of transactions executed will be automatically updated in the “Portfolio” card, and the equity curve and performance parameters of the portfolio will also be updated.
Maximum number of open positions – the highest number of simultaneously opened positions. This setting is important for back-testing and real portfolio trading with a view to the total capital available (allocated). The sum of the capitalisation of all of the opened positions may never exceed the value of the trading account. InteractiveBrokers would refuse to open a position that would exceed the permitted margin (account value). In real trading, there would be a risk that TWS only opens one leg (e.g., Short), refusing to open the other (Long), pointing to insufficient capital. Portfolio diversification increases with the number of positions opened, and summary statistics improve (equity stability, average transaction, ratio between Drawdown and profit). A trader should therefore always try to trade the greatest possible number of pairs. On the other hand, the impact of commissions charged for the opening and closing of each position (see below) must also be taken into account.
Portfolio performance characteristics
A portfolio has the same performance characteristics as a stock pair itself: aggregate net profit / loss, equity stability, Gain/DD ratio, number of transactions, average transaction, drawdown, etc.
The graph displayed in the right-hand part of portfolio back test displays the development of the portfolio’s equity and the number of positons open. The black line of the portfolio’s equity displays the development of the net profit / loss of the entire portfolio in time. The green area at the bottom of the graph shows the number of positions opened in time. This information is important for setting the maximum number of open positions. Generally speaking, a portfolio whose capital is used to the maximum generates the highest profit. The number of open positions should therefore be as high as possible, it should reach the maximum number entered.
Commission for the opening and closing of a position
A commission (fee) is paid to the broker for each purchase or sale of stock. In the case of InteractiveBrokers, the commission amount is based on the number of shares we are buying / selling. For a detailed commission calculation, see here. The thing important for us now is that the minimum commission per order is USD 1.00
Putting the minimum commission amount of USD 1.00 in the place of Commission, we get the following final relationship:
Where Close is the higher of the current stock A and stock B prices.
To obtain an optimal Profit / Commission ratio, we have to allocate at least USD 3,800 to the pair.
Commissions in the Stock Pair Builder program
The Stock Pair Builder takes the commission amount into account in all its results. The profit from each transaction is reduced by the commission charged for its opening and closing. You can check the commission amount in the pair calculation table which shows the gross and net profit from each transaction.
Commission calculation coefficients are set up as default based on the InteractiveBrokers list of tariffs. You can change them if you need.
Selection of pairs for trading
In previous articles, we have explained that all stock pairs must be considered equal and approached as uniform units. In spite of that, we should pay attention to the selection of pairs of which we make our trading portfolio. Stock pair trading is based on arbitrage (balancing) of short-term sways in the prices of two stock titles that have correlated for some time. The mutual fluctuations in their prices must be sufficiently large to give room for sufficient profit and, on the other hand, they must not disrupt the long-term stability of the pair. Too small a fluctuation does not provide sufficient room for the desired profit, on which we also have to pay a commission (!). Too large a mutual fluctuation shows that the pair is not strongly connected and that it is potentially unstable.
In our article today, we have outlined how to look for suitable stock pairs and how to make a trading portfolio out of them. Our next article will be devoted to the Stock Pair Trader program and to live trading of stock pair portfolios. You will see that in technical terms, pair trading is very simple.
Petr Tmej a Petr Slepička
Previous chapter: Searching and back-testing stock pairs
Next chapter: Live trading of stock pairs