I've been trying to wrap my head around cointegration. Currently I use the log returns of both stocks A and B, calculate the spread given by:
$S = log(A) - n*log(B)$ where $n$ is the Hedge Ratio calculated from a rolling OLS. In the results I've read I've operated under the assumption that if the spread falls below a certain point then long A and short B and vice versa. I believe this is a dollar neutral hedge?
My confusion lies in the Hedge ratio part whereby I'm not sure how to interpret it. I've seen an example that says long A and short $n$ stocks of B. However, I sometimes get negative values of $n$, i.e log returns are inversely correlated. How do I interpret this?