Stochastic Divergence (StDiv)

Philosophy

This study attempts to redefine divergence by allowing flexibility in the established mantras associated with the subject. The traditional interpretation is that if price is going in one direction and the momentum indicator in the opposite direction, divergence is occurring and suggests that the trend is ending. The reality is of this basic theory is that all but the strongest trends will diverge and often give false exit signals to trend following trades and false reversal signals against the trend.

The increased flexibility derives from the ability to not only look for divergence on the indicator itself, but replace this with a moving average of the indicator in or order to smooth out and reduce the number of turning points. The traditional mantra looks at absolute highs and lows of price to define divergence but this study enables the trader to select what price should be used to qualify. This means if for example the relationship of the close instead of high and lows is used, it reveals the ability to quantify divergence in sideways markets in order to produce and early warning to a break out and new trend. This is referenced as divergence as a continuation. This use of different momentum indicators and variables of them to create divergence enables the trader to define how aggressive or conservative they wish there signals to be.

Interpretation

Each momentum indicator used for divergence has different characteristics and therefore different trading opportunities. Slow Stochastic is a rather sensitive indicator in its original default setting in that has a close correlation with the price action of the market itself, especially in its relationship to the close to the high or low of the bar. The default settings interpret divergence by isolating a change in direction of the Stochastic %K or effectively the moving average of Stochastic %K, which is by default the Stochastic %D. At that moment the value of the study itself and the default value of the bar is recorded. Divergence is qualified when they move in opposite directions on a certain number of consecutive occasions. A positive divergence is revealed by a red line recording a value of one and a blue line a negative signal. This highlights how the raw code is primarily of use as an exit tool to existing trend following trades. However, the building of code within the formula tool box enables traders to increase the accuracy of divergence qualification by focusing on the absolute value of the Studies or |bar values and creating more exact threshold parameters.

StDiv Parameters

Name

Default

Definition

N

1

Number of divergence patterns that are needed to produce a signal. Most only need 1 and will not produce signals if increased.

Period

5

Qualifies a propriety area within which signals do not have to be symmetrical.

MA Period

1

This second period refers to the variable of the moving average and therefore what is normally regarded as the Stochastic %d value . Setting it to a number beyond 1 means that the average is being used as the divergence tool and not the original indicator.

Lookback

25

Qualifies the lookback period for when divergence can occur within. Increasing the number will normally increase the number of divergence signals and for slow moving indicators should be raised from the default.

ob

70

These reflect the fact that the study has a limit of scale, so the use of setting an overbought and oversold threshold acts as reset point where the current divergence process ends. Setting at 100 and 0 means no reset can occur.

os

30

These reflect the fact that the study has a limit of scale, so the use of setting an overbought and oversold threshold acts as reset point where the current divergence process ends. Setting at 100 and 0 means no reset can occur.

MA Type

Moving average calculation.

MA Type:

      Simple

      Smoothed

      Exponential

      Weighted

      Centered

      Median

      Trix

      Exponential Hull

Qualifies the type of moving average to be used. Should be set to smoothed if trying to be unformed with the Stochastic %K.

StDivDn

High

Qualifies the relationship within the change in direction of the indicator and the subsequent bar value to be recorded at that point.

StDivUp

Low

Qualifies the relationship within the change in direction of the indicator and the subsequent bar value to be recorded at that point.

Period S STO

10

STO Period of Stochastic.

Period S STO %K

3

STO %K Period of Stochastic.