3 line MACD Indicator For MT4
The 3 line MACD Indicator For MT4 adds a smoothing curve to the conventional Moving Average Convergence Divergence (MACD). This curve (Red) fluctuates above/below a zero line. Readings above zero signal the presence of a bullish trend, while values below zero point to the predominance of sellers.
Installing the 3 line MACD Indicator For MT4
After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file MACD3OsMA.mq4 into the folder MQL4\Indicators of your MT4 installation. After that please restart MT4 and then you will be able to see the indicator in the list of indicators.
Parameters of the 3 line MACD Indicator For MT4
The 3 line MACD Indicator For MT4 has 3 parameters to configure.
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
Buffers of the 3 line MACD Indicator For MT4
The 3 line MACD Indicator For MT4 provides 1 buffers.
if(!SetIndexBuffer(0,ind_buffer1) && !SetIndexBuffer(1,ind_buffer2) && !SetIndexBuffer(2,ind_buffer3))
Main Parts Of The Code
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars lt 0) return(-1);
//---- last counted bar will be recounted
if(counted_bars gt 0) counted_bars--;
limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
for(int i=0; i lt limit; i++)
ind_buffer1[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
//---- signal line counted in the 2-nd buffer
for(i=0; i lt limit; i++)
ind_buffer2[i]=iMAOnArray(ind_buffer1,Bars,SignalSMA,0,MODE_SMA,i);
for(i=0; i lt limit; i++)
ind_buffer3[i]=iOsMA(NULL,0,FastEMA,SlowEMA,SignalSMA,PRICE_CLOSE,i);
//---- done
return(0);
}
//+------------------------------------------------------------------+