- ReLor2: What i do wrong or
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor This will create a two by two (number of elements specified) prices_reset_tp[][2]={{NULL,NULL},{NULL,NULL}};
Exactly the same as prices_reset_tp[2][2]={{NULL,NULL},{NULL,NULL}};
If you know how big you need, specify it. Set the first value. All remaining will default to zeros. prices_reset_tp[4][2]={NULL};
You can also just use prices_reset_tp[4][2]; ArrayFill(prices_reset_tp ,0 , 4*2, NULL);
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
At first in global scope i do this: After that onINIT i do this
ArrayResize(prices_reset_tp,number_array);
numer_array is a input var and contains for example: 3
so at this moment i should have a array like this
prices_reset_tp[0][1]
prices_reset_tp[0][2]
prices_reset_tp[1][1]
prices_reset_tp[1][2]
prices_reset_tp[2][1]
prices_reset_tp[2][2]
Now i need to fill the array, for that i can do it in typical way
prices_reset_tp[0][1]=123;
prices_reset_tp[0][2]=456;
etc.
I looking for a faster way do put this in the array, i test something like this:
prices_reset_tp={{NULL,NULL},{NULL,NULL}};
or
prices_reset_tp[]={{NULL,NULL},{NULL,NULL}};
to set all sub-elements to NULL
prices_reset_tp[0][1]=NULL;
prices_reset_tp[0][2]=NULL;
prices_reset_tp[1][1]=NULL;
prices_reset_tp[1][2]=NULL;
prices_reset_tp[2][1]=NULL;
prices_reset_tp[2][2]=NULL;
What i do wrong or what will be the correct way to do this?