Long/short pair trading, rebalancing monthly
Author: rbryant
Creation Date: 6/2/2020 10:49 PM
profile picture


I want to go long one stock and short another, rebalancing monthly.

1. The obvious way to do that is with a Combination Strategy, but I find the Combination Strat allocates capital at the START of the backtesting period, then doesn't change it. On that point, can the Combination tool please be changed to size new trades based on the equity at the point in time of the trade, rather than at the start of the backtest? For example, if there is $100k allocated to Strat1 and Strat2 $50k each. If the total capital increases to $150k a few years later, but Strat2 has made no money, can the trade sizing for Strat2 be based on 50% of the $150k, rather than just the $50k?

2. Alternatively, in a script is there a way to say something like (in English), if stock = AAA then buy, if stock = BBB then short? And likewise for closing them after one month, to rebalance and start again?

3. Third alternative, which I do now, is to copy the chart data to Excel and do it manually.

Any ideas welcome please.

Thanks and regards
profile picture


Hi Rod,

Here's a starting point for you. First, to explore the uploaded Strategies. A number of pairs trading systems are available as publicly downloadable strategies. To download them to WLD, use the convenient "Strategy Download" feature (found in Wealth-Lab's Open Strategy dialog, Ctrl+O).

In the "Intermarket" folder you should find strategies that do pairs trading:

1. Pairs Trading
2. ActiveTrader 2010-10 | Market-neutral VIX-based pair strategy
3. S&C 2014-03 | Timing The Market With Pairs (Kaufman)
4. S&C 2016-12 | Pair Trading With A Twist (D'Errico)

The next logical step is to continue with forum posts (search for "pairs" except ETF Pairs Arbitrage) for more ideas.
profile picture


Thanks Eugene
profile picture


At your service.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).