array size allocation depending on variable
ArrayResize() is you friend. But study the example there.
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...
Thanks a lot Carl !
int OnInit()
{
...