-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
Messages Editor - ali88005: why?The resize failed, when number_of_day is greater than 2.1 billion. Or you didn't compile after changing the code.

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
please help me to solve this error
in last line of loop , error array out of range???
why?
double ma_valum(int shift=0,int number_of_day=100,int period=5)
{
double arrayvolume[];
for(int i=0;i<number_of_day;i++)
{
int new_size=i+1;
ArrayResize(arrayvolume,new_size);
arrayvolume[i]=(double)iVolume(NULL,PERIOD_M5,i);
}
double khrooji=iMAOnArray(arrayvolume,0,10,0,MODE_EMA,shift);
return khrooji;
}