# timingRisk

Estimate uncertainty of market impact cost

## Syntax

``tr = timingRisk(k,trade)``

## Description

example

````tr = timingRisk(k,trade)` returns the uncertainty of the market impact cost estimate, or timing risk. `timingRisk` uses the Kissell Research Group (KRG) transaction cost analysis object `k` and trade data `trade`.```

## Examples

collapse all

Retrieve the market impact data from the KRG FTP site. Connect to the FTP site using the `ftp` function with a user name and password. Navigate to the `MI_Parameters` folder and retrieve the market impact data in the `MI_Encrypted_Parameters.csv` file. `miData` contains the encrypted market impact date, code, and parameters.

```f = ftp('ftp.kissellresearch.com','username','pwd'); mget(f,'MI_Encrypted_Parameters.csv'); miData = readtable('MI_Encrypted_Parameters.csv','delimiter', ... ',','ReadRowNames',false,'ReadVariableNames',true);```

Create a Kissell Research Group transaction cost analysis object `k`.

`k = krg(miData);`

Load the example data from the file `KRGExampleData.mat`, which is included with the Trading Toolbox™.

`load KRGExampleData`

The variable `TradeData` appears in the MATLAB® workspace.

`TradeData` contains these variables:

• Stock symbol

• Side

• Number of shares

• Size

• Stock price

• Average daily volume

• Volatility

• Percentage of volume

For a description of the example data, see Kissell Research Group Data Sets.

Estimate timing risk `tr` for each stock using the Kissell Research Group transaction cost analysis object `k`. Display the first three timing risk values.

```tr = timingRisk(k,TradeData); tr(1:3)```
```ans = 159.05 242.37 62.88```

Timing risk trading costs display in basis points.

## Input Arguments

collapse all

Transaction cost analysis, specified as a KRG object created using `krg`.

Trade data that describes the stocks in the transaction, specified as a table or structure. `trade` must contain these variable or field names.

Variable or Field NameDescription

`Symbol`

Stock symbol

`Side`

`Shares`

Number of shares in the transaction

`Size`

Shares in the transaction, which is a percentage of average daily trading volume

`Price`

Stock price

`ADV`

Average daily volume

`Volatility`

Volatility

`POV`

Percentage of volume

The trading cost varies with the trade strategy. `timingRisk` determines the trade strategy using these variables in this order:

1. Percentage of volume

To change the trade strategy from percentage of volume to trade time, remove the variable `POV` in the table and add the variable `TradeTime` with trade time data. To use the trade schedule strategy, remove the variable `TradeTime` and add the `TradeSchedule` and `VolumeProfile` variables.

If you specify size in the trade data, `timingRisk` uses the `Size` variable. Otherwise, `timingRisk` uses the variables `ADV` and `Shares` to determine the size.

For example, to create trade data as a table, enter:

```trade = table({'XYZ'},{'Buy'},9300,0.06,29.68,860000,0.27,0.17,... 'VariableNames',{'Symbol' 'Side' 'Shares' 'Size' 'Price' ... 'ADV' 'Volatility' 'POV'})```

To create trade data as a structure, enter:

```trade.Symbol = {'XYZ'}; trade.Side = {'Buy'}; trade.Shares = 9300; trade.Size = 0.06; trade.Price = 29.68; trade.ADV = 860000; trade.Volatility = 0.27; trade.POV = 0.17; ```

These examples do not represent real market data.

Data Types: `struct` | `table`

## Output Arguments

collapse all

Timing risk, returned as a vector. The vector values correspond to the timing risk in basis points for each stock in `trade`.

collapse all

### Timing Risk

Timing risk (TR) estimates the uncertainty surrounding the estimated transaction cost.

Price volatility and liquidity risk creates uncertainty. Price volatility causes the price to be either higher or lower than expected due to factors independent of the order. Liquidity risk causes the market impact cost to be either higher or lower than estimated due to market volumes. TR is dependent upon volumes, intraday trading patterns, and market impact resulting from other market participants. The TR model is

`$\text{TR}=\sigma \cdot \sqrt{\frac{1}{3}\cdot \frac{1}{250}\cdot \frac{Shares}{ADV}\cdot \left(\frac{1-POV}{POV}\right)}\cdot {10}^{4}.$`

$\sigma$ is price volatility. 250 is the number of trading days in the year. Shares are the number of shares to trade. ADV is the average daily volume of the stock. POV is the percentage of market volume, or participation fraction, of the order.

## Tips

• For details about the formula and calculations, contact the Kissell Research Group.

## References

[1] Kissell, Robert. “A Practical Framework for Transaction Cost Analysis.” Journal of Trading. Vol. 3, Number 2, Summer 2008, pp. 29–37.

[2] Kissell, Robert. “Algorithmic Trading Strategies.” Ph.D. Thesis. Fordham University, May 2006.

[3] Kissell, Robert. “TCA in the Investment Process: An Overview.” Journal of Index Investing. Vol. 2, Number 1, Summer 2011, pp. 60–64.

[4] Kissell, Robert. The Science of Algorithmic Trading and Portfolio Management. Cambridge, MA: Elsevier/Academic Press, 2013.

[5] Glantz, Morton, and Robert Kissell. Multi-Asset Risk Modeling. Cambridge, MA: Elsevier/Academic Press, 2013.

[6] Kissell, Robert, and Morton Glantz. Optimal Trading Strategies. New York, NY: AMACOM, Inc., 2003.

Introduced in R2016a