Transaction Cost Analysis (TCA)
- Utsav Agarwal
Transaction Cost Analysis (TCA) enables investment managers to assess the effectiveness of their portfolio
transactions. By offering greater transparency into investment strategies and trading performance, TCA aids
in reducing trading costs, improving overall investment returns. This optimization ensures that investment
decisions are not only profitable but also cost-efficient.
Trade Data Features:
1. Execution Venue:
- Description: The trading venue or exchange where the trade is executed.
- Role in TCA: Different venues can have varying liquidity, fees, and execution quality. Analyzing
execution venue performance helps optimize venue selection for cost efficiency.
- Feature Utility: This feature can innovatively decide and choose the best broker or trading platform for a
trader. It shines when the model compares different brokers (in the case of Reinforcement Learning, RL),
especially if they offer varying liquidity, fees, and execution quality during different intraday or weekly
times. The model can develop a better execution strategy, showing that the trading strategy works best with a
specific broker, enhancing risk management and overall trading strategy profits.
2. Fill Ratio:
- Description: Measures the number of successfully filled orders as a fraction of the total number of orders
placed, usually stated as a percentage.
- Role in TCA: Rejected or unfilled orders represent an opportunity cost. The trader may miss the
opportunity to trade or have to trade again at a potentially worse price. Higher fill ratios are desirable.
- Feature Utility: Fill ratio indicates the efficiency of order execution. A higher fill ratio suggests better
execution quality and lower opportunity costs, making it a vital metric for optimizing trading strategies.
3. Entropy of Order Flow:
- Explanation: Measures the unpredictability or randomness in the order flow, calculated using entropy
measures from information theory applied to the sequence of trades and order submissions.
- Justification: High entropy in order flow indicates chaotic market conditions, helping the RL agent adjust
strategies to cope with higher uncertainty.
4. Order Flow Imbalance (OFI):
- Explanation: The difference between buy and sell orders within a given time frame.
- Justification: OFI provides insight into market sentiment and potential price direction, helping anticipate
short-term market pressure.
Market Indicators:
1. Predicted Probability from Time Series Models:
- Description: Utilizes predictions from models like ARIMA, SARIMA, VAR, and regression models.
- Role in TCA: These predictions provide insights into future price movements, helping to optimize entry
and exit points for trades.
- Feature Utility: Including predicted probabilities from advanced time series models enhances the model's
predictive accuracy, leading to more effective and profitable trading strategies.
2. Seasonal Decomposition Residual:
- Explanation: Captures the residual component after decomposing the time series data into trend, seasonal,
and residual parts using techniques like STL (Seasonal and Trend decomposition using Loess).
- Justification: The residual component highlights anomalies or sudden changes in the market that are not
explained by the trend or seasonality, providing critical signals for adaptive trading strategies.
3. Volatility Clustering Indicator:
- Explanation: Measures the persistence of volatility over time, indicating periods of high and low
volatility.
- Justification: Volatility clustering helps anticipate periods of high and low market activity, allowing the
RL agent to adjust strategies accordingly.
4. Anomalous Trade Detection:
- Explanation: Identifies trades that deviate significantly from the norm, such as unusually large trades or
trades at outlier prices.
- Justification: Detecting anomalous trades helps the RL agent avoid potential market manipulation or take
advantage of mispricings.
Benchmark for TCA:
1. Market Resilience (MR):
- Explanation: Indicates the market's ability to revert to its average price after a significant trade.
- Justification: High market resilience suggests a stable market, reducing the risk of price slippage during
large trades.
2. Market Impact Cost:
- Explanation: Evaluates the price movement caused by executing a large trade. It is essential for
understanding the hidden costs associated with trade execution and helps in optimizing trade strategies to
minimize adverse price movements.
- Justification: Understanding market impact cost allows for better execution strategies that minimize
transaction costs and improve profitability.
3. Microstructural Feature (Epsilon):
- Explanation: Derived from the price impact of trades, representing the permanent market impact of a unit
trade.
- Justification: Epsilon helps design strategies that minimize adverse price movements, reducing
transaction costs and improving execution quality.
4. Order Arrival Rate (OAR):
- Explanation: Measures the average number of orders arriving per minute, providing insight into market
activity and liquidity.
- Justification: Understanding OAR helps identify periods of high trading interest, impacting transaction
costs and informing execution strategies.
Additional Concepts and De nitions:
Implementation Shortfall/ Slippage:
- Explanation: The difference between the decision price (when the trade decision was made) and the final
execution price.
- Role in TCA: It captures both explicit costs (commissions and fees) and implicit costs (market impact and
delay costs).
- Feature Utility: Minimizing implementation shortfall is crucial for reducing total trading costs and
improving execution quality.
Opportunity Cost:
- Explanation: The cost of missed trading opportunities, which can occur when orders are not fully
executed or are delayed.
- Role in TCA: Analyzing opportunity costs helps in understanding the trade-off between aggressive and
passive trading strategies.
- Feature Utility: Reducing opportunity costs ensures that trading strategies are more effective in capturing
intended market movements.
Liquidity Risk:
- Explanation: The risk that a security cannot be traded quickly enough in the market to prevent a loss.
- Role in TCA: Liquidity risk is a crucial factor in determining the cost and feasibility of executing large
trades.
- Feature Utility: Managing liquidity risk helps optimize trade execution and minimize the adverse effects
of illiquidity on trading costs.
fi
To select the best 5 state features for enhancing the RL environment.
1. Predicted Probability from Time Series Models:
- Description: Utilizes predictions from models like ARIMA, SARIMA, VAR, and regression models.
- Role in TCA: These predictions provide insights into future price movements, helping to optimize entry
and exit points for trades.
- Feature Utility: Including predicted probabilities from advanced time series models enhances the model's
predictive accuracy, leading to more effective and profitable trading strategies.
2. Seasonal Decomposition Residual:
- Explanation: Captures the residual component after decomposing the time series data into trend, seasonal,
and residual parts using techniques like STL (Seasonal and Trend decomposition using Loess).
- Justification: The residual component highlights anomalies or sudden changes in the market that are not
explained by the trend or seasonality, providing critical signals for adaptive trading strategies.
3. Fill Ratio
- Description: Percentage of successfully filled orders out of the total orders placed.
- Justification: Higher fill ratios indicate better liquidity and execution quality. This feature is critical for
assessing execution performance and optimizing order placement strategies to ensure higher trade
completion rates.
4. Order Flow Imbalance (OFI)
- Description: Difference between buy and sell orders within a given time frame.
- Justification: OFI provides insight into market sentiment and potential price direction. It helps the RL
agent anticipate short-term market pressure and make more informed trading decisions based on the
dynamics of order flow.
5. Entropy of Order Flow
- Description: Measures the unpredictability or randomness in the order flow.
- Justification: High entropy in order flow indicates chaotic market conditions with low predictability. This
feature helps the RL agent adjust strategies to cope with higher uncertainty, improving its adaptability to
different market scenarios.
Implementation in Python is in the below Colab notebook.
https://colab.research.google.com/drive/1ocyAgzv5Oqvg5oaPoimBPv2PB4G8uJ59?usp=sharing
Slippage
Traders don’t want to see too much movement in the trades they place, as this can affect the bottom line of
their executed trade. Slippage is the difference in the executed price from the actual stock (or asset) price the
trader expected.
Since slippage results from the movement in the market toward either a strong uptrend or a downtrend – the
odds of slippage in your trade having a positive impact is undoubtedly there. Still, there is also a chance that
it can negatively affect your portfolio. Slippage occurs in all markets, including equities, bonds,
currencies, futures, and cryptocurrencies.
Measuring and Modeling Execution Cost and Risk
https://w4.stern.nyu.edu/finance/docs/pdfs/Seminars/061m-russell.pdf
Traditional transaction cost analysis typically measures the average difference between transaction prices and
an “efficient” market price, often neglecting the risk aspect. This paper proposes a model that integrates both
cost and risk considerations, providing a more comprehensive analysis of transaction strategies. It introduces
a conditional frontier of cost/risk trade-offs that can guide traders in selecting optimal strategies.
1. Transaction Cost Formula:
2. Transaction Cost Per Dollar Traded:
To standardize transaction costs across different orders:
3. Decomposition of Transaction Costs:
- Deviation from Local Arrival Price:
- Price Impact Over Time:
4. Cost and Risk Trade-offs:
Different order execution strategies involve a trade-off between cost and risk. This is modeled using:
where ƛ represents the trader's risk aversion.
5. Execution Risk and Cost Model:
Execution costs and risks are functions of several conditioning variables (market state, order
characteristics, etc.)
6. Optimization Models:
Based on Almgren and Chriss's framework, the optimization model involves minimizing the expected cost
subject to a risk constraint:
The solution provides an optimal trading trajectory considering the trade-offs between cost and risk.
Proposed Strategies and Applications
1. Arrival Price (AP) Strategy:
This strategy aims to minimize the cost for a given level of risk around the arrival price. The urgency level
affects execution speed and hence the risk and cost.
2. Volume Weighted Average Price (VWAP) Strategy:
This strategy executes orders proportionally to the market volume over a specified time horizon, typically
minimizing cost irrespective of risk.
3. Conditional Frontier:
The model produces a conditional frontier of expected cost and risk, providing traders with a menu of
trade-offs given current market conditions and order characteristics.
Implementation in Python is in the below Colab notebook.
https://colab.research.google.com/drive/1V-yeluEw63Bs2XLZsGgOYBjOWH2k5ZL1?usp=sharing
Slippage in AMM Markets
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4133897
Traditional Market Makers
Roles and Functions:
1. Liquidity Provision: Traditional market makers provide liquidity by continuously quoting buy and sell
prices for securities and ensuring that there are always prices available at which traders can transact. They
achieve this by maintaining inventories of securities and managing the risk associated with holding these
inventories.
2. Price Stability: They contribute to price stability by absorbing short-term supply and demand imbalances.
By buying when there is excess supply and selling when there is excess demand, market makers help to
dampen price volatility.
3. Information Integration: Market makers use the information from trades to infer the underlying value of
securities. They adjust their quotes based on this information, thus playing a crucial role in price discovery.
Economic Principles:
- Bid-Ask Spread: Market makers earn profits from the spread between the bid (buy) and ask (sell) prices.
This spread compensates them for the risk they take by holding inventories and for providing liquidity to the
market.
- Inventory Risk: They manage inventory risk, which arises from the possibility of adverse price movements
while holding a security. Effective risk management is critical to maintaining profitability and solvency.
- Adverse Selection: Traditional market makers face the risk of trading with more informed traders. To
mitigate this, they widen spreads during periods of high uncertainty or low liquidity.
Automated Market Makers (AMMs)
Roles and Functions:
1. Algorithmic Liquidity Provision: AMMs provide liquidity through algorithms rather than human decision-
making. They use pre-defined mathematical formulas to determine prices and facilitate trades, removing the
need for a central intermediary.
2. Decentralized Exchanges: AMMs are foundational to decentralized exchanges (DEXs) in the
cryptocurrency space. They enable peer-to-peer trading without the need for a traditional order book or
centralized authority.
3. Continuous Pricing: Prices in AMMs adjust continuously based on the ratio of assets in the liquidity pools,
ensuring that there is always a price at which trades can occur.
Economic Principles:
- Liquidity Pools: In AMMs, liquidity is provided by users who deposit pairs of assets into pools. In return,
they earn fees from trades conducted within the pool. This model democratizes liquidity provision, allowing
anyone to become a market maker.
- Constant Function Market Makers (CFMMs): AMMs like Uniswap use constant product formulas (x*y=k)
to determine prices. The product of the quantities of two assets remains constant, ensuring that prices adjust
automatically based on supply and demand within the pool
- Slippage and Price Impact: Larger trades in AMMs can cause significant slippage, as the price impact is a
function of the trade size relative to the pool size. This differs from traditional markets, where large orders
may be executed in smaller parts to minimize price impact
Comparison of Economic Principles
Implementation in Python is in the below Colab notebook.
https://colab.research.google.com/drive/1BF96MR1iTB6McObcUXypqQ1a3Jmv2v6c?usp=sharing
Link to some related meterials
https://www.lmax.com/documents/LMAXExchange-FX-TCA-Transaction-Cost-Analysis-Whitepaper.pdf
https://www.simplertrading.com/blog/slippage-in-trading
https://www.linkedin.com/pulse/tca-benchmarks-chris-sparrow-24pdc/
https://medium.com/prooftrading/building-a-lightweight-tca-tool-from-scratch-proof-edition-6fd1c716eee0
https://medium.com/@anboto_labs/introducing-is-to-our-algo-suite-1ee0b36285e9