Skip to main content
Transaction Cost Analysis

Using a pre-trade Transaction Cost Analysis Constraint in Portfolio Optimization

Edgar Nuñez avatar
Written by Edgar Nuñez
Updated over 4 months ago

Using a Transaction Cost Analysis Constraint in Portfolio Optimization

Portfolio optimization aims to balance returns with risk effectively. While traditional optimizations focus on returns and risks, incorporating transaction costs can significantly enhance the realism and applicability of these optimizations. This article explains how to integrate transaction cost analysis (TCA) constraints into portfolio optimization.

Importance of TCA in Portfolio Optimization

Ignoring transaction costs can lead to suboptimal decisions. For example, a strategy that frequently rebalances a portfolio might appear attractive from a purely return-risk perspective but could be prohibitively expensive once transaction costs are considered. Incorporating TCA helps in:

  • Reducing unnecessary trading.

  • Enhancing net returns by accounting for real costs.

  • Improving risk management by avoiding excessive turnover.

Modelling TCA

Many different models have been proposed for trading costs. The Algren model (2005) has gained a lot of popularity mostly due to its simplicity and tractability. In particular, this model disentangled realized trading costs into permanent and transitory components.

The transitory component captures any price concession you must make in order to entice your counterparty to agree on the trade. This component is expected to self-correct and vanish over time (after roughly 30 minutes). Intuitively, the concession you make will depend on your patience, e.g. spreading out your trades throughout time will mitigate the transitory cost. The trade duration is thus a crucial parameter of the model. Mathematically, the transitory component is given by

where

  • σ is the daily volatility

  • X is the trade size in dollars (ie. economic exposure).

  • V is the average daily volume in dollars

  • T is the fraction of the day over which the trade would be executed;

Conversely, the permanent cost captures the impact on price from your trading that will persist through time (i.e. after roughly 30 minutes). Mathematically, the permanent component is given by

where

  • Θ is the market capitalization

Then capturing the risk component (or opportunity cost) as

where

  • R,E are the risk aggression weight and exponent respectively, set to:

    • (0.5, 0.5) in the aggressive case

    • (0.3, 0.6) otherwise

  • σ is the daily volatility

  • T is the fraction of the day over which the trade would be executed;

The purpose of requiring the risk component is to account for the opportunity cost or risk of waiting to trade. The longer you wait to trade, the higher the price volatility will be and the higher the likelihood that the price can move against you.

Adding these three components together provides for a more realistic estimation of the true cost of the trade and permits a minimum value. This minimal value is the optimal time over which to trade the security (under the assumption of uniform volume through the day).

Steps to Incorporate TCA in Portfolio Optimization

  1. Formulate the Optimization Problem:
    Traditional portfolio optimization aims to maximize returns for a given level of risk. When including transaction costs, the objective function needs to be adjusted.

    1. Objective Function:

      Intuitively, the objective function should be setup in a way where the optimizer will try to maximize return while accounting for costs, i.e. objective = max ( Expected Return - Transaction Costs ).


      Omega Point’s optimizer, as access through query.model.optimizer allows for custom objectives, and transaction costs are modeled through the minimizeMarketImpact objective. For example:

      objective: {
      custom: {
      minimizeMarketImpact: {
      weight:1.0,
      tradeDuration:0.5,
      riskAggressive:true
      },
      minimizeRisk: {
      specificRisk: { weight:1.0 }
      }
      }
      }


      Here, the transaction costs are a function of the trades required to adjust the portfolio.

  2. Define Constraints:
    Incorporate constraints to limit excessive trading and ensure that transaction costs do not erode the portfolio's value.

  • Max Cost constraint: Ensure the total cost of trades does not exceed a certain value, in currency terms.

  • Trade Duration constraint: The temporary cost of impacting volume based on how quick you trade, as expressed in time units: 0.01 - 1.0, where 0.5 is a half-day.

  • Risk aggressive / opportunity cost constraint: Determines the risk of waiting to trade. If this is set TRUE, then trade duration constraint must also be set

  • These constraints can be implemented through the following graphiql constraint object:

    • constraints: {
      permanentTransitoryRiskMarketImpact: {
      maxCost: 5e5,
      tradeDuration: 0.5,
      riskAggressive: true
      }
      }

Conclusion

Incorporating transaction cost analysis into portfolio optimization is essential for developing realistic and effective investment strategies. By accurately estimating transaction costs, adjusting the optimization objective, and imposing relevant constraints, investors can significantly enhance their net returns and risk management. While this adds complexity to the optimization process, the benefits of a more realistic and practical strategy far outweigh the additional effort.

Full graphql optimization example with transaction cost custom objective

query ($pos: PositionSetInput!) {
model(id: "AXWW4-MH") {
aapl: security(bloombergTicker: "AAPL US EQUITY") {
risk(from: "2016-07-01", to: "2016-07-01") {
total
}
descriptors(on: "2016-07-01") {
averageDailyVolume
marketCap
}
}
msft: security(bloombergTicker: "MSFT US EQUITY") {
risk(from: "2016-07-01", to: "2016-07-01") {
total
}
descriptors(on: "2016-07-01") {
averageDailyVolume
marketCap
}
}
optimization(
positionSet: $pos
objective:
{custom:
{
minimizeMarketImpact:{weight:1.0,tradeDuration:0.5,riskAggressive:true},
minimizeRisk: {specificRisk:{weight:1.0}}
}
}
constraints: {}
# constraints: {permanentTransitoryRiskMarketImpact: {maxCost: 5e5, tradeDuration: 0.5, riskAggressive: true}}
) {
positionsDelta {
equities {
id {
bloombergTicker
}
economicExposure
}
}
}
}
}
Did this answer your question?