How to initialize an array in AFL?

I am new to AFL coding and want to understand how to initialize an array?

array = 0; // init with zero

That's it.

does it mean it will be of dynamic length and with all values as 0?

It is not of dynamic length, all arrays are of size BarCount indexed from 0 to BarCount - 1.
https://www.amibroker.com/guide/h_understandafl.html

Having said that, in a bit more detail, the variable BarCount itself can be dynamic in the context of QuickAFL
http://www.amibroker.com/kb/2008/07/03/quickafl/ read here for more.
and
http://www.amibroker.com/kb/2014/09/22/do-not-make-assumptions-on-number-of-bars/

Another beneficial thread to review is:

1 Like