# calculating the pair weights from log price hedge ratio

I am calculating the hedge ratio using log prices:

$$\ln(A) = \text{hedge_ratio} \cdot \ln(B)$$

How do I convert the hedge_ratio into a number of shares of A vs. a number of shares of B?

Think in terms of dollars invested, not shares. A hedge ratio of 2 for example means that Stock A will go up 2% (on a logarithmic basis, i.e. $\ln P_{t+1}=\ln P_t+0.02$) when Stock B goes up 1%. That means you need twice as many dollars invested in B as in A for the movements to offset each other in dollar terms.
Once you decide what these amounts should be (based on a position size rule, say 10000 USD for the most volatile of the two stocks, or other more complicated rule) you just divide 10000 and 20000 by the respective prices to determine the number of shares (e.g. $10000/P_A$ and $20000/P_B$).