This one I don't get. I cannot reproduce the error if I want. I just wait and it will happen eventually.
The offending code is
Because Bars is not a static value. - It tends to change. Do not rely on that being in sync with your file all the time.
You need to adjust your array size to the actual needs, not to some arbitrary value derived from bars.
Determine the size of the file in bytes, divide it by the size of your structure, resize the array to that.
Because Bars is not a static value. - It tends to change. Do not rely on that being in sync with your file all the time.
You need to adjust your array size to the actual needs, not to some arbitrary value derived from bars.
Determine the size of the file in bytes, divide it by the size of your structure, resize the array to that.
I do have this line
ulong file_size = FileSize(handle);
but I'm not using the variable for some reason.
Thanks.![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This one I don't get. I cannot reproduce the error if I want. I just wait and it will happen eventually.
The offending code is