TWAP Algorithm
- 03:25
The core idea behind the time weighted average price and the basic mechanism of a TWAP algormith.
Downloads
No associated resources to download.
Transcript
At its core, the TWAP is the average price of a security over a specified time. It is calculated by summing up the prices of the asset observed at multiple points across a set period and dividing the sum by the total number of observation points. So if you're looking to calculate the TWAP of a two hour period, which is sliced into 15 minute intervals, you sum up the 8 observed prices and divide by the sum of 8. This is a straightforward, simple approach, which reflects how the market price of an asset has changed over a specific time period, and it is this simplicity that makes TWAP generally quite appealing.
TWAP execution algorithms aim to execute orders close to the TWAP over a given period at regular intervals. They're often used for large orders to minimize market impact and ensure even execution over time. The basic mechanism works as follows. The first step is the determination of the order size. For example, how many shares should be bought or sold in total. Second, the total duration is set, the total period over which the order should be executed. The third step is the specification of the regular interval, how much time there should be between the different observation points.
The algorithm then slices the total order into smaller, equal sized chunks that will be executed at regular intervals over the set duration.
Let's say you aim to purchase 10,000 XYZ shares using a TWAP algorithm or algo with a two hour time window and 15 minute intervals, your order would be divided into chunks of 1,250 shares, one of which will be executed at the end of each 15 minutes period. While the TWAP algorithm is an easy to understand method to execute large orders while minimizing market impact and ensuring even execution over time, it does have some potential drawbacks. TWAP algorithms, when executing large orders at regular intervals can become predictable and reveal traders' intentions before the order has been executed in full. This is referred to as signaling risk, or in other words, information leakage. If other market participants detect a recurring pattern such as a trader consistently buying large quantities of a stock every hour on the hour using twap, they might anticipate the next buy order and purchase the stock just before driving up the price and then selling it at the higher price to the TWAP trader, profiting from the predictability. In addition, the unwavering commitment to a set timeframe can result in less than ideal results, especially if liquidity unexpectedly diminishes during a predetermined buy or sell interval, or if the asset's price shifts unfavorably.
To address these considerations, modern TWAP algorithm come with tweaks. They introduce an element of randomization, of order sizes and execution times to avoid predictability, and they allow price constraints so that no buying or selling occurs beyond desired price levels.