Portfolio Unwinding with Execution Costs and Variance Penalties
Summary
The document formulates portfolio liquidation as a continuous-time optimization. It balances a trading cost that depends on the rate of position change against a penalty for holding portfolio variance, represented using positions and their covariance matrix. A tuning parameter controls the relative weight of risk during the unwind. Applying the Euler–Lagrange equation to a quadratic trading cost produces a coupled second-order differential equation for the position path.
The derivation illustrates how variational methods can turn a liquidation objective into equations for candidate unwind schedules. The document does not solve those equations or provide empirical evidence that the resulting schedules perform well. Its proposed quadratic cost is a simplifying example, while real market impact and bid-offer costs may have different shapes. It also raises an unresolved practical issue: unconstrained optimization may increase some positions, so reducing-only limits or other trading constraints would need to be incorporated.
Key ideas
- A liquidation schedule can trade off execution costs against the risk of carrying positions over time.
- The covariance matrix makes the holding-risk penalty depend on interactions among securities.
- A quadratic cost on the rate of position change yields a coupled second-order differential equation.
- Realistic trading costs may require a different cost function estimated from market data.
- Reducing-only constraints are needed if the optimizer must never increase a position.
Tags
Full text
# Unwinding a Portfolio
# Unwinding a Portfolio
I have a portfolio ${\mathbf P}$ made up of positions $n_i$ in each of $N$ securities, which I'm assuming are jointly normally distributed with means $x_i$, and covariance matrix ${\mathbf M}$.
Markets are getting choppy and I decide I want to unwind it as quickly and safely as possible - so hedging positions should be unwound at the same time (I think this roughly corresponds to minimizing the variance over the lifetime of the portfolio), but I'm also concerned about market impact and/or bid-offer for large orders. I'm trying to formalize this as a minimization problem.
I have a super-linear cost function $f(n)$ to trade a clip of size $n$, and I want to minimize the sum of that cost and the variance of the portfolio over time, by varying position functions $n_i(t)$ which represent the position I'm still holding in that security at time $t$ - in the continuous limit I think that looks like this (treating $n_i$s as a vector ${\mathbf n}$):
\begin{align} \underset{n(t)}{\mathrm{argmin}} \int_0^\infty \Bigl( f({\mathbf n}'(t)) + \lambda {\mathbf n^{\intercal}(t)}\cdot{\mathbf M} \cdot {\mathbf n(t)} \Bigr) dt \end{align}
where $\lambda$ lets me control the speed of the unwind. I have in mind that calculus of variations can help me here, which gives me an Euler-Lagrange equation
\begin{align} 0 &= \lambda {\frac {\partial {\mathbf n^{\intercal}}\cdot{\mathbf M} \cdot {\mathbf n}} {\partial {\mathbf n}}} - {\frac d {dt}} {\frac {\partial f({\mathbf n}')} {\partial {\mathbf n'}}}\\ &= 2 \lambda {\mathbf n^{\intercal}}\cdot{\mathbf M} - {\frac d {dt}} {\frac {\partial f({\mathbf n}')} {\partial {\mathbf n'}}} \end{align}
using matrix calculus on the first term.
For concreteness and simple algebra, if I assume $f({\mathbf n}')$ is the magnitude of the time gradient, $f({\mathbf n}') = {\mathbf n}'^{\intercal}{\mathbf n}'$, then I get a sequence of coupled differential equations: \begin{align} 0 &= 2 \lambda {\mathbf n^{\intercal}}\cdot{\mathbf M} - {\frac d {dt}} {\frac {\partial {\mathbf n}'^{\intercal}{\mathbf n}'} {\partial {\mathbf n'}}}\\ &= 2 \lambda {\mathbf n^{\intercal}}\cdot{\mathbf M} - {\frac d {dt}} 2{\mathbf n}'^{\intercal}\\ &= \lambda {\mathbf n^{\intercal}}\cdot{\mathbf M} - {\mathbf n}''^{\intercal} \end{align}
I suppose I can then solve these equations using conventional techniques (although it might be more tricky for an arbitrary cost function $f$, which I plan eventually to extract from order book data).
A few questions about this:
- Is this a sensible approach to the problem?
- Have other people used this or any other approaches?
- Out-of-the-box this technique sometimes suggests increasing position sizes to minimize variance... how should I constrain it to be reducing-only?Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.