Download MetaTrader 5

Indicators: Moving Averages Convergence/Divergence Blau_MACD

To add comments, please log in or register

Moving Averages Convergence/Divergence Indicator Blau_MACD:

The Moving Averages Convergence/Divergence Indicator by William Blau is described in the book Momentum, Direction, and Divergence: Applying the Latest Momentum Indicators for Technical Analysis".

The Moving Average Convergence/Divergence (MACD) technical Indicator is the difference between two exponentially smoothed moving averages (EMA) (fast EMA has period s and slow EMA has period r).

The sign of MACD indicates the relative position of fast s-period EMA and slow r-period EMA. It's positive when EMA(s)>EMA(r) and negative if EMA(s)<EMA(r). The increase of the |MACD| (absolute value) indicates the divergence of moving averages, the decrease of of the |MACD| indicated the convergence of EMAs.

Author: Andrey N. Bolkonsky

Moving Averages Convergence/Divergence by William Blau.


Hi Andrey,

First of all, thanks for your efforts with the MT5 indicators.

I have a question on the "Price_Weighted" calculation. I'm just a novice coder so this may have an easy answer.

The Price Constants for MT5 shows:

PRICE_WEIGHTED: Average price, (high + low + close + close)/4

This code shows 4 variables divided by 4.

Your MACD Blau Diverg indicator shows:

case PRICE_WEIGHTED: Price[i]=(High[i]+Low[i]+Close[i]+Close[i]+Close[i])/4.0; break;

This code shows 5 variables divided by 4...?? 

Which is the correct Price_Weighted code?

Secondly, which buffers, if any, shows the Troughs and Peaks and can you draw the divergence lines that show these?

Again, thanks for your efforts and for all your help,


To add comments, please log in or register