Disclaimer – The views and opinions expressed in this blog are those of the author and do not necessarily reflect the views of Scalable Capital GmbH or its subsidiaries. Further information can be found at the end of this article.
Investors usually face a multi-objective optimisation problem. The main objective is to find the optimal portfolio for investing. Besides that, a second objective is to implement this optimal portfolio allocation in a cost-efficient manner.
Let us assume that we always trigger trading if the distance of our current portfolio from a given ideal portfolio is too large^{1}. One way to measure distance between portfolios is turnover, $TO($, which is defined as the sum of the absolute distances of the portfolio weights of each asset scaled by one-half to obtain a measure in $[0,1]$ (see Section 3 for a formal definition). In the following, we will use $TO($ as the trading trigger. This means that we trigger a trading event whenever the distance of the current weight, ${\mathit{x}}_{0}$, to the ideal weight, $\stackrel{~}{\mathit{x}}$, is larger than $\delta \in (0,1)$. A trade cost optimisation is used to determine new portfolio weights which are closer to the ideal portfolio weights than the current weights, but cheaper to accomplish than a full rebalancing to the ideal portfolio. Quite generally speaking, two implementation strategies are possible. First, the portfolio optimisation and the trade cost optimisation could be done in a joint optimisation step (see for example Mansini, Ogryczak and Speranza (2014) for a literature overview). And second, a two-step approach where the portfolio optimisation delivering an ideal weight vector, $\stackrel{~}{\mathit{x}}$, for the portfolio is done in a first step, while trade costs are optimised only in a second step. The original ideal weight vector hence will be adapted by the trade cost optimisation, leading to a slightly different weight vector $\mathit{x}$. We will focus on the second approach as it comes with two advantages. From a mathematical point of view it is much easier to implement. In addition to that, having trade cost optimisation and portfolio optimisation independent from each other allows one to combine the trade cost optimisation flexibly with any potential portfolio strategy. Whether the ideal weights are decided by an investment committee or obtained from a dynamic portfolio optimisation strategy, the trade cost optimisation approach can be applied in both cases.
Any trade cost optimisation needs to deal with a trade-off between cost efficiency and optimality of the new portfolio. One way to balance this trade-off is by defining a maximum acceptable distance $\gamma \in (0,\delta )$ to the ideal portfolio weights. This way only portfolio weight vectors with a distance less than the threshold become valid solutions in the optimisation problem. The closer this threshold is to zero, the less freedom the trade cost optimisation gets. Portfolio weights will be closer to the original target and hence "more optimal", but with less reductions in trading costs. Using such a threshold, a trade cost optimisation can be achieved by minimising the costs while keeping the distance to the ideal portfolio within bounds, i.e.,
$$\underset{\mathit{x}}{\mathrm{min}}C({\mathit{x}}_{0},\mathit{x})\phantom{\rule{2em}{0ex}}\text{subjectto}\phantom{\rule{2em}{0ex}}TO(\mathit{x},\stackrel{~}{\mathit{x}})\le \gamma ,$$
where $C($ are the costs to trade from ${\mathit{x}}_{0}$ to $\mathit{x}$ and $TO($ is the turnover distance of the post-trade weights, $\mathit{x}$, to the ideal weights, $\stackrel{~}{\mathit{x}}$. An illustration of this approach is shown in Figure 1. While distances are actually measured in terms of portfolio weights, individual portfolios are represented in terms of risk and return in a $\mu $-$\sigma $-chart. The star represents the ideal weight of a hypothetical portfolio strategy and the outer circle around it visualises the area in which no trading is triggered. Only portfolios outside of this area exceed the threshold and need to be traded. The arrow represents the trading to the new weights instead of trading to the ideal weights (dashed arrow). Moreover, the inner circle represents the area into which the trade cost optimisation has to move in a trade-cost-efficient manner.
A second animated graphic (Figure 2) gives a visual impression of the trading behaviour of such a trade cost optimisation:
The more reduction of the distance to the ideal weight is enforced (represented as a bar in the lower left plot), the more trades need to be executed. The increase in trading costs is shown as a bar in the lower right plot of Figure 2, where the orange part represents fixed costs and the dark blue part variable costs. Fixed costs are for example fees which are charged per traded asset and variable costs can either be explicit fees per traded volume or implicit costs, like bid-ask-spreads, that are proportional to the traded volume. A typical fee structure for a retail investor using an online broker could be a fixed amount per executed order of $5.00 and a variable cost depending on the trade volume, e.g., 0.25% of the traded volume. This exemplary cost structure will be assumed in the following.
Moreover, the central part of Figure 2 shows in which assets buys (green) and sells (red) are proposed by the trade cost optimisation. The light green and light red part represent the weight distances from the ideal weights that the trade cost optimisation decided not to trade. The frames show the final post-trade-cost-optimisation portfolio weights.
To demonstrate the benefits of trade cost optimisation we now show achievable cost reductions for an exemplary systematic portfolio strategy. The strategy is taken from Portfolio Visualizer^{2}, where the relative strength momentum strategy (Faber 2010) is applied for a US investor rotating across asset classes using the following ETFs: SHY, TLT, RWR, IWM, IWB, GLD, EFA, EEM, DBC. We use total return data from Bloomberg for the ETFs and for simplicity assume that all ETFs are accumulating their distributions so that there is no need to manually re-invest cash-flows in between. On a daily basis, we compute yearly returns (252 trading days) for every asset and invest into the top 5 performing assets equally weighted. In addition, we apply a regularisation step on daily ideal portfolio weights in order to reduce noise and to be less sensitive to effects like timing luck^{3}. This regularisation step simply applies a moving-window (21 trading days) sample mean to daily portfolio weights from relative strength momentum indicators. This way portfolio weights cannot dramatically change from one day to the next anymore and hence become more smooth over time.
The trade cost optimisation in use relies on two key tuning parameters:
The turnover distance $\delta $ which needs to be exceeded such that we trigger a trading event and the turnover distance $\gamma $ which is accepted directly after trading. The second parameter $\gamma $ basically determines the tolerance in which the trade cost optimisation is allowed to operate. It controls the precision to which the optimal portfolio weights will be achieved after application of the trade cost optimisation. Setting $\gamma =0$ enforces the trade cost optimisation to fully trade towards the ideal weights and, e.g., $\gamma =0.5\cdot \delta $ means that the trade cost optimisation has to reduce the turnover distance to the ideal weight until it is smaller or equal to half the turnover trigger. The trade cost optimisation is doing this in a cost-efficient way. A graphical illustration of the trade cost optimisation mechanism was already presented in Figure 2 for an example trade event.
In Figure 3, we present the results for a backtest from Jan-2008 to Dec-2018 with an initial portfolio value of $25,000. Three different implementation strategies are considered: As benchmark case we consider the strategy without any trade cost optimisation ($\gamma =0$, $\delta =0$), i.e., we trade on a daily basis to the ideal weights. The two other strategies use the trade cost optimisation with parameter settings $\gamma =0.025$, $\delta =0.1$ and $\gamma =0.05$, $\delta =0.15$. In all three cases we assume that fractional dealing is allowed. Results under a no-fractional-dealing condition are presented in Section 3.4.
In the top plot of Figure 3 we can see that the performance of the three settings is almost indistinguishable. Looking at the middle plot in Figure 3 for the cumulative turnover and the lower plot for the cumulative trade count it becomes clear that the trade cost optimisation can reduce trading costs to a huge extent. In particular, aggregate trade count, i.e. the number of executed trades, can be reduced significantly, but trading volume measured in terms of turnover is also reduced. At the same time the overall performance of the portfolio strategy does not change significantly and there is no systematic bias visible. Measured in terms of average daily turnover distance to the ideal weights for $\gamma =0.025$, $\delta =0.1$ the distance is 5.94% while it is 9.59% for $\gamma =0.05$, $\delta =0.15$. This explains why it is almost impossible to visually distinguish the three cumulative performance graphs shown in the top plot of Figure 3.
The reductions in trading costs are indeed remarkable: The annualised turnover is reduced from 1.96 by 52.64% to 0.93 (by 61.92% to 0.75) for $\gamma =0.025$, $\delta =0.1$ ($\gamma =0.05$, $\delta =0.15$). The cost-efficiency gain is even more pronounced for the annualised trade count, which is reduced from 1,422 to 40 (24) trades per year, i.e., by 97.16% and 98.34% respectively. This means that the studied momentum strategy, which in the backtest has a turnover of almost 200% per year, can be implemented with an average of only 24 trades per year and the resulting portfolio allocations, and hence also the performance, is almost the same as the original strategy.
In the following, we will present technical details and mathematical derivations necessary to implement the trade cost optimisation. Readers not interested in those technical details are encouraged to directly jump to either Section 3.4, which contains the backtest results with a no-fractional-dealing condition, or to continue reading with the concluding remarks in Section 4.
Section 3 is organised as follows. In Section 3.1 we introduce measures for the distance of two portfolio weight vectors and explain the relation of those distances to different types of transaction costs. Moreover, we give a mathematical formulation of a no-fractional-dealing condition. Section 3.2 contains the mathematical formulation of the trade cost optimisation problem and in Section 3.3 we provide derivations in order to transform the trade cost optimisation problem into a mixed integer linear program (MILP) for which standard solvers exist. Finally, in Section 3.4 we show simulation results for the previously studied momentum strategy but under consideration of a no-fractional-dealing condition.
For simplicity, we restrict ourselves to the case of an existing portfolio with no deposits and $n$ assets. Our hypothetical investor intends to switch from one portfolio weight vector ${\mathit{x}}_{0}:=({x}_{0,1},\dots ,{x}_{0,n}{)}^{\mathrm{\prime}}$ to another weight vector $\stackrel{~}{\mathit{x}}:=({\stackrel{~}{x}}_{1},\dots ,{\stackrel{~}{x}}_{n}{)}^{\mathrm{\prime}}$ in a trade-cost-efficient manner.
Measuring the Distance Between Weight Vectors
The distance between two portfolio weight vectors $\mathit{x}:=({x}_{1},\dots ,{x}_{n}{)}^{\mathrm{\prime}}$ and $\stackrel{~}{\mathit{x}}$ can be measured with different metrics:
$TC($
where $1_{A}$ is the indicator function which is equal to one if $A$ is true and zero otherwise.
2. Trading volume $TV($
$TV($
$TO($
Note that all three distances are symmetric.
Measuring Transaction Costs
Trading from ${\mathit{x}}_{0}$ to $\mathit{x}$ comes at a cost. W.l.o.g. let the cash asset have index $i=1$. It is used as a residual asset with target weight zero. Different types of costs can be represented in terms of weight distances^{4}.
$$\begin{array}{rl}{\displaystyle {C}_{fix}({\mathit{x}}_{0},\mathit{x})}& {\displaystyle ={c}_{fix}\sum _{i=2}^{n}{1}_{\{\mathrm{\mid}{x}_{i}-{x}_{0,i}\mathrm{\mid}>0\}}}\\ {\displaystyle}& {\displaystyle ={c}_{fix}\cdot T{C}_{1}({\mathit{x}}_{0},\mathit{x})\mathrm{.}}\end{array}$$
$$\begin{array}{rl}{\displaystyle {C}_{var}({\mathit{x}}_{0},\mathit{x})}& {\displaystyle ={P}_{PF}\cdot {c}_{var}\sum _{i=2}^{n}\mathrm{\mid}{x}_{i}-{x}_{0,i}\mathrm{\mid}}\\ {\displaystyle}& {\displaystyle ={P}_{PF}\cdot {c}_{var}\cdot T{V}_{1}({\mathit{x}}_{0},\mathit{x})}\\ {\displaystyle}& {\displaystyle ={P}_{PF}\cdot 2\cdot {c}_{var}\cdot T{O}_{1}({\mathit{x}}_{0},\mathit{x}),}\end{array}$$
where $P_{PF}$ denotes the total value of the portfolio.
3. Total costs
$$\begin{array}{rl}{\displaystyle C({\mathit{x}}_{0},\mathit{x})}& {\displaystyle ={C}_{fix}({\mathit{x}}_{0},\mathit{x})+{C}_{var}({\mathit{x}}_{0},\mathit{x})}\\ {\displaystyle}& {\displaystyle ={c}_{fix}\cdot T{C}_{1}({\mathit{x}}_{0},\mathit{x})+{P}_{PF}\cdot 2\cdot {c}_{var}\cdot T{O}_{1}({\mathit{x}}_{0},\mathit{x})\mathrm{.}}\end{array}$$
Portfolio Volumes, Weights and Fractional Dealing
For retail investors fractional dealing is often not possible. This implies that trade-cost efficient implementations need to handle integer constraints. If the price of asset $i$ is given by $P_i > 0$ and the number of volumes invested in asset $i$ by ${V_i$, the total value of the portfolio can be computed as
$P_{PF} =$
and the portfolio weight for asset $i$ is given by $x_i = V_i$. If fractional dealing is allowed, we have ${V_i$, whereas with no-fractional-dealing condition ${V_i$ applies for all assets except cash ($i=2,$).
As explained in Section 1, a straightforward setup for a trade cost optimisation is to minimise the total costs under some constraint on the distance to the ideal portfolio weight. A trade event is triggered whenever $TO($. However, if the trading trigger $\delta $ is reached, we do not want to fully trade to our ideal weight and spend costs $C($. Instead, the trade cost optimisation should deliver a new weight vector, $\mathit{x}$, with minimum trading costs, but sufficiently close to the ideal weight vector (the maximum allowed distance is $TO($, with $\gamma \in (0,\delta )$).
In mathematical terms, the optimisation problem can be written as
$$\underset{\mathit{x}}{\mathrm{min}}{C}_{fix}({\mathit{x}}_{0},\mathit{x})+{C}_{var}({\mathit{x}}_{0},\mathit{x})\phantom{\rule{2em}{0ex}}\text{s.t.}\phantom{\rule{2em}{0ex}}\{\begin{array}{l}{\textstyle {\sum}_{i=1}^{n}{x}_{i}=1}\\ {\textstyle {\mathbf{0}}_{n}\le \mathit{x}\le {\mathbf{1}}_{n}}\\ {\textstyle TO(\mathit{x},\stackrel{~}{\mathit{x}})\le \gamma}\end{array},$$
where we use the notation ${\mathbf{0}}_{n}$ and ${\mathbf{1}}_{n}$ for $(n$ column vectors of zeros and ones, respectively. Besides the already discussed turnover restriction, we added the standard portfolio budget constraint and a no-short-selling restriction. For simplicity, we also assume that trading costs are not directly deducted from the portfolio but externally charged, for example on a monthly basis from a reference bank account.
Standard solvers for convex problems are not well suited for such a problem as the $C_{var}($ and $TO($ contain the absolute value function and $C_{fix}($ even the absolute value function within the indicator function. Therefore, we will now show how the optimisation problem can be linearised using an augmentation technique to obtain a mixed integer linear program (MILP) which can be easily solved using standard software packages for numerical optimisation (see for example Roncalli (2013) where such an augmentation is also applied for quadratic programs).
For $i=1,$ let $x_{0,i}$ be the current weight invested in asset $i$ and $x_i$ be the future, i.e., after-optimisation weight of asset $i$. By introducing appropriate auxiliary variables $x_i^+$ and $x_i^-$ for each asset respectively, we can obtain
$x_i = x_{0,i} + x_i^+ - x_i^-.$
Without further constraints, we could find infinitely many combinations of $x_i^+$ and $x_i^-$ that fulfil this equation. However, if we impose the additional constraint $x_i^+$, i.e., at least one of the variables $x_i^+$ or $x_i^-$ is necessarily equal to zero, $x_i^+$ and $x_i^-$ are uniquely defined and we can write
$|x_i - x_{0,i}| = |x_i^+ - x_i^-| = x_i^+ + x_i^-.$
$x_{i}^{+}$ can then be interpreted as the excess weight of the final weight $x_i$ with regards to the initial portfolio weight $x_{0,i}$. In other words: It measures how much the individual asset weight is increased. Similarly, $x_{i}^{-}$ represents a decrease in the weight of asset $i$.
We can now re-write the variable costs as a linear function in the vectors ${$ and ${$ as
$$\begin{array}{rl}{\displaystyle {C}_{var}({\mathit{x}}_{0},\mathit{x})}& {\displaystyle ={P}_{PF}\cdot 2\cdot {c}_{var}\cdot T{O}_{1}({\mathit{x}}_{0},\mathit{x})}\\ {\displaystyle}& {\displaystyle ={P}_{PF}\cdot 2\cdot {c}_{var}\sum _{i=2}^{n}\mathrm{\mid}{x}_{i}-{x}_{0,i}\mathrm{\mid}}\\ {\displaystyle}& {\displaystyle ={P}_{PF}\cdot 2\cdot {c}_{var}\sum _{i=2}^{n}({x}_{i}^{+}+{x}_{i}^{-})\mathrm{.}}\end{array}$$
In a similar way, we also linearise the turnover distance between $\mathit{x}$ and $\stackrel{~}{\mathit{x}}$ by enforcing the identity
$x_i =$
with the auxiliary variables ${\stackrel{~}{x}}_{i}^{+}\ge 0$ and ${\stackrel{~}{x}}_{i}^{-}\ge 0$. Under the condition ${\stackrel{~}{x}}_{i}^{+}\cdot {\stackrel{~}{x}}_{i}^{-}=0$, we get
$|x_i -$
We can now re-write the optimisation constraint $TO($ as a linear constraint in the vectors ${$ and ${$
$TO($
The fixed costs additionally contain an indicator function. Therefore, we need to add further binary auxiliary variables $z_i$, for $2$. Via inequality constraints, we will force the binary variable $z_i$ to be an indicator variable which is equal to one if and only if we trade asset $i$. Let ${\alpha}_{0}=1{0}^{-5}$, ${\alpha}_{1}=1$ and consider the inequality
$$\begin{array}{rlr}{\displaystyle {z}_{i}\cdot {\alpha}_{0}\le \mathrm{\mid}{x}_{i}-{x}_{0,i}\mathrm{\mid}\le {z}_{i}\cdot {\alpha}_{1},}& {\displaystyle}& {\displaystyle i=2,\dots ,n\mathrm{.}}\end{array}$$
If the inequality is fulfilled, it guarantees that $z_i = 0$ when $|x_i - x_{0,i}| = 0$ and $z_i=1$ when $|x_i - x_{0,i}|$. Like the variable costs, we can re-write these constraints in terms of ${\mathit{x}}^{+}$ and ${\mathit{x}}^{-}$ as linear functions. Moreover, we can now also write the fixed costs as a linear function in $\mathit{z}:=({z}_{2},\dots ,{z}_{n}{)}^{\mathrm{\prime}}$
$$\begin{array}{rl}{\displaystyle {C}_{fix}({\mathit{x}}_{0},\mathit{x})}& {\displaystyle ={c}_{fix}\cdot T{C}_{1}({\mathit{x}}_{0},\mathit{x})={c}_{fix}\sum _{i=2}^{n}{1}_{\{\mathrm{\mid}{x}_{i}-{x}_{0,i}\mathrm{\mid}>0\}}}\\ {\displaystyle}& {\displaystyle \stackrel{(\star )}{=}{c}_{fix}\sum _{i=2}^{n}{1}_{\{\mathrm{\mid}{x}_{i}-{x}_{0,i}\mathrm{\mid}\ge {\alpha}_{0}\}}={c}_{fix}\sum _{i=2}^{n}{1}_{\{{z}_{i}>0\}}={c}_{fix}\sum _{i=2}^{n}{z}_{i}\mathrm{.}}\end{array}$$
Note that, due to technical reasons, we have to assume a minimum trade size per asset of ${\alpha}_{0}=1{0}^{-5}$ such that $($ holds, i.e., either $|x_i - x_{0,i}|$ or $|x_i - x_{0,i}| = 0$.
Putting things together, we obtain the optimisation problem
$$\begin{array}{rl}{\displaystyle}& {\displaystyle \underset{\mathit{y}}{\mathrm{min}}\text{\hspace{0.25em}\hspace{0.05em}}{c}_{fix}\sum _{i=2}^{n}{z}_{i}+{P}_{PF}\cdot {c}_{var}\sum _{i=2}^{n}({x}_{i}^{+}+{x}_{i}^{-})}\\ {\displaystyle}& {\displaystyle \text{s.t.}\phantom{\rule{2em}{0ex}}\{\begin{array}{l}{\textstyle {\sum}_{i=1}^{n}{x}_{i}=1}\\ {\textstyle \mathit{x}={\mathit{x}}_{0}+{\mathit{x}}^{+}-{\mathit{x}}^{-}}\\ {\textstyle \mathit{x}=\stackrel{~}{\mathit{x}}+{\stackrel{~}{\mathit{x}}}^{+}-{\stackrel{~}{\mathit{x}}}^{-}}\\ {\textstyle {\mathit{x}}^{+}\odot {\mathit{x}}^{-}={\mathbf{0}}_{n}}\\ {\textstyle {\stackrel{~}{\mathit{x}}}^{+}\odot {\stackrel{~}{\mathit{x}}}^{-}={\mathbf{0}}_{n}}\\ {\textstyle {\mathbf{0}}_{n}\le \mathit{x},{\mathit{x}}^{+},{\mathit{x}}^{-}\le {\mathbf{1}}_{n}}\\ {\textstyle \frac{1}{2}{\sum}_{i=1}^{n}{\stackrel{~}{x}}_{i}^{+}+{\stackrel{~}{x}}_{i}^{-}\le \gamma}\\ {\textstyle {x}_{i}^{+}+{x}_{i}^{-}\ge {\alpha}_{0}\cdot {z}_{i},\phantom{\rule{1em}{0ex}}2\le i\le n}\\ {\textstyle {x}_{i}^{+}+{x}_{i}^{-}\le {\alpha}_{1}\cdot {z}_{i},\phantom{\rule{1em}{0ex}}2\le i\le n}\\ {\textstyle \mathit{z}\in \{0,1{\}}^{n-1}}\end{array},}\end{array}$$
where $\mathit{y}:=({{\mathit{x}}^{+}}^{\mathrm{\prime}},{{\mathit{x}}^{-}}^{\mathrm{\prime}},{{\stackrel{~}{\mathit{x}}}^{+}}^{\mathrm{\prime}},{{\stackrel{~}{\mathit{x}}}^{-}}^{\mathrm{\prime}},{\mathit{z}}^{\mathrm{\prime}}{)}^{\mathrm{\prime}}$ is a $((5$ vector and $\odot $ denotes the Hadamard product.
The Non-Linear Constraints $x_i^+$ and ${\stackrel{~}{x}}_{i}^{+}\cdot {\stackrel{~}{x}}_{i}^{-}=0$
The non-linear constraints $x_i^+$ and ${\stackrel{~}{x}}_{i}^{+}\cdot {\stackrel{~}{x}}_{i}^{-}=0$ can be indirectly integrated. Lets skip the non-linear constraints for a moment. Assume $({$ solves the new (without ${x_i^+$ and ${$ constraints) optimisation problem. Then w.l.o.g.
$$\begin{array}{rl}{\displaystyle}& {\displaystyle \mathrm{\exists}j\in \{1,\dots ,n\}:{x}_{j}^{+}\cdot {x}_{j}^{-}\mathrm{\ne}0}\\ {\displaystyle}& {\displaystyle \Rightarrow {x}_{j}^{+}\cdot {x}_{j}^{-}>0}\\ {\displaystyle}& {\displaystyle \Rightarrow {x}_{j}^{+}>0\phantom{\rule{1em}{0ex}}\wedge \phantom{\rule{1em}{0ex}}{x}_{j}^{-}>0.}\end{array}$$
Define the new variables (for $i$):
$$\begin{array}{r}{\displaystyle {y}_{i}^{+}:=\{\begin{array}{ll}{\textstyle {x}_{i}^{+}-{x}_{i}^{-},}& {\textstyle {x}_{i}^{+}\ge {x}_{i}^{-}}\\ {\textstyle 0,}& {\textstyle {x}_{i}^{+}\le {x}_{i}^{-}}\end{array}\phantom{\rule{1em}{0ex}}\text{and}\phantom{\rule{1em}{0ex}}{y}_{i}^{-}:=\{\begin{array}{ll}{\textstyle {x}_{i}^{-}-{x}_{i}^{+},}& {\textstyle {x}_{i}^{-}\ge {x}_{i}^{+}}\\ {\textstyle 0,}& {\textstyle {x}_{i}^{-}\le {x}_{i}^{+}}\end{array}\mathrm{.}}\end{array}$$
It holds
$$\begin{array}{rl}{\displaystyle {y}_{i}}& {\displaystyle :={x}_{0,i}+{y}_{i}^{+}-{y}_{i}^{-}}\\ {\displaystyle}& {\displaystyle ={x}_{0,i}+{x}_{i}^{+}-{x}_{i}^{-}={x}_{i},}\end{array}$$
with $y_i^+$ for $1$. Similarly, we can construct variables ${\stackrel{~}{y}}_{i}^{+}$ and ${\stackrel{~}{y}}_{i}^{-}$ with $y_i {:=}$ and ${\stackrel{~}{y}}_{i}^{+}\cdot {\stackrel{~}{y}}_{i}^{-}=0$. At the same time it holds
$$\begin{array}{rl}{\displaystyle \sum _{i=1}^{n}\mathrm{\mid}{y}_{i}-{\stackrel{~}{x}}_{i}\mathrm{\mid}}& {\displaystyle =\sum _{i=1}^{n}{\stackrel{~}{y}}_{i}^{+}+{\stackrel{~}{y}}_{i}^{-}}\\ {\displaystyle}& {\displaystyle =\sum _{i=1}^{n}\{\begin{array}{ll}{\textstyle {\stackrel{~}{x}}_{i}^{+}-{\stackrel{~}{x}}_{i}^{-},}& {\textstyle {\stackrel{~}{x}}_{i}^{+}-{\stackrel{~}{x}}_{i}^{-}\ge 0}\\ {\textstyle {\stackrel{~}{x}}_{i}^{-}-{\stackrel{~}{x}}_{i}^{+},}& {\textstyle {\stackrel{~}{x}}_{i}^{-}-{\stackrel{~}{x}}_{i}^{+}\ge 0}\end{array}}\\ {\displaystyle}& {\displaystyle \le \sum _{i=1}^{n}{\stackrel{~}{x}}_{i}^{+}+{\stackrel{~}{x}}_{i}^{-}\le 2\cdot \gamma ,}\end{array}$$
i.e., $({$ solves the original problem, including the non-linear constraints $y_i^+$ and ${\stackrel{~}{y}}_{i}^{+}\cdot {\stackrel{~}{y}}_{i}^{-}=0$ as well as the turnover maximum constraint.
The Trade Cost Optimisation Problem as Mixed Integer Linear Program (MILP)
Having shown how to get rid of the non-linear constraint, we can write our optimisation problem as a mixed integer linear program (MILP) with linear (in-)equality constraints
$$\underset{\mathit{y}}{\mathrm{min}}\text{\hspace{0.25em}\hspace{0.05em}}{\mathit{f}}^{\mathrm{\prime}}\mathit{y}\phantom{\rule{2em}{0ex}}\text{s.t.}\phantom{\rule{2em}{0ex}}\{\begin{array}{l}{\textstyle \mathit{A}\mathit{y}\le \mathit{b}}\\ {\textstyle \mathit{G}\mathit{y}=\mathit{h}}\\ {\textstyle \mathit{z}\in \{0,1{\}}^{n-1}}\end{array},$$
with appropriately selected matrices and vectors $\mathit{f}$, $\mathit{A}$, $\mathit{b}$, $\mathit{G}$ and $\mathit{h}$.
Integrating a No-Fractional-Dealing Condition into the Trade Cost Optimisation Problem
Using the identity $x_i = V_i$, we can obtain post-trade volumes and corresponding buy and sell volumes as
$$\begin{array}{rl}{\displaystyle {V}_{i}}& {\displaystyle =\frac{{P}_{PF}}{{P}_{i}}\cdot {x}_{i}}\\ {\displaystyle}& {\displaystyle =\frac{{P}_{PF}}{{P}_{i}}{x}_{0,i}+\frac{{P}_{PF}}{{P}_{i}}{x}_{i}^{+}-\frac{{P}_{PF}}{{P}_{i}}{x}_{i}^{-}}\\ {\displaystyle}& {\displaystyle =:{V}_{0,i}+{V}_{i}^{+}-{V}_{i}^{-}\mathrm{.}}\end{array}$$
Defining $\stackrel{~}{\mathit{y}}:=({{\mathit{V}}^{+}}^{\mathrm{\prime}},{{\mathit{V}}^{-}}^{\mathrm{\prime}},{{\stackrel{~}{\mathit{y}}}^{+}}^{\mathrm{\prime}},{{\stackrel{~}{\mathit{y}}}^{-}}^{\mathrm{\prime}},{\mathit{z}}^{\mathrm{\prime}}{)}^{\mathrm{\prime}}$ and $\stackrel{~}{\mathit{P}}:=(\frac{{P}_{1}}{{P}_{PF}},\dots ,\frac{{P}_{n}}{{P}_{PF}}{)}^{\mathrm{\prime}}$, we obtain the trade cost optimisation with no-fractional-dealing condition as
$$\underset{\stackrel{~}{\mathit{y}}}{\mathrm{min}}\text{\hspace{0.25em}\hspace{0.05em}}{\stackrel{~}{\mathit{f}}}^{\mathrm{\prime}}\stackrel{~}{\mathit{y}}\phantom{\rule{2em}{0ex}}\text{s.t.}\phantom{\rule{2em}{0ex}}\{\begin{array}{l}{\textstyle \stackrel{~}{\mathit{A}}\stackrel{~}{\mathit{y}}\le \mathit{b}}\\ {\textstyle \stackrel{~}{\mathit{G}}\stackrel{~}{\mathit{y}}=\mathit{h}}\\ {\textstyle \mathit{z}\in \{0,1{\}}^{n-1}}\\ {\textstyle {V}_{i}^{+},{V}_{i}^{-}\in {\mathbb{N}}_{0},\phantom{\rule{1em}{0ex}}2\le i\le n}\end{array},$$
where $\stackrel{~}{\mathit{A}}:=({\mathbf{1}}_{{r}_{\mathit{A}}}\otimes {\mathit{Q}}^{\mathrm{\prime}})\odot \mathit{A}$ and $\stackrel{~}{\mathit{G}}:=({\mathbf{1}}_{{r}_{\mathit{G}}}\otimes {\mathit{Q}}^{\mathrm{\prime}})\odot \mathit{G}$, with $\mathit{Q}:=({\stackrel{~}{\mathit{P}}}^{\mathrm{\prime}},{\stackrel{~}{\mathit{P}}}^{\mathrm{\prime}},{\mathbf{1}}_{3\cdot n-1}^{\mathrm{\prime}}{)}^{\mathrm{\prime}}$. Moreover, $r_{$, $r_{$ denote the number of rows of $\mathit{A}$ and $\mathit{G}$, respectively and $\otimes $ denotes the Kronecker product.
We rerun our momentum strategy backtest to see the impact of a no-fractional-dealing condition applied to all nine ETFs. Table 1 summarises the results. We can see that, even with a no-fractional-dealing condition, the trade cost optimisation is capable of keeping the average daily turnover distances to the ideal portfolio on a similar level. At the same time the annual turnovers are almost unchanged, but we observe mildly increasing trade costs in terms of an increase in the annual trade counts. This means that even under the more complex integer constraint of a no-fractional-dealing condition, the trade cost optimisation approach allows us to implement the momentum strategy in a cost-efficient way while keeping the distance to the ideal portfolio within certain bounds.
Parameters & metrics |
No trade cost optimisation |
Setting 1 with fractional dealing |
Setting 1 without fractional dealing |
Setting 2 with fractional dealing |
Setting 2 without fractional dealing |
---|---|---|---|---|---|
$($ |
$(0, 0)$ |
$(0.025, 0.1)$ |
$(0.025, 0.1)$ |
$(0.05, 0.15)$ |
$(0.05, 0.15)$ |
Average $TO($ in % |
0.00 |
5.94 |
6.01 |
9.59 |
9.37 |
Annualised turnover |
1.96 |
0.93 |
0.98 |
0.75 |
0.73 |
Annualised trade count |
1422.25 |
40.33 |
51.75 |
23.67 |
27.42 |
In this blog article we introduced an efficient and flexible trade cost optimisation approach. It can be combined with every portfolio optimisation strategy in a two-step setup. Tuning of the optimisation parameters allows customisation of the trade cost optimisation to individual cost structures and requirements with regards to proximity of realised weights to ideal weights.
We demonstrated the benefits of the presented trade cost optimisation approach in a backtest by showing that a momentum strategy with a yearly turnover of 200% can be implemented with an average of only 24 trades per year. The main challenge in the technical implementation of the trade cost optimisation is the reformulation of the optimisation problem as a mixed integer linear program (MILP). Our derivation of a MILP representation allows a straightforward implementation in every standard software package for numerical optimisation.
Faber, M. (2010), Relative Strength Strategies for Investing, Available at SSRN: http://dx.doi.org/10.2139/ssrn.1585517.
Hoffstein, C., Sibears, D. J. and Faber, N. (2019), Rebalance Timing Luck: The Difference Between Hired and Fired, The Journal of Index Investing, https://doi.org/10.3905/jii.2019.1.070.
Mansini, R., Ogryczak, W. and Speranza, M. G. (2014), Twenty years of linear programming based portfolio optimization, European Journal of Operational Research, 234 (2), pp. 518-535.
Roncalli, T. (2013), Introduction to Risk Parity and Budgeting, Chapman & Hall/CRC Financial Mathematics Series.
1: As an alternative, we could also use a calendar-based trading trigger, like monthly or weekly.
2: https://www.portfoliovisualizer.com/examples
3: See Hoffstein, Sibears and Faber (2019) and https://blog.thinknewfound.com/2018/01/quantifying-timing-luck/ for a discussion of timing luck.
4: We use the notation $TC_{1}($ and $TV_{1}($, etc., if the first index (w.l.o.g. cash) is skipped in the distance measure.
Disclaimer – The views and opinions expressed in this blog are those of the author and do not necessarily reflect the views of Scalable Capital GmbH, its subsidiaries or its employees ("Scalable Capital", "we"). The content is provided to you solely for informational purposes and does not constitute, and should not be construed as, an offer or a solicitation of an offer, advice or recommendation to purchase any securities or other financial instruments. Any representation is for illustrative purposes only and is not representative of any Scalable Capital product or investment strategy. The academic concepts set forth herein are derived from sources believed by the author and Scalable Capital to be reliable and have no connection with the financial services offered by Scalable Capital. Past performance and forward-looking statements are not reliable indicators of future performance. The return may rise or fall as a result of currency fluctuations. Please refer to our risk information.
Risk Disclaimer – There are risks associated with investing. The value of your investment may fall or rise. Losses of the capital invested may occur. Past performance, simulations or forecasts are not a reliable indicator of future performance. We do not provide investment, legal and/or tax advice. Should this website contain information on the capital market, financial instruments and/or other topics relevant to investment, this information is intended solely as a general explanation of the investment services provided by companies in our group. Please also read our risk information and terms of use.