Algorithmic Trading
Table of Contents
1 Motivations
- execute throughout the day
- target a benchmark price
- a certain percent of the market volume
1.1 Manual Trading
- principal trading
- block trading
- agency trading
- portfolio trading(basket/program trading)
1.2 Automated Trading
- systematic trading: dictate points for trade entry/exit. (boundary conditions)
- quantitative trading (black-box): tracking indicators, monitoring the overall portfolio risk.
- high frequency trading
- statistical arbitrage
1.3 DMA
The client uses broker's infrastructure to send their orders directly to the exchange.
- Sponsored access allows the client to connect to the market without having to go through the broker's infrastructure.(for HFT)
- Crossing systems (dark pool) provide an electronic mechanism allowing investors to carry out their own block trading anonymously
- Aim to achieve a better price and minimising information leakage.
- The system ensures sizes (and sometimes prices) are hidden.
- The probability of execution can be much lower than on the main exchanges.
- DLA(Direct Liquidity Access): incorporate features such as liquidity aggregation, smart order routing etc.
- DSA(Direct Strategy Access): incorporate algorithmic trading.
2 Algorithms Overview
| Algorithms | Type | Focus | Dynamic | Pre-determine | Price | Volume | Key driver |
|---|---|---|---|---|---|---|---|
| TWAP | Impact-driven | Time | Y | Schedule(Time) | |||
| VWAP | Impact-driven | Volume | Y | Schedule(Volume) | |||
| Percentage Of Volume | Impact-driven | Volume | Y | often | Predetermined benchmark(Volume) | ||
| Minimal impact | Impact-driven | Impact | Y | sometimes | sometimes | ||
| Implementation Shortfall | Cost-driven | Price/Risk | Y | sometimes | sometimes | Predetermined benchmark(Price) | |
| Adaptive Shortfall | Cost-driven | Price/Risk | Y | often | sometimes | ||
| Market On Close | Cost-driven | Price/Risk | Y | sometimes | sometimes | Dynamic benchmark(Price) | |
| Price Inline | Opportunistic | Price | Y | often | sometimes | Dynamic benchmark(Price) | |
| Liquidity-driven | Opportunistic | Liquidity | Y | sometimes | sometimes | Liquidity | |
| Pair/Spread trading | Opportunistic | Ratio/Spread | Y | often | Predetermined benchmark(Ratio) |
2.1 History
- First generation 1.0: Starting with TWAP and progressing on to VWAP. VWAP reigned supreme for a long time.
- 1.5: POV bases its execution in response to the live market volume.
- 2.0: Second generation were created in response to the transaction cost analysis(TCA). Some factors: market impact, timing risk, opportunity cost.
- The difference between the market price when the investment decision was made and the actual executed price. VWAP began to be replaced by decision price as a benchmark.
- 2.0 Algorithms were more price- and cost-centric: Implementation Shortfall(IS) based algorithms. Algorithms started incorporating complex models to estimate potential transaction costs.
- Term Implementation Shortfall represents the actual costs of trading.
- 3.0 Liquidity-based Algorithms: These constantly examine the order books of differet venues to decide where best to place orders.
2.2 categories
- Schedule-driven: follow a strictly defined trading trajectory, created statically from historical data
- Opportunistic: completely dynamic, react to favourable market conditions. more aggressive when market becomes favourable
- Evaluative: middle between these two extremes
2.3 generic parameters
- start/end
- limit price
- Must-be-filled
- execution style: aggressive, passive
- volume limit: maximum, child, minimum
- auctions: flag, allow trading in the pre-trade or post-trade period
3 Cost Measurement
3.1 Using Spread
The bid offer can be attributed to a range of factors.
| Type | Measures | From |
|---|---|---|
| Quoted spread | Market quality | diff between best bid and offer price |
| Effective spread | Execution cost | diff between trade price and quote midprice when order was submitted |
| Realized spread | Trading intermediary profits | diff between trade price and quote midprice 5 mins after the trade |
Quoted Spread
- Market makers use it to compensate themselves for the fixed costs.
- Market makers use it to protect themselves from the risk of adverse selection.
Effective Spread
- Measures the actual cost our order incurred by executing in the market.
Realized Spread
- It is sometimes used as a measure of the potential profits that may be made by trading intermediaries, i.c. market makers, dealers, brokers
3.2 Using Benchmark Prices
| Type | Name |
|---|---|
| Post-Trade | Close, Future Close |
| Intraday | OHLC, TWAP, VWAP |
| Pre-Trade | Previous Close, Openning Price, Decision Price, Arrival Price |
3.3 Implicit Costs
- Timing Cost(due to price trends and timing risk): An upward trend implies that costs will increase when buying an asset.
- Delay Cost: Price change from when the decision is made and when an order is actually sent for execution.
- Impact Cost
- Temporary Effect: reflects the overall cost incurred by demanding immediacy.
- Permanent Impact: signifies the long-term information cost of the trade.
- Opportunity Cost: Orders are not always fully completed, this cost represents the missed opportunity.
4 Orders
- Basics: market order, limit order
- Hybrid Orders: market-to-limit
- Conditional Orders: stops, trailing stops
- Hidden Orders: iceberg
- Discretional Orders: pegged orders
- Routed Orders: pass-through orders
4.1 Order Options
| Type | Example Instructions |
|---|---|
| Duration | GTD(Good for the day), GTC(Good 'til cancel), GAT(Good after time/date) |
| Auction | MOO(market-on-open), LOO(Limit-on-open), MOC(market-on-close), Next-auction |
| Fill | Immediate-or-cancel(immediate liquidity access), Fill-or-kill |
| Preferencing | Preferenced, Directed |
| Routing | Do-not-route, Directed-routing, Inter-market sweeps, Flashing |
| Linking | One-cancels-other, One-triggers-other |
| Miscellaneous | Identity, Short sales, Odd lots, Settlement |
5 Impact-driven
Impact-driven algorithms aim to minimize the overall market impact. TWAP and VWAP are first generation of impact-driven algorithms, their main focus is their respective benchmarks.
- these algorithms has timing risk, particularly for volatile assets
5.1 TWAP
- predictable way
- considerable signalling risk
- the only thing other participants do not know is the total size of order
randomize
- avoid unfavourable market conditions(small best bid/offer sizes, large price jumps)
- increasing the risk of missing the TWAP benchmark
variations
5.2 VWAP
- use historical volume profiles. avgperiod/avgtotal
- condition: the day's trading volume follows a similar pattern to the historical profile
- modern VWAP determine whether they may get ahead of schedule, and how best to catch up if they are behind their target
- performance: 1. how well they track the target; 2.how well they predict market volume
variations
- vulnerable to sudden shifts, some versions may monitor current market conditions
- some variants tracks short-term price and volume trends and dynamically adjusts their target execution profile accordingly
5.3 POV(Percent of Volume)
- also called volume inline, participation, target volume or follow algorithms
- tracking a participation rate: a 20% participation rate of 100,000 total should execute 20,000
- keep in line with the observed volume
- if several POVs competing for an illiquid asset, they could drive each other on. Use limit price
- simply splits a new child order each time is predictable, try to trade more periodically or use aggressive
- sudden volume cause a sharp increase in volume, use safe guard, like comparing the target size with the currently available volume on the order book or set a max trade size.
adjust our participation rate
to account for our own trading. e.g. to track participation rate 20% for 1000 executed
- \(Participation rate = 200/(1000+200) = 16.667%\), not right
- adjustment \(1/(1-p)\). e.g \(1/(1-0.2) = 25%\) of each observed new trade
- \(Participation rate = 250/(1000+250) = 20%\)
variations
- incorporate forecasting
based on a mixture of historical volume profile, current observed volume and quantitative analytics
- price adaptive
- adjust the participation rate based on how the current market price compares to a benchmark
- some will adapt to the relative price changes for other assets, such as sector or market indices, ETFs
parameters
- participation rate
- tracking
how closely they track the target participation rate, allow a more dynamic adjustment of the participation rate
- volume filter
help prevent the algorithm needlessly chasing volume
- start/end
- must-be-filled
allow the algorithm to change its trading style when it is running out of time
- limit price
- execution style
- passive: to achieve price improvement
- aggressive: track the participation rate more closely
for illiquid assets more aggressive trading may be necessary to prevent getting behind its targets
5.4 Minimal Impact
Next logical progression from VWAP and POV algorithms. Not to track a market-driven benchmark; focused on minimising market impact
- avoid signalling risk which depends on both our order size and asset's liquidity
- use hidden order types to reduce this risk
- use dark pool: Dark pools came about primarily to facilitate block trading by institutional investors who did not wish to impact the markets with their large orders and obtain adverse prices for their trades
- may trade 80% on the dark pool(ATS) and trade the remainder using a passive VWAP or POV algorithm
variations
- estimate the probability of being filled on the ATS
- use impact cost models to forecast the overall potential cost
6 Cost-driven
Cost-driven algorithms seek to reduce the overall transaction costs, much more than just commissions and spreads. Implicit costs such as market impact and timing risk are important components of the overall cost.
- strike a balance between market impact and the overall exposure to timing risk
- early cost-driven evolved from impact-driven ones by incorporating factors such as timing risk
6.1 Implementation Shortfall(IS)
definition
represents the diff between the decision price decides to trade and the average price that is actually achieved
- benchmark: decision price
aim
to achieve an average price that minimizes the shortfall when compared with the decision price
- key: strike the right balance between market impact and timing risk
7 Opportunistic
Opportunistic algorithms take advantage whenever the market conditions are favourable