42. Measuring Implementation Shortfall

Published at 1662445262.061926

To test if the trading algorithm works well in real trading, we need to compare the paper trading results and the actual trading results. Algorithmic traders can start by measuring and analyzing the reasons for any differences. They should fix problems that might happen during trade execution. A commonly used analytical method is to use implementation shortfall.

Formula

The implementation shortfall (IS) measures how much the paper profit differs from the actual return. We can use the following formula:

Paper return is the theoretical profit if we could fill all our orders at the desired price and volume without incurring any costs. The formula is:

Where:

–   S is the total volume of open positions, S > 0 in the case of opening a long position, while S < 0 for a short position;

–   Pd is the price when we decide to open a position;

–   Pn is the current price.

The actual return is what we really earned based on executed trades. We can use this formula:

Where:

–   sj is the matched volume in the transaction j;

–   pj is the matched price in transaction j;

–   Fees are transaction fees and applicable taxes.

Combining the above formulas, we get:

IS is decomposed into three components, explaining the three reasons for the discrepancy:

  • Price slippage: the price may change and may not match our plan from the decision-making moment to the time of placing an order.

  • Opportunity cost: matching volume is not enough compared to our plan;

  • Fees: transaction fees and taxes.

Price slippage can be further decomposed into two more components: delay costs and transaction costs.

Where P0 is the stock price at the time of placing the order.

  • Delay cost: when an order cannot be placed immediately after the decision is made, it results in a price change from the decision-making moment to the time of order placing.

  • Transaction cost: depending on market liquidity, order type (limit order, market order, etc.), or system errors may result in orders being matched at different prices.

Example of Implementation Shortfall

Assume that at 09:15, the share price of VINGROUP (HOSE: VIC) is 60,000 VND per share, and we decide to buy 10,000 VIC shares.

At 09:20, the system starts to place orders. At this moment, the stock price has gone up to 60,100 VND.

At the end of the day, the closing price of VIC is 60,800 VND.

By the end of the trading day, we can only buy 8,000 shares and pay an average fee and tax of 200 VND per share

Below is the detailed matching orders:

 

Implementation shortfall is as follows:

Delay cost = 8.000 × 60.100 − 8.000 × 60.000 = 800.000

Transaction cost = 482.500.000 − 8.000 × 60.100 = 1.700.000

Opportunity cost = (10.000 − 8.000) × (60.800 −  60.000) =1.600.000

Fees and taxes = 8.000 × 200 = 1.600.000

Implementation shortfall = 800.000 + 1.700.000 + 1.600.000 + 1.600.000 = 5.700.000

Implementation shortfall is not always bad. In many cases, they can help us trade at a better price, or trade less and avoid a big loss when there’s a delay in trade execution.

However, algorithmic traders should be fully aware of the implementation shortfall and need to measure and evaluate the causes and implement reasonable solutions to ensure the costs don’t get out of control. For example, we can reduce the delay costs by placing orders faster after we decide to trade. An algorithmic trading system can optimize this to under 60 milliseconds.

In the case of high-volume trading on a market with low liquidity, implementation shortfall would be the top priority. In this situation, we can consider execution algorithms like VWAP and TWAP.