Source-linked AI summary
Multi-Period Trading via Convex Optimization
Stephen Boyd, Enzo Busseti, Steven Diamond, Ronald N. Kahn, Kwangmoo Koh, Peter Nystrup, Jan Speth
TL;DR
The paper addresses how to trade across multiple periods when practical constraints and future estimates matter. It presents unified convex-optimization frameworks for single- and multi-period trading, while leaving forecast construction outside scope.
Problem
Given forecasts of returns and other quantities, the paper asks how to convert them into trades while accounting for practical multi-period trading issues.
Method
The paper unifies single-period and multi-period trading through convex optimization that incorporates return, risk, transaction cost, holding cost, and future trade planning.
Results
The paper provides practical frameworks for exploiting forecasts in single- and multi-period trading, supported by an accompanying open-source software library.
Takeaways & Limitations
Multi-period optimization can account for how current holdings affect future trading and can handle return estimates defined over different time scales.
Takeaways & Limitations
The methods treat forecasts of returns, volumes, volatilities, and other quantities as given rather than addressing how those forecasts are constructed.
Abstract
from arXiv · showhide
We consider a basic model of multi-period trading, which can be used to evaluate the performance of a trading strategy. We describe a framework for single-period optimization, where the trades in each period are found by solving a convex optimization problem that trades off expected return, risk, transaction cost and holding cost such as the borrowing cost for shorting assets. We then describe a multi-period version of the trading method, where optimization is used to plan a sequence of trades, with only the first one executed, using estimates of future quantities that are unknown when the trades are chosen. The single-period method traces back to Markowitz; the multi-period methods trace back to model predictive control. Our contribution is to describe the single-period and multi-period methods in one simple framework, giving a clear description of the development and the approximations made. In this paper we do not address a critical component in a trading algorithm, the predictions or forecasts of future quantities. The methods we describe in this paper can be thought of as good ways to exploit predictions, no matter how they are made. We have also developed a companion open-source software library that implements many of the ideas and methods described in the paper.
Introduction
Multi-period portfolio selection extends risk-return optimization to sequences of trades while incorporating transaction costs, constraints, and changing forecasts. Exact dynamic programming captures recourse but is often impractical because of the curse of dimensionality, motivating simpler approximate methods.
- Single-period portfolio selection: Markowitz formulated portfolio choice as an optimization trading off risk and return, while later work incorporated transaction costs into single-period selection.
- Multi-period portfolio selection: Multi-period portfolio selection chooses a sequence of trades, making transaction costs, constraints, and time-varying forecasts more natural to handle.
- Multi-period portfolio selection: Dynamic programming accounts for recourse and updated information but is impractical for most trading problems because of the curse of dimensionality.As a result, many studies use few assets and simple objectives or constraints.
- Approximation: Practical implementations often approximate dynamic programming with simpler multi-period optimization formulations.The paper focuses on these simpler methods and notes that practical performance loss may be small.
- Why now?: More powerful computers, algorithms, optimization languages, and larger datasets now support full and multi-period optimizations and extensive back-testing.
4 Introduction
The paper presents a unified, practical framework for convex optimization in single- and multi-period trading, accompanied by an open-source Python library. It focuses on exploiting supplied forecasts rather than constructing them and targets quantitative practitioners familiar with portfolio selection and basic convex optimization.
- Scope: Forecast construction is outside the paper’s scope; the methods instead describe how to trade given estimates of returns and other quantities.
- Simulation: The framework supports simulation, back-tests, what-if analyses, and stress-tests using realized, hypothetical, or challenging data.
- Optimization-based trading: The methods determine trades through single-period and multi-period optimization, with the latter solving over multiple future periods.
- Contribution: The paper unifies definitions, modeling, and convex-optimization methods for multi-period trading in a self-contained practical framework.Its contribution is primarily organization and practical treatment rather than new theoretical results.
- Contribution: The accompanying open-source Python library implements many of the paper’s ideas and methods.
- Target audience: The target reader is a quantitative trader with background in portfolio selection, trading, finance, and basic convex optimization.
The Model
The model represents asset and cash holdings, trades, portfolio value, costs, and constraints over discrete periods. Transaction costs are modeled as separable functions of non-cash trades, while holding costs and self-financing connect portfolio evolution to convex trading optimization.
- Portfolio and trades: The portfolio contains n assets plus cash over discrete periods, with holdings, trades, post-trade positions, and portfolio value tracked in dollars.Asset holdings may be long or short, while cash may be positive or borrowed.
- Portfolio representation: Weights normalize dollar holdings by total portfolio value, sum to one, and express cash, exposure, and leverage in unitless form.
- Trading: Turnover is defined as half the ℓ1-norm of non-cash trades, with a normalized version obtained by dividing by portfolio value.
- Transaction costs: The transaction-cost function is assumed to be separable across assets, zero at no trade, and independent of the cash-trade component.Common models include linear, piecewise-linear, and quadratic terms, most of which are convex.
- Transaction costs: A generic transaction-cost model includes spread, volatility, volume, and asymmetry parameters for the dollar trade.
- Transaction costs: Transaction costs can be expressed in dollar or normalized form, using dollar or portfolio-value-normalized trading volume respectively.
Metrics
The paper introduces portfolio-performance metrics based on absolute value growth rather than benchmark-relative performance. It distinguishes average realized return from average per-period growth rate, or log-return.
- Absolute performance: The metrics first measure portfolio-value growth in absolute terms rather than relative to a benchmark or risk-free rate.
- Return and growth rate: Average realized return summarizes portfolio returns over periods t = 1, . . . , T.
- Return and growth rate: Growth rate, or log-return, provides an alternative per-period measure whose average is computed across the investment horizon.
20 Metrics
The paper defines portfolio, benchmark, active-return, and risk metrics for evaluating trading performance, with annualization used for interpretability.
- Annualized return and growth rates multiply per-period values by P, the number of periods per year; trading-day periods typically use P ≈250.
- Volatility is the standard deviation of portfolio returns, and its square is quadratic risk.
- A benchmark is a nonnegative portfolio-weight vector summing to one, with cash as a special risk-free benchmark.
- Active return measures portfolio return relative to a benchmark, while cash benchmarking yields excess return.
- Active risk is the standard deviation of active returns; with a cash benchmark and constant risk-free rate, it equals portfolio risk.
- The information ratio divides average active return by active risk, while cash benchmarking gives the Sharpe ratio.
Single-Period Optimization
Single-period optimization chooses current trades from estimated returns, costs, and risks by solving a convex risk-adjusted objective under trading and holdings constraints.
- Current asset trades are selected using estimates of returns, market parameters, transaction costs, and holding costs unavailable at the decision time.
- The normalized trade vector is optimized subject to trading constraints, holdings constraints, and a self-financing condition.
- Absolute-return, excess-return, and active-return objectives produce the same trades after removing constants independent of the trade vector.
- The optimization objective combines estimated trade return, transaction cost, post-trade holding cost, and post-trade portfolio risk.
- The realized cash trade is computed from realized costs and generally differs from the cash trade planned using estimated costs.
4.1. Risk-return optimization
The framework develops risk-return optimization with practical constraint simplifications, traditional covariance-based risks, factor models, and a growth-rate interpretation of risk aversion.
- Replacing self-financing with 1T zt = 0 is considered accurate because transaction and holding costs are small relative to portfolio value, while costs remain in the objective.
- The simplified constraint can slightly overestimate realized cash and allow small discrepancies between estimated and realized post-trade holdings or constraint satisfaction.
- Traditional quadratic risk uses estimated return covariance, with active risk reducing to absolute or excess risk under a cash benchmark.
- Setting γt = 1/2 approximately maximizes expected growth under a quadratic logarithm approximation, although Kelly portfolios tend to carry too much risk in practice.
- Factor models reduce optimization complexity from O(n3) to O(nk2) flops when k is much smaller than n, typically tens of factors versus thousands of assets.
4.2. Risk measures
The paper extends traditional risk measures to represent nonlinear risk preferences, scenario uncertainty, and errors in return or covariance forecasts.
- Transformed risk applies a nondecreasing, convex function to quadratic risk, allowing risk aversion to increase as risk rises.
- Worst-case quadratic risk takes the maximum across covariance scenarios rather than a probability-weighted average when scenarios are not predicted.
- Scenario covariances can be estimated from historical returns conditioned on market conditions or specified as analyst judgments.
- Forecast errors can substantially affect portfolio weights and out-of-sample performance, motivating explicit uncertainty terms.
- Covariance forecast uncertainty adds a squared weighted ℓ1 penalty on deviations from benchmark weights, which directly penalizes leverage under a cash benchmark.
4.4 Holding constraints
Holding constraints restrict post-trade portfolio holdings to satisfy legal, investor, risk, liquidity, and concentration requirements, with some constraints approximating next-period holdings.
- 4.4. Holding constraints: Holding constraints are often imposed on post-trade holdings because next-period holdings depend on unknown returns, although some constraints transfer exactly.When returns are small, post-trade holdings approximate next-period holdings; estimated transaction costs can still cause slight cash-balance violations.
- 4.4. Holding constraints: Post-trade holdings can be constrained by long-only, leverage, no-hold, β-neutrality, and factor-neutrality requirements.These constraints apply to wt + zt, the normalized post-trade portfolio.
- 4.4. Holding constraints: Stress constraints require portfolio returns under specified market shocks to remain above a minimum threshold.Scenarios may represent events such as oil-price changes, momentum reversals, or real-estate collapses.
4.5. Trading constraints
Trading constraints restrict normalized trades, while convex formulations support diverse transaction, holding, risk, and trading requirements with practical solve times.
- 4.5. Trading constraints: Trading constraints include turnover and market-volume limits, no-buy or no-sell restrictions, and no-trade restrictions combining both.Non-cash trade constraints are exact, whereas cash-trade constraints are approximate because costs are estimated.
- 4.5. Trading constraints: Holding and trading constraints can be softened by subtracting weighted L1 violation penalties from the objective.For factor neutrality, larger penalty weights enforce neutrality more strongly when feasible.
- 4.5. Trading constraints: The optimization remains rapidly solvable when risk, transaction and holding costs, and constraint sets are convex, while self-financing requires relaxation or simplification.Disciplined convex programming frameworks make these problems easier to specify and modify.
- 4.5. Trading constraints: Convex SPO problems with complex leverage, transaction-cost, trading, and holding constraints have computational complexity O(nk^2).Here n is the asset count and k is the factor count; without a factor model, k is replaced by n.
- 4.5. Trading constraints: A single core can solve an SPO problem with 1500 assets and 50 factors in under one half second.The paper reports that five years of data with 64 parameter choices can be back-tested in under 10 minutes using 64 threads.
4.7. Convexity
The paper emphasizes convex formulations because they enable reliable, fast optimization, while nonconvex trading requirements can make back-testing impractical and are best avoided or approximated.
- 4.7. Convexity: Nonconvex constraints greatly lengthen solution times and can make back-testing impractical, reducing the effectiveness of optimization-based trading.Examples include minimum trade sizes, limits on the number of holdings, and integer share-lot restrictions.
- 4.7. Convexity: Sparse trading or avoidance of tiny trades can be encouraged with convex constraints or cost terms instead of minimum nonzero-trade requirements.The paper presents a relaxation-and-sign-fixing heuristic as one way to handle such nonconvex requirements.
- 4.7. Convexity: Convex optimization enables practical and reliable portfolio trading when costs, risks, and constraint sets are convex.The paper describes convex formulations as suitable for exploiting forecasts through back-testing and stress-testing.
- 4.7. Convexity: Forecast quality must ultimately be judged in the portfolio context, including constraints, transaction costs, holding costs, other forecasts, and risk-aversion parameters.Simple Sharpe-ratio or information-ratio tests do not capture the full multi-period trading value of a forecast.
Multi-Period Optimization
Multi-period optimization plans trades over a future horizon to account for transaction costs, changing risks, constraints, liquidity, and forecasts at multiple time scales, executing only the current trade.
- Multi-Period Optimization: Multi-period optimization can account for future transaction costs that single-period optimization misses when positions must later be unwound.This is especially relevant for rarely traded assets whose liquidation may be expensive.
- Multi-Period Optimization: The framework can exploit multiple time-scale return estimates, signal decay, anticipated risk or liquidity changes, changing constraints, and portfolio transitions.Examples include reducing risk before a known volatility increase and delaying trades until forecast volume makes them cheaper.
- Multi-Period Optimization: MPO chooses the current trade by solving an optimization problem over a horizon extending H periods into the future, using estimates of unknown future quantities.The planned sequence includes future trades and portfolio weights, but only the current trade is selected for execution.
- Multi-Period Optimization: A simplifying planning approximation uses wt+1 = wt + zt and imposes zero-sum trades so planned portfolio weights remain normalized.The true dynamics additionally depend on realized returns through (1 + rt) ◦(wt + zt).
- Multi-Period Optimization: The resulting MPO formulations are convex when transaction costs, holding costs, risk functions, and trading and holding constraints are convex.When H = 1, the multi-period problem reduces to the simplified single-period problem.
Implementation
CVXPortfolio implements the paper’s portfolio simulation and optimization concepts in an open-source Python package. Its models use Pandas for data management and CVXPY for convex optimization.
- Implementation: CVXPortfolio is an open-source Python package implementing the paper’s portfolio simulation and optimization concepts.It relies on Pandas for data management and CVXPY for convex optimization modeling.
- Implementation: The package provides object-oriented classes for returns, risk measures, transaction costs, holding constraints, and trading constraints.These components generate CVXPY expressions and constraints that can be combined into convex models.
54 Implementation
The software exposes modular classes for forecasts, risks, costs, constraints, policies, and simulations. These components support both single-period and multi-period optimization and parallel back-testing.
- 54 Implementation: Additional policy or risk-measure classes can be implemented straightforwardly within the package’s modular framework.The software is organized around classes representing the main portfolio-optimization components.
- 54 Implementation: AlphaSource objects generate period-specific return estimates from information available at that period, and multiple sources can be blended linearly.The simplest source wraps a Pandas dataframe containing return estimates.
- 54 Implementation: RiskMeasure, cost, and constraint classes encode convex risk costs, transaction and holding costs, leverage limits, and soft constraints.Risk measures can use full covariance or factor models, while cost objects can also express soft objective terms.
- 54 Implementation: Policy objects map current holdings and portfolio value to trades, with SinglePeriodOpt and multi-period policies constructed from forecasts, costs, risks, and constraints.The package also includes simpler policies such as periodic rebalancing.
- 54 Implementation: MarketSimulator runs trading simulations and back-tests from historical market data, an initial portfolio, and a selected policy.Back-test results include the performance metrics discussed in the paper, and multiple back-tests can run in parallel.
Examples
The numerical examples use CVXPortfolio and open-source market data to illustrate transaction-cost trade-offs, hyper-parameter sensitivity, single-period and multi-period optimization, and computational cost. The authors caution that the simulations are illustrative because of approximations and limitations such as survivorship bias and simplified cost assumptions.
- Examples: The authors caution that the numerical results are illustrative rather than definitive because the simulations use approximations and include limitations such as survivorship bias.They use the examples to illustrate phenomena including transaction-cost effects and hyper-parameter sensitivity.
- 7.2 Portfolio simulation: The examples use five years of S&P 500 component data, realized daily returns and volumes, and fixed transaction and holding-cost assumptions.The study period runs from January 2012 through December 2016; it uses a 0.05% bid-ask spread and 0.01% holding cost.
- 7.2 Portfolio simulation: Rebalancing frequency trades off transaction cost against active risk, while transaction cost depends on total portfolio value.Figure 7.1 presents this relationship separately for initial portfolios of $100M and $10B.
- 7.3 Single-period optimization: The return forecasts agree with realized-return signs around 54% of the time across assets and days.The authors describe this accuracy as roughly what might be expected from a proprietary forecast.
- 7.3 Single-period optimization: SPO performance is highly sensitive to trading-aversion choices, with some parameter values producing curves outside the plotting area and values around γtrade = 6 appearing best.The coarse and fine searches plot mean excess return against excess volatility.
- 7.3 Single-period optimization: A 410-combination SPO grid search identifies Pareto-optimal risk-return points, with large holding-cost multipliers outperforming γhold = 1 despite one-basis-point actual holding costs.The authors interpret the multiplier as regularization that discourages short positions.
- 7.4 Multi-period optimization: MPO has a substantial advantage over SPO in the Pareto-optimal frontier comparison, largely because it forecasts both tomorrow’s and today’s return.The MPO algorithm uses the relevant return forecast twice in its planning process.
- 7.5. Simulation time: One SPO back-test takes about 0.25 seconds per day, or roughly 5 minutes over five years, with optimization consuming about 0.15 seconds per day.Running 410 back-tests, involving around half a million convex optimization problems, takes about thirty minutes on a 32-core machine.