I had a doubt about the Pair trading concept. I want to back-test the arbitrage strategy for two pairs AUDUSD & NZDUSD on H1 Time-frame. However, while back-testing I am confused about the look-back period. In the EFS course of EPAT, it is said that consider at least 90 days as a look-back period. Let's say I am testing from 01/01/2021 to 15/08/22. On 15/04/21 both AUD & NZD are co-integrated and stationary and at 13:00 pm on the same day according to the strategy, there is a sell signal. Now, how will the back-testing work from here? Should I use the same mean & S.D of the past 90 days (01/01/21 - 14/04/21) to trade for all the signals of that day(15/04/21) and start rolling back-test of co-integration from the next day like 02/01/22 - 15/04/21? or the rolling back-test should be based on hourly candles of the past 90 days like if we got a signal at 13:00 pm on 15/04/21 and for the next hour of 14:00 pm it takes 13:00 pm candle also into consideration for co-integration back-test?.
Hi Anoop, Thanks for your query and for extending and implementing the concepts from the EFS workshop.
There are two parts to the strategy.
- Cointegration Check
Cointegration is associated with the long-term property of the time series. So you can check if the currency pair is cointegrated using data of the past 90 days. Since it is long-term in nature you can skip checking for cointegration every hour. You can decide on a fixed frequency such as fortnightly or monthly to get the list of currency pairs which are cointegrated.
For example, at the start of every month, you can verify if the AUDUSD and NZDUSD pair is cointegrated. If it is cointegrated then trade for that particular month.
Note: If you already have an open position and at the start of the month if cointegration check fails then you exit from that position.
- Trading Signals
Once the currency pair passes the cointegration check, the next step is to look for entry and exit signals. If you are using Bollinger bands or any other technical indicator, the lookback in these technical indicators is independent or different than the lookback of 90 days used to check for cointegration. You can set the lookback to calculate the mean, upperband and lowerband to a multiple of half-life.
The mean and the bands value will change when new data points come in. For example, if you got a signal at 13:00 on 15/04/21 and you entered short on the spread. Then for the next hour of 14:00 you recompute the Bollinger bands using the new data and check for exit conditions.
I hope this helps.
Thank you
Ishan
Thank you it really helps. However, I am unclear about some part. I tried to diverge a bit and wanted to try different so I am using the Price ratio and my entry is if the price ratio is > 2 S.D and exit when it comes back to mean. I know it is not exactly like in the EFS course, but I wanted to understand that both AUDUSD & NZDUSD (H1) are co-integrated for the past 90 days. And my question is should I take fixed mean & S.D of that 90 days because since it is co-integrated in the long term, there is a chance of price-ratio will come back to its long-term mean and I will continue taking trades for that based on that mean. And for the next day, if there are any signals then I will calculate the mean for the past 90 days including the previous day.
I got that co-integration look back period and mean calculation look back period are different, but what can be the ideal look-back period for mean calculation here in this case?
should I take fixed mean & S.D of that 90 days because since it is co-integrated in the long term, there is a chance of price-ratio will come back to its long-term mean and I will continue taking trades for that based on that mean
Both the approach with fixed mean and rolling mean could work. I would say to try both the approach and select the one you like.
what can be the ideal look-back period for mean calculation here in this caseThe ideal lookback period could be some multiple of half-life. If the half-life is 10 days then you can set the lookback to 20, 30 or 40 days. The idea is that the longer the lookback period, the slower the average would be in adapting to the recent price changes and the shorter the lookback period, the faster the mean will adjust to recent prices but could also generate more false signals.
Thanks