* length of correlation and moving average
* trade pair
* spread threshold to enter long / short
* spread threshold to exit long / short
As you can see on the plot, the ratio doesn't stay inside of a limited range (around zero), but the spread does. That's why you trade based on the spread, not on the ratio.