The compiler also gives the exact line number and cursor position.
its this line
AskVolume[i]= Ask_p;
Hi,
your code is incomplete,
But i think your error is at this line :
if(rates[i].time==info[k].tm)
So you can add this ,but should check the size of the loop array index which should not be more than array size:
if(i>=ArraySize(rates)-1)continue;
or use :
if(i>=ArraySize(AskVolume)-1)continue; if(i>=ArraySize(BidVolume)-1)continue;
It should be within first loop:
for(int i=1;i<Bars(Symbol(),PERIOD_M1)-1;i++) {
So you can add another condition that avoids unexpected exception if it may happen within second loop like:
if(k>=ArraySize(info)-1)continue;
Regards.
Hi,
I am having a few unexpected issues assigning previous values on a buffer. I get the array out of range error.
I am sharing the code :
This is the buffer :
If you allowed metatrader 4 to update / upgrade to build 1184 that can happen on a perfectly good code.
In that case revert it (the metatrader)
Hi,
your code is incomplete,
But i think your error is at this line :
So you can add this ,but should check the size of the loop array index which should not be more than array size:
or use :
It should be within first loop:
So you can add another condition that avoids unexpected exception if it may happen within second loop like:
Regards.
Hi thanks for your reply,
I printed out the size of AskBolume its 0. But considering its a buffer, i dont think it can be because of that. Any ideas ?
So you should array resize it by i index,because the index of i variable is storing data into this array,also for Bid_Volume.
Your code is incomplete,and fixing the code is vague now,
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I am having a few unexpected issues assigning previous values on a buffer. I get the array out of range error.
I am sharing the code :
This is the buffer :