Modeling
Transaction Costs
for Algorithmic Strategies
Tomas Bok tbok@post.harvard.edu
Boston Algorithmic Trading Meetup
April 24, 2013
© 2013 Tomas Bok
Tuesday, May 28, 13
Taxonomy of T-Costs
Explicit Costs
Broker Commissions
Fees & Taxes
Ticket Charges
Benchmark Slippage
Opportunity Cost
} mostly independent
of execution style
} highly dependent
on execution style
Tuesday, May 28, 13
Algorithmic Trading Stack
Smart Order Router
Exchanges, ECNs, & Dark Pools
Direct
Orders
Execution Algorithm
Investment Strategy
Parent
Orders
Child
Orders
Tuesday, May 28, 13
Benchmark Slippage
timedecision
benchmark price
}slippage
price
average realized price
Tuesday, May 28, 13
Factors that Drive Slippage
Small Orders: Large Orders:
slippage is
primarily due to
market impact
slippage is
primarily due to
spread
Price Action
affects all orders
+
luck
𝛼 decay
Tuesday, May 28, 13
Forecasting Slippage
timedecision
benchmark price
}slippage
price
average price
order size and side
execution horizon
stock-specific liquidity details
(volume, spread, volatility, ...)
price action (over trade horizon)
Typical Model Inputs
Tuesday, May 28, 13
Buy 200 DIS over 1m
(1% participation)
Buy 2,000 DIS over 1m
(10% participation)
Buy 20,000 DIS over 10m
(10% participation)
Buy 120,000 DIS over 1h
(10% participation)
0.9 bps
0.9 - 1.5 bps
2.9 bps
8.8 bps
Sample Slippage Forecasts
Buy X shares of DIS at 10:00am
Source:
ITG, Inc.
Tuesday, May 28, 13
Slippage Forecasting Methods
timedecision
benchmark price
}slippage
price
average price
Generate
point-estimate
of slippage
Method A:
Equation-Based
Generate bottom-up
slippage estimate
based on individually-
simulated fills
Method B:
Simulate Fills
Tuesday, May 28, 13
Slippage Forecasting Methods
Execution Algorithm
Investment Strategy
Parent
Orders {Method A
Simulation Scope
Child
Orders
{Method B
Simulation Scope
Parent
Orders
Execution Algorithm
Investment Strategy
Generate
point-estimate
of slippage
Method A:
Equation-Based
Generate bottom-up
slippage estimate
based on individually-
simulated fills
Method B:
Simulate Fills
Tuesday, May 28, 13
Method A: Equation-Based
Avg Price = Baseline Price +/- [ f(spread) + g(size,...) ]
Last Price
Next Price
Bid-Ask Midpoint
Baseline
Price
✓
4 bps
f(typical spread)
f(starting spread)
f(TWA spread)
Spread
Cost
✓
✓
0
g(size, horizon,
volume, volatility)
Impact
✓
Horizon Close
Horizon VWAP
Horizon TWA-Mid
✓
✓
✓
[basic f( ) = 0.5 x spread]
Tuesday, May 28, 13
Method B: Simulate Fills
1. Generate stream of child orders: { time, size }
2. Generate stream of simulated fills: { size, price }
3. Avg Price = VWAP of fills
Ability to create child orders
Tick data
Limit order model
Market order model
Impact memory function
Requirementssizei x pricei
sizei
∑i
∑i
Tuesday, May 28, 13
Defining Strategy Timescale
Strategy Holding Period
milliseconds seconds minutes hours days weeks months
Intraday
Alpha
HP = minutes to hours
Expected profit: ≤1 x spread
Alpha decay = fast
Trading concern: ‘gas pedal’
High Frequency
Trading
HP = milliseconds to minutes
Expected profit: .05 -.10 ¢
Alpha decay = immediate
Trading concern: latency
Low Frequency
Quant
HP = days to months
Expected profit: ≥1%
Alpha decay = slow
Trading concern: liquidity
Tuesday, May 28, 13
Slippage Model Selection
Low Freq
Method A (simulate parent order fills)
Use the data you have available
Be conservative
Intraday
Method B (simulate child order fills)
Bring execution algo into backtest
...or break into 2 step process
HFT
Method B+ (simulate direct order fills)
Incorporate Level 2 data
Incumbents may find it easier to live-test
Tuesday, May 28, 13
Keeping It Simple
Focusing on ‘slippage-safe’ strategies
1. Avoid strategies that are overly cost-sensitive:
intraday holding periods
expected paper PNL ≤ 2 x spread
only profitable with optimistic cost assumptions
rapid alpha decay
2. Stick to a liquid stock universe
3. Cap order sizes (≤ 25% 1-minute participation rate)
4. Assume at least a minute to execute orders
Tuesday, May 28, 13
Explicit Costs (US Equities)
Broker
Commission
Taxes & Fees
Ticket Charges
TOTAL (1-way)
.05 - .20 cents
+ net fees (.06¢)
0.5 - 1.0 cents
~.05 cents included
NA $1+ (or NA)
.15 - .30 cents 1 cent + tickets
Low FreqIntradayHFT
Tuesday, May 28, 13
Opportunity Cost
timedecision
price
price limit
}+25 bps
Opportunity cost: effect of unexecuted shares on PNL
If you plan to trade with price limits or conditional
execution strategies, backtest accordingly
Tuesday, May 28, 13
Golden Rules
1. Think about transaction costs early and often
2. A simple cost framework is fine as long as you make
conservative assumptions and “stay on the path”
3. To run more cost-sensitive strategies, be prepared to
invest in a more sophisticated t-cost framework
4. Account for all three kinds of transaction costs
5. Backtest at full scale
Tuesday, May 28, 13
Image credits
Slides 3, 9: rack servers from dell.com; order tickets from
www.silexx.com
Slide 5: supermarket scale from www.racoindustries.com
© 2013 Tomas Bok
tbok@post.harvard.edu
Tuesday, May 28, 13

Modeling Transaction Costs for Algorithmic Strategies

  • 1.
    Modeling Transaction Costs for AlgorithmicStrategies Tomas Bok tbok@post.harvard.edu Boston Algorithmic Trading Meetup April 24, 2013 © 2013 Tomas Bok Tuesday, May 28, 13
  • 2.
    Taxonomy of T-Costs ExplicitCosts Broker Commissions Fees & Taxes Ticket Charges Benchmark Slippage Opportunity Cost } mostly independent of execution style } highly dependent on execution style Tuesday, May 28, 13
  • 3.
    Algorithmic Trading Stack SmartOrder Router Exchanges, ECNs, & Dark Pools Direct Orders Execution Algorithm Investment Strategy Parent Orders Child Orders Tuesday, May 28, 13
  • 4.
  • 5.
    Factors that DriveSlippage Small Orders: Large Orders: slippage is primarily due to market impact slippage is primarily due to spread Price Action affects all orders + luck 𝛼 decay Tuesday, May 28, 13
  • 6.
    Forecasting Slippage timedecision benchmark price }slippage price averageprice order size and side execution horizon stock-specific liquidity details (volume, spread, volatility, ...) price action (over trade horizon) Typical Model Inputs Tuesday, May 28, 13
  • 7.
    Buy 200 DISover 1m (1% participation) Buy 2,000 DIS over 1m (10% participation) Buy 20,000 DIS over 10m (10% participation) Buy 120,000 DIS over 1h (10% participation) 0.9 bps 0.9 - 1.5 bps 2.9 bps 8.8 bps Sample Slippage Forecasts Buy X shares of DIS at 10:00am Source: ITG, Inc. Tuesday, May 28, 13
  • 8.
    Slippage Forecasting Methods timedecision benchmarkprice }slippage price average price Generate point-estimate of slippage Method A: Equation-Based Generate bottom-up slippage estimate based on individually- simulated fills Method B: Simulate Fills Tuesday, May 28, 13
  • 9.
    Slippage Forecasting Methods ExecutionAlgorithm Investment Strategy Parent Orders {Method A Simulation Scope Child Orders {Method B Simulation Scope Parent Orders Execution Algorithm Investment Strategy Generate point-estimate of slippage Method A: Equation-Based Generate bottom-up slippage estimate based on individually- simulated fills Method B: Simulate Fills Tuesday, May 28, 13
  • 10.
    Method A: Equation-Based AvgPrice = Baseline Price +/- [ f(spread) + g(size,...) ] Last Price Next Price Bid-Ask Midpoint Baseline Price ✓ 4 bps f(typical spread) f(starting spread) f(TWA spread) Spread Cost ✓ ✓ 0 g(size, horizon, volume, volatility) Impact ✓ Horizon Close Horizon VWAP Horizon TWA-Mid ✓ ✓ ✓ [basic f( ) = 0.5 x spread] Tuesday, May 28, 13
  • 11.
    Method B: SimulateFills 1. Generate stream of child orders: { time, size } 2. Generate stream of simulated fills: { size, price } 3. Avg Price = VWAP of fills Ability to create child orders Tick data Limit order model Market order model Impact memory function Requirementssizei x pricei sizei ∑i ∑i Tuesday, May 28, 13
  • 12.
    Defining Strategy Timescale StrategyHolding Period milliseconds seconds minutes hours days weeks months Intraday Alpha HP = minutes to hours Expected profit: ≤1 x spread Alpha decay = fast Trading concern: ‘gas pedal’ High Frequency Trading HP = milliseconds to minutes Expected profit: .05 -.10 ¢ Alpha decay = immediate Trading concern: latency Low Frequency Quant HP = days to months Expected profit: ≥1% Alpha decay = slow Trading concern: liquidity Tuesday, May 28, 13
  • 13.
    Slippage Model Selection LowFreq Method A (simulate parent order fills) Use the data you have available Be conservative Intraday Method B (simulate child order fills) Bring execution algo into backtest ...or break into 2 step process HFT Method B+ (simulate direct order fills) Incorporate Level 2 data Incumbents may find it easier to live-test Tuesday, May 28, 13
  • 14.
    Keeping It Simple Focusingon ‘slippage-safe’ strategies 1. Avoid strategies that are overly cost-sensitive: intraday holding periods expected paper PNL ≤ 2 x spread only profitable with optimistic cost assumptions rapid alpha decay 2. Stick to a liquid stock universe 3. Cap order sizes (≤ 25% 1-minute participation rate) 4. Assume at least a minute to execute orders Tuesday, May 28, 13
  • 15.
    Explicit Costs (USEquities) Broker Commission Taxes & Fees Ticket Charges TOTAL (1-way) .05 - .20 cents + net fees (.06¢) 0.5 - 1.0 cents ~.05 cents included NA $1+ (or NA) .15 - .30 cents 1 cent + tickets Low FreqIntradayHFT Tuesday, May 28, 13
  • 16.
    Opportunity Cost timedecision price price limit }+25bps Opportunity cost: effect of unexecuted shares on PNL If you plan to trade with price limits or conditional execution strategies, backtest accordingly Tuesday, May 28, 13
  • 17.
    Golden Rules 1. Thinkabout transaction costs early and often 2. A simple cost framework is fine as long as you make conservative assumptions and “stay on the path” 3. To run more cost-sensitive strategies, be prepared to invest in a more sophisticated t-cost framework 4. Account for all three kinds of transaction costs 5. Backtest at full scale Tuesday, May 28, 13
  • 18.
    Image credits Slides 3,9: rack servers from dell.com; order tickets from www.silexx.com Slide 5: supermarket scale from www.racoindustries.com © 2013 Tomas Bok tbok@post.harvard.edu Tuesday, May 28, 13