I am trying to solve a specific problem, and I was able to summarize it in the following optimization problem.
I have a portfolio comprised of two assets. Asset 1 has return $r_1$, standard deviation $\sigma_1$ and weight $w_1$ in portfolio, and Asset 2 has return $r_2$, standard deviation $\sigma_2$ and weight $w_2$ in portfolio.
We are trying to determine the value of $x$ that will maximize the following ratio:
$max$ $\frac{w_1 r_1 + w_2r_2}{\sqrt{w_1 \sigma_1^2 + w_2 \sigma_2^2 + w_1 w_2 \sigma_1 \sigma_2 \rho}}$
s.t.
$ w_1 = \left\{ \begin{array}{l l l} 1 & \quad \text{if $p_t \leq x$}\\ \frac{p_t - 0.32}{0.32 - x} & \quad \text{if $x < p_t \leq 0.32$}\\ 0 & \quad \text{if $p_t$ > 0.32} \end{array} \right.$
$w_2 = 1 - w_1$
where $p_t$ is the value of $p$ at time $t$.
The inputs we have are: the time-series of $r_1$ and $r_2$ (hence we know $\sigma_1$ and $\sigma_2$), and we have a time-series of the parameter $p$.
How can I solve this problem to find the value of $x$? Any help would be appreciated, as I am a little lost! Thank you!