Simple MA over Price Indicator For MT4
The Simple MA over Price Indicator For MT4 plots a 3-period Simple Moving Average (Red) and a 25-period Simple Moving Average (Gold) on a single indicator pane below the price chart. Crossovers between the two moving averages can generate buy and sell signals. However, during range bound market conditions, such crossovers can lead to a lot of false trades and should ideally be confirmed by other technical analysis tools.
Installing the Simple MA over Price 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 mnl_price.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 Simple MA over Price Indicator For MT4
The Simple MA over Price Indicator For MT4 has 3 parameters to configure.
extern int Alpha=3;
extern int MAPeriodeFast=3;
extern int MAPeriode=25;
Buffers of the Simple MA over Price Indicator For MT4
The Simple MA over Price Indicator For MT4 provides 3 buffers.
SetIndexBuffer(0,ExtMapBuffer2);
SetIndexBuffer(1,ExtMapBuffer3);
SetIndexBuffer(2,ExtMapBuffer1);
Main Parts Of The Code
int start()
{
double v0=0;double v1=0;
double a1;
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars lt 0) return(-1);
if(counted_bars gt 0) counted_bars--;
limit=Bars-counted_bars;
for(int i=0; i lt limit; i++)
{
v0=Close[i];
v1=Close[i+Alpha];
if (v0 gt 0&&v1 gt 0)
{
a1=(v0/(v1/100));
ExtMapBuffer1[i]=(a1-100);
}
}
for(int z=0; z lt limit; z++)
{
ExtMapBuffer2[z]=iMAOnArray(ExtMapBuffer1,0,MAPeriodeFast,0,MODE_SMA,z) ;
}
for(z=0; z lt limit; z++)
{
ExtMapBuffer3[z]=iMAOnArray(ExtMapBuffer1,0,MAPeriode,0,MODE_EMA,z) ;
}
return(0);
}
//+------------------------------------------------------------------+