I'm trying to backtest Pairs Trading but have become a bit confused on the different methods of selecting pairs, how to look for trading signals and what size of the positions to take in the assets.
What I'm doing right now is that I'm testing for cointegration amongst pairs, which I'm doing with Engle-Granger to get the coefficients in the stationary linear combination of the assets.
$X_t = bY_t+a + \epsilon_t$
After that I check the residual $\epsilon_t = X_t-bY_t-a$ for trading signals. If the absolute value of the residual is larger than some predetermined amount I would open the trade. The trade is closed when the residual is reversed back to 0.
When receiving a signal, I want to trade long/short with equal amounts (1 dollar long/short), as in Gatev et al. and many others. But what I realized is that using these signals and this residual you could actually make a loss from a long/short position with equal amounts.
So I tried to figure out how they (Gatev and others) looked for trading signals, but everywhere I look it's very poorly explained (especially in their original article). It just says that they use cointegration or OLS or something equivalent and then trade 1 dollar long, 1 dollar short etc.
So what is it that they do? Do they test for stationary in the linear combination without the constant a? $X_t = bY_t + \epsilon_t$
Or is there perhaps any additional condition (in the trading signals) I could add to avoid this potential loss of incurring? Since it depends on the value of the assets at the time of closing I would guess not. Would you recommend looking at some other residual for trading signals?
I know you could take positions 1 and b in the different assets to ensure no trade makes any loss, but this severely complicates the computations of the returns w.r.t. the committed capital. Because of that, I'd rather not use this method.
Since I've been misunderstood, I will try to clearify what I'm asking.
The profit from each trade:$P = N_x X_c - N_x X_o + N_y Y_o - N_yY_c$ if you're long in X and short in Y.
Assuming our relationship from the cointegration we have the closing resp. opening we have:
$X_o = bY_o + a + \epsilon_o$ where $\epsilon_o$ is larger than some value U or less than -U. If we're long in X and short in Y this would mean that its less than -U.
$X_c = bY_c + a + \epsilon_c$ where $\epsilon_c$ is larger than 0.
This gives us the profit: $$P = N_x (bY_c + a + \epsilon_c) - N_x (bY_o + a + \epsilon_o) + N_y Y_o - N_yY_c = $$
Let's now say we take positions 1 and b in X resp. Y. This gives us: $$P=\epsilon_c - \epsilon_o > U$$
However, if I would invest equal amounts in each asset the profit would be:
$$P = Y_c/Y_o - X_c/X_o$$
which is not strictly positive. So that's why I asked what Gatev et al. (and others) used to look for trading signals. Do they model the stationary time series as $X_t = bY_t + \epsilon_t$? They mension normalised price series also, but they don't explain in detail what it is that they do. This confuses me and I can't figure it out.