Custom Formula Collection

Divergence between the Close and an Indicator

The following formula will calculate the correlation of the Close and the MACD. It is written using a "long form" MACD so that the time periods used by the MACD may be changed. This indicator shows "divergence" between the close and the indicator:

In the Windows versions of MetaStock the formula is:


The interpretation of the indicator output is as follows:

  • - .08 (80%) and lower is divergence between the Close and the MACD.
  • - 1 is very strong divergence.
  • + 1 is very strong correlation.

The formula was constructed this way so that most other indicators may be used in place of the MACD. For example here is the same indicator using the RSI(14):


For additional help with formulas, please see the Formula Primer.

Can't find the custom formula you need? MetaStock can create formulas for you.