I need a large size of array buffer to store testing data in my ea.such as the code below:
when the value of size is to large,the compiler will come out a error said :array is too large.
I want to know the largest value of size that I can used.
What the documentation says ?
Total amount of elements in the array cannot exceed 2147483647.
I found this in the Docs about ArrayResize().
If you try this scripts below:
void OnStart() { //--- int size=2000000000; // < 2147483647 double a[]; double b[]; datetime c[]; ulong d[]; if(ArrayResize(a,size)==-1 || ArrayResize(b,size)== -1 || ArrayResize(c,size)== -1 || ArrayResize(d,size)== -1) Print("resize error"); else Print("ok"); }
you will away get "resize error". and if you declare a static array:
double a[2000000000]; double b[2000000000]; datetime c[2000000000]; ulong d[2000000000];
the compiler get error: array is too large
Total amount of elements in the array cannot exceed 2147483647.
I found this in the Docs about ArrayResize().
If you try this scripts below:
you will away get "resize error". and if you declare a static array:
the compiler get error: array is too large
Of course you need to have sufficient memory to allocate such size to your arrays.
A double is 8 bytes x 2,000,000,000 = around 16 Gb only for 1 array.
Of course you need to have sufficient memory to allocate such size to your arrays.
A double is 8 bytes x 2,000,000,000 = around 16 Gb only for 1 array.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I need a large size of array buffer to store testing data in my ea.such as the code below:
when the value of size is to large,the compiler will come out a error said :array is too large.
I want to know the largest value of size that I can used.