Skip to content

Vergence

By Optuma Team · Updated 2017-10-19

The VERGENCE() scripting function is used to find divergence or convergence between two plots. For example, find the signal where two moving averages are considered Diverged (moving apart) for the last 3 bars.

The script to find the above example would be…

MA1 = MA(BARS=20);
MA2 = MA(BARS=50);
VERGENCE(MA1, MA2, LOOKBACK=3, TYPE=Divergence)

You can see in the above script Lines 1 and 2 set the two plots to be used in the Vergence function.

On the chart it would look like this:

Vergence1

Another example, find the signal when the ADX DM+ Line converges with the ADX DM- line for 5 consecutive days.

V1 = ADX().DMPlus ;
V2 = ADX().DMMinus ;
VERGENCE(V1, V2, TYPE=Convergence, LOOKBACK=5)

On the chart the result would look like this (highlighted in green):

Vergence2

Choose which categories of cookies you allow. Strictly-necessary cookies are always on. You can change this any time via the "Cookie Settings" link in the footer.

  • Functional

    Remember preferences like dismissed banners and your dark-mode choice.

  • Analytics

    Help us understand how the site is used so we can improve it.

  • Marketing

    Measure our advertising and help us reach people who may be interested in Optuma.