I am trying to add indicator code, which works perfectly on its own, to an EA MQL4 source. While everything compiles just fine, the terminal tab shows the above error.
Both errors occuring relate to tick[i+k].
double ticks[];
double tick[];
int init() {
ArrayResize(ticks,TotalBars); ArraySetAsSeries(ticks,true);
ArrayResize(tick,TotalBars); ArraySetAsSeries(tick,true);
return(0);
}
int start() {
for (i=TotalBars-1; i>=0; i--)
{
avg = tick[i];
for (k=1; k<AveragePeriod && tick[i+k]!=0; k++) avg += tick[i+k];
avg /= k;
....
I want to prevent iCustom calls. What could be the issue?
Thank you.