Hi and good morning,
the CLOP array is only declared, but as an empty array. So you have to declare it with a fixed size e.g.:
double CLOP[100];
or you have to use the ArrayResize-function to put elements into the array:
double CLOP[]; ArrayResize(CLOP, 100);
I hope, this helps you.
Best regards
Federico Ciani: Goodmorning everyone, I am new to programming, I have been looking for the solution to the "array out of range" problem of the following lines of code for a week ... you can help me?
I would like to create an array containing the above calculation and populate it with a while loop
- Your code is incomplete! You don't show the declaration of the "arrayPriceData" array.
- You have not specified if this is an EA or Indicator.
- You should not be doing those operations such as CopyRates in the OnInit(). OnInit() is used for initial setup and initialisation and there is no guarantee that the terminal is connected to the trade server or that the data is available at the at time. Those operations should be carried out in the OnTick() for EAs or in the OnCaluculate() for Indicators.
- The array CLOP is declared as a Dynamic array, but you have not set a size for it, neither statically nor dynamically via ArrayResize().
- You are using an maximum array max index of 100 (hard coded), but have completely ignored the result of the CopyRates in the nrBarreMemorizzate which could be less than the 100.
- Arrays start at index 0, not index 1.

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
Goodmorning everyone, I am new to programming, I have been looking for the solution to the "array out of range" problem of the following lines of code for a week ... you can help me?
I would like to create an array containing the above calculation and populate it with a while loop