# Pair Trading Lab Algorithms & Strategies

Pair Trading Lab offers pair trading algorithms based on various mathematical models. In additional, extra trading rules are available on top of that. Mathematical models are these:

## Ratio Model

This is on of the standard pair trading models described in literature. It is based in ratio of instrument prices, moving average and standard deviation. In other words, it is based on Bollinger Bands indicator.

Model parameters:

- entry threshold for Z-score, typical value range is <1.5, 2.5>, 2.0 is used most often
- exit threshold for Z-score, typical value is <-0.5, 0.5>, 0 is used most often
- max Z-score (optional, to filter out extremes, typical value is >4 if used)
- moving average period (typical range <10, 100>), default = 15
- moving average type (algorithm), default = exponential
- standard deviation period (typical range <10, 100>), default = 15
- entry mode (simple, uptick, downtick)

(todo: detailed description)

## Residual Model

Residual mode is based on linear regression. Linear regression of both stocks is constructed in order to fit a linear relationship between both instruments and estimate its best parameters. Then, standard deviation is applied on the regression residuum to estimate its statistical properties and calculate Z-score.

Model parameters:

- entry threshold for Z-score, typical value range is <1.2, 2.5>, 1.5 is used most often
- exit threshold for Z-score, typical value is <-0.5, 0.5>, 0 is used most often
- max Z-score (optional, to filter out extremes, typical value is >4 if used)
- linear regression period (floating window is used), typical range <15, 100>, default = 15

(todo: detailed description)