Slippage Decomposition¶
Specification¶
An order's execution slippage is defined as:
where
Let's split the whole order duration into N equal time periods and introduce the following notations:
- P_{m,i}: the market average price in period i
- V_{m,i}: the market volume traded in period i
- P_{o,i}: the order average execution price in period i
- V_{o,i}: the order quantity executed in period i
With above notation, we have
where \rho_{m,i} = \frac{V_{m,i}}{\sum_{i=1}^{N} V_{m,i}}, i.e. the proportion of market volume traded in period i. By the same token, we have
where \rho_{o,i} = \frac{V_{o,i}}{\sum_{i=1}^{N} V_{o,i}}, i.e. the proportion of order quantity traded in period i.
Let's introduce one more notation for the predicted volume profile \hat{\rho}_{o,i}. So we can rewrite the numerator of the slippage definition as:
In this way, the performance slippage is decomposed into three components:
- \sum_{i=1}^{N} (P_{m,i} - P_{o,i}) \cdot \rho_{m,i} is the price component, which indicates how much an order's execution price deviates from market price, i.e. how much spread is captured by the order.
- \sum_{i=1}^{N} P_{o,i} \cdot (\rho_{m,i} - \hat{\rho}_{o,i}) is the tolerance component, which indicates the cost paid due to how closely the order follows the target volume profile.
- \sum_{i=1}^{N} P_{o,i} \cdot (\hat{\rho}_{o,i} - \rho_{o,i}) is the profile component, which indicates the slippage due to difference between the estimated volume profile and realized volume profile from the market.
Implementation¶
API¶
decomposeSlippage[executions;trades;profile;params]
-
executions
: a table of order executions with the following columns:time
: the time when each execution is transactedquantity
: the executed shares of each executionprice
: the price of each executionflag
: a symbol with value`open
,`continuous
or`close
-
trades
: a table of market trades with the following columns:time
: the time when each market print is transactedvolume
: the executed shares of each market printprice
: the price of each market printflag
: a symbol with value`open
,`continuous
or`close
-
profile
: a table of minute bar volume profile with the following columns:time
: the start time of minute barpercent
: the volume percent for a given minuteflag
: a symbol with value`open
,`continuous
or`close
The volume profile must be a full-day volume profile with volume percent for both open and close auction. The
time
for open auction is the start time of continuous trading session and thetime
for close auction is the end time of continuous trading session. -
params
: a dictionary of parameters with the following keys:startTime
: the order start timeendTime
: the order end timeincludeOpen
: a boolean indicating whether participation in open is enabledincludeClose
: a boolean indicating whether participation in close is enabled