SHI_SilverTrendSig Indicator For MT4
The SHI_SilverTrendSig Indicator For MT4 gives buy and sell signals based on small red and blue dots. The blue dot is usually formed at the top of an uptrend and the red dot is formed at the bottom of the downtrend. Using these dots with the dynamic support and resistance can greatly improve your trade execution process.
Installing the SHI_SilverTrendSig 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 SHI_SilverTrendSig.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 SHI_SilverTrendSig Indicator For MT4
The SHI_SilverTrendSig Indicator For MT4 has 3 parameters to configure.
extern int AllBars=0;//How many bars should be counted. 0 - all the bars.
extern int Otstup=30;//Step back.
extern double Per=9;//Period.
Buffers of the SHI_SilverTrendSig Indicator For MT4
The SHI_SilverTrendSig Indicator For MT4 provides 2 buffers.
SetIndexBuffer(0,BufU);
SetIndexBuffer(1,BufD);
Main Parts Of The Code
int start()
{
int CB=IndicatorCounted();
/* It is the optimization option. We have the function here which restore/return the number of counted bars in very special way.
During the first indicator s call we have 0: it is normal because it was not counted anything,
and then we receive the number of bars minus 1. For example, if the number of bars equal 100,
we will have 99. I did it especially, you may see that NB is the number of bars whioch should be counted.
You know we may throw out this parameter. But for the people who understand we may keep it. So, during the first call
of indicator this NB is the same one but during the 2dn etc calls - reducing the value up to the last bar,
That is 1 or 2 for example*/
if(CB lt 0) return(-1); else if(NB gt Bars-CB) NB=Bars-CB;
for(SH=1;SH lt NB;SH++)//comb out the chart from 1 to NB
{
for(R=0,i=SH;i lt SH+10;i++) {R+=(10+SH-i)*(High[i]-Low[i]);} R/=55;
//----
SHMax=High[Highest(NULL,0,MODE_HIGH,Per,SH)];
SHMin=Low[Lowest(NULL,0,MODE_LOW,Per,SH)];
if (Close[SH] lt SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH_SELL) { BufU[SH]=Low[SH]-R*0.5; UD=SH_SELL; }
if (Close[SH] gt SHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH_BUY) { BufD[SH]=High[SH]+R*0.5; UD=SH_BUY; }
}
return(0);
}
//+------------------------------------------------------------------+