array out of range" (the line of BodyStick[i], 16) What's wrong and how can I fix this? Thanks for any help.
My code is something like above, no matter how I input on the BodyStick[i] or the condition for i, when I put the EA on the platform, it escaped in a tick and return "![The checks a trading robot must pass before publication in the Market The checks a trading robot must pass before publication in the Market](https://c.mql5.com/36/39/the-checks-a-trading-robot-must__3.jpg)
The checks a trading robot must pass before publication in the Market
- www.mql5.com
Before any product is published in the Market, it must undergo compulsory preliminary checks, as a small error in the expert or indicator logic can cause losses on the trading account. That is why we have developed a series of basic checks to ensure the required quality level of the Market products. If any errors are identified by the Market...
- array out of range - Top/Bottom
- Array out of range error
- Please help for the "array out of range" error
Hiệp Lê :
My code is something like above, no matter how I input on the BodyStick[i] or the condition for i, when I put the EA on the platform, it escaped in a tick and return " array out of range " (the line of BodyStick[i], 16) What's wrong and how can I fix this? Thanks for any help.
My code is something like above, no matter how I input on the BodyStick[i] or the condition for i, when I put the EA on the platform, it escaped in a tick and return " array out of range " (the line of BodyStick[i], 16) What's wrong and how can I fix this? Thanks for any help.
You made a gross mistake: You have declared a DYNAMIC array. You MUST manage the size of the array yourself.
![Documentation on MQL5: Array Functions / ArrayResize Documentation on MQL5: Array Functions / ArrayResize](https://c.mql5.com/36/39/documentation-on-mql5-array-functions.png)
Documentation on MQL5: Array Functions / ArrayResize
- www.mql5.com
If ArrayResize() is applied to a static array, a timeseries or an indicator buffer, the array size remains the same – these arrays will not be reallocated. In this case, if The function can be applied only to dynamic arrays. It should be noted that you cannot change the size of dynamic arrays assigned as indicator buffers by the...
Vladimir Karputov:
You made a gross mistake: You have declared a DYNAMIC array. You MUST manage the size of the array yourself.
Thanks for help, I resized the array and it works.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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