Ultra Trend Zero Lag DEMA Indicator For MT5
The Ultra Trend Zero Lag DEMA Indicator For MT5 is based on the principle of zero lag and it allows the traders to execute the trade based on real-time price movement. You will notice color-changing bands in the indicator window. When the channel is orange color, you should be expecting a bearish rally. Try to trade the key support and resistance level based on this tool so that you don’t have to lose a big sum of money.
Installing the Ultra Trend Zero Lag DEMA Indicator For MT5
After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file Ultra trend - zero lag dema.mq5 into the folder MQL5\Indicators of your MT5 installation. After that please restart MT5 and then you will be able to see the indicator in the list of indicators.
Parameters of the Ultra Trend Zero Lag DEMA Indicator For MT5
The Ultra Trend Zero Lag DEMA Indicator For MT5 has 4 parameters to configure.
input int inpUtrPeriod = 3; // Start period
input int inpProgression = 5; // Step
input int inpInstances = 50; // Instances
input int inpSmooth = 5; // Ultra trend smoothing period
Buffers of the Ultra Trend Zero Lag DEMA Indicator For MT5
The Ultra Trend Zero Lag DEMA Indicator For MT5 provides 6 buffers.
SetIndexBuffer(0,fillu,INDICATOR_DATA);
SetIndexBuffer(1,filld,INDICATOR_DATA);
SetIndexBuffer(2,valp,INDICATOR_DATA);
SetIndexBuffer(3,valpc,INDICATOR_COLOR_INDEX);
SetIndexBuffer(4,valm,INDICATOR_DATA);
SetIndexBuffer(5,valmc,INDICATOR_COLOR_INDEX);
Main Parts Of The Code
int OnCalculate(const int rates_total,const int prev_calculated,const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
if(Bars(_Symbol,_Period) lt rates_total) return(prev_calculated);
int endLength=inpUtrPeriod+inpProgression*inpInstances;
int i=(int)MathMax(prev_calculated-1,1); for(; i lt rates_total && !_StopFlag; i++)
{
double valueUp=0;
double valueDn=0;
for(int k=inpUtrPeriod,instance=2; k lt =endLength && i gt 0; k+=inpProgression,instance++)
if(_iSmooth[instance].CalculateValue(close[i-1],k,i-1,rates_total) lt _iSmooth[instance].CalculateValue(close[i],k,i,rates_total))
valueUp++;
else valueDn++;
valp[i] = _iSmooth[0].CalculateValue(valueUp,inpSmooth,i,rates_total);
valm[i] = _iSmooth[1].CalculateValue(valueDn,inpSmooth,i,rates_total);
valpc[i] = (valp[i] gt valm[i]) ? 1 : 2;
valmc[i] = valpc[i];
fillu[i] = valp[i];
filld[i] = valm[i];
}
return (i);
}