Sgmar Indicator For MT4
The Sgmar Indicator For MT4 is a powerful oscillator tool that works on a different principle. When the curve trades below 30 lines, you should bullish reversal. On the contrary, curve trading above the 50 lines indicates bearish reversal is going to take place. To execute the trade look for the red and blue dot in the oscillator curve.
Installing the Sgmar 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 SGMAR.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 Sgmar Indicator For MT4
The Sgmar Indicator For MT4 has 3 parameters to configure.
extern int Rsi=14;
extern int Ma=8;
extern int cbars=0;
Buffers of the Sgmar Indicator For MT4
The Sgmar Indicator For MT4 provides 5 buffers.
SetIndexBuffer(0,RsiBuf);
SetIndexBuffer(1,MaP);
SetIndexBuffer(2,MaF);
SetIndexBuffer(3,Up);
SetIndexBuffer(4,Dn);
Main Parts Of The Code
int start()
{
int shift;
int counted_bars=IndicatorCounted();
if(counted_bars lt 0) return(-1);
if(counted_bars gt 0) counted_bars--;
int limit=Bars-counted_bars;
if(counted_bars==0) limit-=1+1;
for(shift=limit-1; shift gt =0; shift--)
{
RsiBuf[shift]=iRSI(NULL,0,Rsi,PRICE_CLOSE,shift);
}
for(shift=limit-1; shift gt =0; shift--)
{
// First Indicator Data
MaF[shift]=iMAOnArray(RsiBuf,0,Ma,0,MODE_SMA,shift);
// Previous Indicator Data
MaP[shift]=iMAOnArray(RsiBuf,0,Ma,0,MODE_EMA,shift);
if((MaF[shift]-MaP[shift])*(MaF[shift+1]-MaP[shift+1]) lt 0)
{
if(MaF[shift]-MaP[shift] lt 0) Up[shift]=MaP[shift];
else Dn[shift]=MaF[shift];
}
}
}
//+------------------------------------------------------------------+