4MAs Trend Indicator For MT4
The 4MAs Trend Indicator For MT4 allows you to know about the strength of the market trend. When you spot green bars in the histogram, expect the bulls to gain strength. On the contrary, when the bars are in red color, short the pairs. But when you spot yellow color bars, expect a ranging market.
Installing the 4MAs Trend 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 4MAs_Trend.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 4MAs Trend Indicator For MT4
The 4MAs Trend Indicator For MT4 has 9 parameters to configure.
extern int Minutes=60;
extern int MA1_Value=5;
extern int MA1_Mode=0;
extern int MA2_Value=13;
extern int MA2_Mode=0;
extern int MA3_Value=34;
extern int MA3_Mode=3;
extern int MA4_Value=55;
extern int MA4_Mode=3;
Buffers of the 4MAs Trend Indicator For MT4
The 4MAs Trend Indicator For MT4 provides 3 buffers.
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexBuffer(2,ExtMapBuffer3);
Main Parts Of The Code
int start()
{
int counted_bars=IndicatorCounted();
//----
for(int i=0; i lt 300; i++){
ExtMapBuffer1[i]=0;
ExtMapBuffer2[i]=0;
ExtMapBuffer3[i]=0;
//----
MA1=iMA(NULL,Minutes,MA1_Value,0,MA1_Mode,PRICE_CLOSE,i);
MA2=iMA(NULL,Minutes,MA2_Value,0,MA2_Mode,PRICE_CLOSE,i);
MA3=iMA(NULL,Minutes,MA3_Value,0,MA3_Mode,PRICE_CLOSE,i);
MA4=iMA(NULL,Minutes,MA4_Value,0,MA4_Mode,PRICE_CLOSE,i);
//----
if(MA1 gt MA2 && MA2 gt MA3 && MA3 gt MA4 )ExtMapBuffer2[i]=1;
if(MA1 lt MA2 && MA2 lt MA3 && MA3 lt MA4 )ExtMapBuffer1[i]=1;
if(ExtMapBuffer1[i]==0 && ExtMapBuffer2[i]==0) {ExtMapBuffer3[i]=1;}
}
//----
return(0);
}
//+------------------------------------------------------------------+