# Pairs trading using Johansesn test for hedge ratio

Hello
I’m starting out in the algorthmic trading and am currently making a very simple strategy based on mean reversion of three stocks.

I have ran code from E. Chan’s book titles Algorithmic trading and have the output from the Johansen test.
The eigenvector part of the output is to be used as the hedge ratio. My question is how do we actually use this hedge ratio?

output
-1.05
0.87
0.43

Let’s say the above its the first eigen vector output and therefore the one that shows greatest cointegrations. does this mean that for every 1.05 units i’m short in stock A, I should be 0.87 units long in Stock B and 0.43 long in stock C? If so would it be fair to say that the hedge ratio is -1 : 0.83 : 0.41?

Second Question: Will this hedge ratio change with the addtion of new data every day? If so should we update the hedge ratio of our strategy every day?

Third question, based on the eigenvectors how do I know which one is Stock A, B & C? the Johansen test returns in this case 3 eigenvectors. one is showing how Stock B & C conintegrate with A, another how A&C conintegrate with stock B and the third how stock A&B coitegrate with stock C. It then puts them in order of the most favourable but doesnt tell us whihc one it is. How can I find that info out?

Thanks for you time