dynamic size array help

 

int counted_bars=IndicatorCounted();

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

double arrayOne[limit];

I need to create an array of dynamic size above, but it doesn't work in this code.

What is the correct way of coding it?

Thanks.

 

https://docs.mql4.com/array/ArrayResize


ArrayResize(arrayOne,limit);
hth