I'm having a difficulty grasping how to write a pair algorithm using returns instead of prices.
With price differences, I have the mean difference over a long time period. When the current price difference moves away from the mean I open a position. When it moves back to the mean I close then position.
With returns, I have the mean difference in returns between two stocks. What am I looking to move away from this mean? Is it just when a single period returns deviates? If so, when do I close.
A single day may be above the mean so I open. It should come back, but how do I know when its happened? If the next day is below the mean I dont think its time to close. It just working back down, but still pay not be all the way back.