Full Transcript

# Algorithmic Trading and Order Execution ## What is this session about? * Algorithmic trading * Electronic order books * Market impact * Optimal execution ## Orders ### Types of order * Market order - execute immediately at best price * Limit order - execute only at a specified pri...

# Algorithmic Trading and Order Execution ## What is this session about? * Algorithmic trading * Electronic order books * Market impact * Optimal execution ## Orders ### Types of order * Market order - execute immediately at best price * Limit order - execute only at a specified price or better * Stop order - execute when a specified price is reached * Hidden order - only a portion of the order is displayed ### Order book * A list of all outstanding orders for a particular asset * Orders are typically displayed with price and size * The order book provides valuable information about the supply and demand for an asset ## Algorithmic Trading ### What is algorithmic trading? * Using computer programs to automate trading decisions * Executing orders based on pre-defined rules * Also known as automated trading, black-box trading, or algo-trading ### Why use algorithmic trading? * Increased speed and efficiency * Reduced transaction costs * Improved order execution * Ability to backtest trading strategies ### Types of algorithmic trading strategies * **Trend following:** Identify and capitalize on trends in the market * **Mean reversion:** Exploit deviations from the average price * **Arbitrage:** Profit from price differences in different markets * **Market making:** Provide liquidity by placing buy and sell orders * **Execution algorithms:** Optimize order execution to minimize market impact ## Electronic Order Books ### What is an electronic order book? * A digital record of all outstanding buy and sell orders for a particular asset * Orders are displayed with price and size * The order book is constantly updated as orders are placed, cancelled, and executed ### Order book dynamics * The order book reflects the current supply and demand for an asset * Changes in the order book can provide valuable information about market sentiment * Order book dynamics can be complex and difficult to predict ### Order book example Here is an example of an order book for a hypothetical asset: | Price | Size | Order Type | | -------- | ----- | ---------- | | **Buy** | | | | 100.00 | 100 | Limit | | 99.99 | 50 | Limit | | 99.98 | 25 | Limit | | **Sell** | | | | 100.01 | 75 | Limit | | 100.02 | 125 | Limit | | 100.03 | 200 | Limit | ### Order book visualization The image shows a live order book. Volume (size) is on the x-axis and price on the y-axis. The 'bids' or offers to buy typically appears on the left, and the 'asks' or offers to sell appear on the right. The current best bid and ask prices are highlighted. The difference between these is the bid-ask spread. The steepness of the curve indicates the liquidity of the market at different price levels. ## Market Impact ### What is market impact? * The effect of a trade on the price of an asset - e.g., when the execution of your order causes the market prices to move. * Large orders can have a significant market impact * Market impact can reduce profitability ### Factors affecting market impact * Order size * Market liquidity * Order execution strategy * Market volatility ### Measuring market impact * **Price slippage:** The difference between the expected price and the actual price * **Volume-weighted average price (VWAP):** The average price of an asset weighted by the volume traded at each price $$ VWAP = \frac{\sum_{i=1}^{n} P_i * V_i}{\sum_{i=1}^{n} V_i} $$ Where: * $P_i$ = Price of the trade i * $V_i$ = Volume of the trade i * $n$ = Number of trades * **Implementation shortfall:** The difference between the actual return of a trading strategy and the expected return ## Optimal Execution ### What is optimal execution? * Executing orders in a way that minimizes market impact and transaction costs * Finding the right balance between speed and price ### Optimal execution strategies * **VWAP:** Execute orders over a period of time to match the volume-weighted average price * **TWAP:** Execute orders over a period of time to match the time-weighted average price * **Percentage of volume (POV):** Execute orders as a percentage of the total market volume * **Smart order routing:** Route orders to different exchanges or market centers to find the best price and liquidity ### Factors to consider when choosing an optimal execution strategy * Order size * Market liquidity * Market volatility * Trading horizon * Risk tolerance ### Optimal execution example The image illustrates an optimal execution strategy. The upper chart displays the actual traded price compared to VWAP across a period of time. The lower chart displays the corresponding volume traded across that period of time. An optimal execution strategy typically seeks to align the actual traded price close to VWAP, thereby reducing market impact.