Formula for Optimal Portfolio of 2 Assets when No Shorting Allowed?

I am looking for a formula to calculate the weights of two risky assets that produce the optimal portfolio (i.e highest Sharpe ratio).

So far I have found the following formula from a website of University of Missouri
190d2f46dbee4b6a8803f23a8e932a53.png


However, this formula often produces negative weights.
For example, it returns a weight of -24% for Asset A when Risk Free Rate=3%, Ra=5%, STDEVa=15%, Rb=10%, STDEVb=20%, CORRab=50%.
It is probably because it allows short selling, making it not applicable in my situation. I need to find non-negative weights.

Does anyone know a formula for non-negative weights for a two-asset optimal portfolio that does not allow short selling?

Thanks.
 
Back
Top