It is a problem with initializing counters. Here, the error is that tick has been "possibly uninitialized", and the code does not work.
int limit;
if(prev_calculated==0)limit=0;
else limit=prev_calculated-1;
int tick;
//--- calculate MACD
for(int i=limit;i<rates_total;i++)
{
double a = Close[i]>0;
if(a==true )
{
tick++;
BufferFlat[i]=tick;
}
}
//---- done
return(rates_total);
}

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello, after the most recent meta editor update, I get a warning for several variables that they have not been initialized.
int tick;int cat;
int dog;
That is how they have been initialized, but I cannot find any difference between how mine are initialized, and how they are being initialized in other indicators that come with metatrader 5.
Thanks a lot.