I have a portfolio optimization problem similar to this question here, with a V-shape transaction costs such that we pay a fee proportionally to the sum of absolute rebalancing: $$TC(\omega) = \frac{1}{2} |\omega-\omega_\text{old}|' \cdot \gamma$$ where $$\omega : \text{target portfolio to optimize},$$ $$\omega_\text{old} : \text{initial portfolio},$$ $$\gamma : \text{vector of average bid-ask spread}.$$

Essentially, my problem can be written as

$$ \omega_{opt} = \arg\min {\lambda \omega'\Sigma\omega + TC(\omega) - \omega'\alpha } \\ \text{ s.t. }\omega_{i} \in [0,1], \forall i \text{ (no short-sell)}\\ \sum_{i=1}^n \omega_i = 1, \\ \sum_{i=1}^n |\omega_i - \omega_{\text{old,i}}| \leq 0.5 \text{ (turnover constraint)}, \\ |\omega_i - \omega_{\text{old,i}}| \leq 0.1, \forall i \text{ (concentration constraint)}, \\ \beta = \omega' \Sigma \omega_{old}/\sigma^2 = 1 \text{ (beta constraint)}$$

I managed to solve this using scipy.minimize in python, but it is not really "clean".

My question is: can I transform this into a quadratic / convex optimization problem such that I can then use cvxopt to implement the solution?

My guess was to introduce some new variables $p$ and $q$ such that the $TC$ part becomes equivalent to:

$$\frac{1}{2} (p+q)' \cdot \gamma$$


$$ p_i, q_i \geq 0, \forall i \\ \omega - \omega_{old} = p - q$$

such that the absolute term disappears, but then I end up with 3 times more unknowns: $\omega, p$ and $q$. Then I don't know if this is possible to reformulate that problem into a convex quadratic program of the form:

$$ \text{minimize } \frac{1}{2} x'Px+ c'x \\ \text{ s.t. }G x \leq h\\ Ax = b \\$$ with $P$ positive semi-definite and feed it into the convex optimizer.

EDIT: I have reformulated the objective function with the change of variables using $p$ and $q$ to get:

$$\omega - \omega_{old} = p - q \rightarrow \omega = \omega_{old} + p - q \\ \Rightarrow \lambda \omega'\Sigma\omega + TC(\omega) - \omega'\alpha = \lambda (\omega_{old} + p - q)'\Sigma(\omega_{old} + p - q) + \frac{1}{2} (p+q)'\gamma - (\omega_{old} + p - q)'\alpha \\ = \lambda (\omega_{old} + p - q)'\Sigma(\omega_{old} + p - q) + \frac{1}{2} (p+q)'\gamma - (p - q)'\alpha$$

where in the last line I removed the constant term $-\omega_{old}'\alpha$,


$$p_i, q_i \geq 0, \forall i \\ \omega - \omega_{old} = p - q \\ \omega_{old,i} + p_i - q_i \in [0,1], \forall i \text{ (no short-sell)}\\ \sum_{i=1}^n (\omega_{old,i} + p_i - q_i) = 1, \\ \sum_{i=1}^n (p_i+q_i) \leq 0.5 \text{ (turnover constraint)}, \\ (p_i+q_i) \leq 0.1, \forall i \text{ (concentration constraint)}, \\ \beta = (\omega_{old} + p - q)' \Sigma \omega_{old}/\sigma^2 = 1 \text{ (beta constraint)}$$

The latter expression is close to the expected canonical form $\frac{1}{2} x'Px+ c'x$.

It also turns out that $\omega_{old}' \Sigma \omega_{old}/\sigma^2 = 1$, so the latter constraint would translate into $(p - q)' \Sigma \omega_{old}/\sigma^2 = 0$.

But then what? Do I need to do another change of variable or do I need to solve for $p$ and $q$, and in this latter case how? Do I need to stack up $p$ and $q$ in a vector $x$ of size $2n$, with $n$ being the number of assets (and also the dimension of $\omega$)?

  • $\begingroup$ Hi: Check out andre perold's early paper on optimization with transaction costs. I can't remember for sure but there may be in something in there related to your question. $\endgroup$
    – mark leeds
    Jun 9, 2020 at 13:55
  • 1
    $\begingroup$ That is correct and expected. $\endgroup$
    – Hans
    Jun 10, 2020 at 16:30
  • 1
    $\begingroup$ @JejeBelfort: I used to have perold's "large scale portfolio optimization" paper but I can't find it and it doesn't seem like it's obtainable for free from the net. If you can get your hands on that, it may be helpful but I'm not sure how helpful. Although, based on Hans' comments, it sounds like you're going in the right direction or maybe even quite close to solving it ? Definitely an interesting problem and I'm sorry that I can't be of more help. $\endgroup$
    – mark leeds
    Jun 11, 2020 at 13:44
  • 1
    $\begingroup$ @develarist: The jargon can be confusing but, in portfolio opt, quadratic would mean the $x^{\prime} \Sigma x$ and everything else linear. But, if you have the same term and then other things like absolute values, then it's termed non linear and of course much harder to solve. This is why it's nice to get a quadratic because there are some closed form solutions and straight forward solvers etc. $\endgroup$
    – mark leeds
    Jun 11, 2020 at 13:48
  • 1
    $\begingroup$ Glad you found it. I was hoping it would help you with your problem but atleast something about it was interesting. $\endgroup$
    – mark leeds
    Jun 12, 2020 at 16:36


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.