RegressionDivergenceStrat

Description

The Regression Divergence strategy is an intermarket correlation trading system developed by Markos Katsanos. It is based on Mr. Katsanos's technical indicator Regression Divergence and takes its approach even further: instead of two securities statistically analyzed by the indicator, the strategy takes into account three. The Regression Divergence is found between the prices of the current and the secondary symbol while also analyzing the correlation between rates of changes of the current and the tertiary symbol. This approach shows how well two symbols are correlated and how closely the current symbol follows the dynamic of the correlation.

The strategy adds simulated buy and sell orders based on the following conditions:

- Buy to open. The regression divergence rises above the critical level (set by default to 75) and then promptly reverses its direction while the correlation between the current and the tertiary symbols is below the correlation reference level (which defaults to 0.8). By default, the regression divergence needs to reverse over the next three bars for the signal to be triggered.

- Sell to open. The regression divergence falls below the critical level and then promptly (over the next three bars, by default) reverses its direction while the correlation between the current and the tertiary symbols is below the correlation reference level.

- Exits (both buy and sell). The maximum number of bars is reached since the entry; by default, this number is set to 11.

Input Parameters

Parameter

Description

symbol2

Defines the symbol to calculate the divergence with.

symbol3

Defines the symbol to find the ROC correlation with.

length

Defines the regression length.

roc length

Defines the period over which the rates of change are calculated.

divergence length

Defines the period over which the divergence is calculated.

divergence momentum length

Defines the time offset (in bars) for the calculation of the forecast price.

exit length

The number of bars between the entry and the exit.

lag

Defines the number of bars within which the divergence reversal should happen.

divergence critical level

Defines the reference level of divergence between the current and the secondary symbol. 

corr3level

Defines the reference level of correlation between the current and the tertiary symbol.

Further Reading

1. "Trading The Nikkei" by Markos Katsanos. Technical Analysis of Stocks & Commodities, July 2017.