Suppose I bought $100 worth of stock A and I want to hedge it by shorting stock B, they have correlation of rho and respective standard deviations. How do I know how much of Stock B to sell? that's the problem I am trying to solve.
More generally, suppose we own $\$X$ of Asset A and we wish to hedge this by buying $\$Y$ of Asset B, we know that the standard deviations of the Returns of A, and B are $\sigma_A$ and $\sigma_B$ respectively, and that the returns have a correlation of $\rho$. Using portfolio theory we want to minimize $VAR[w_aX+(1-w_A)Y]$ and we get the optimal weight of asset A in the portfolio as $w_A = \frac{\sigma_B^2-\rho\sigma_A\sigma_B}{\sigma_A+\sigma_B^2-2\rho\sigma_A\sigma_B}$
Furthermore, our total portfolio in dollar terms is $X+Y$, and the percentage of our portfolio in asset A is $\frac{X}{X+Y}$, and since we want to this to equal the weight neccessary to be the minimum variance portfolio we set $w_A=\frac{X}{X+Y}$ and solve for Y to find how much of asset B in dollar terms we need to short/purchase in order to acheive our desired portfolio.
Is this method valid for finding the optimal hedging strategy in terms of asset B?