I have never had that warning for an array.
Maybe it is because you are not using a dynamic array which means that the ArrayResize() will not work.
int orderstotal = OrdersTotal(); int orders = 0; int ordticket[][2]; ArrayResize(ordticket,orderstotal); double lots = 0; for (int i = 0; i < orderstotal; i++) { bool BuyVar=OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() != 9) { continue; } ordticket[orders][0] = (int)OrderOpenTime(); ordticket[orders][1] = OrderTicket(); orders++; } ArrayResize(ordticket,orders);
would possibly not give you the warning
EDIT: changed a typo after reading the following post
I have never had that warning for an array.
Maybe it is because you are not using a dynamic array which means that the ArrayResize() will not work.
would possibly not give you the warning
int orderstotal = OrdersTotal(); int orders = 0; int ordticket[30][2]; //NOTHING CHANGED ArrayResize(ordticket,orderstotal); //INSERTED double lots = 0; for (int i = 0; i < orderstotal; i++) { bool BuyVar=OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() != 9) { continue; } ordticket[orders][0] = (int)OrderOpenTime(); ordticket[orders][1] = OrderTicket(); orders++; } ArrayResize(ordticket,orders); //INSERTEDNo Warnings. But as you said i have not changed int ordticket[0][2]; instead of ordticket[30][2];
changing int ordticket[0][2];
says error as '[' - invalid index value
Sorry, my typing finger must have slipped
int ordticket[][2];
of course the [] should be empty
No Warnings. But as you said i have not changed int ordticket[0][2]; instead of ordticket[30][2];
Well, learn something new every day
int ordticket[30][2]; Print(ArrayRange(ordticket,0)); ArrayResize(ordticket,5); Print(ArrayRange(ordticket,0)); ArrayResize(ordticket,40); Print(ArrayRange(ordticket,0));
I thought that static arrays could not be resized, but after your post I tried this bit of code and it seems that they can.
In the documentation for ArrayResize()
The function can be applied only to dynamic arrays
I get the follwing warning message. how to resolve the issue?
Warning Message: possible use of uninitialized variable 'ordticket'
Support is appreciated...
int ordticket[30][2]={0};Or dynamic array as point by GumRai.
Well, learn something new every day
I thought that static arrays could not be resized, but after your post I tried this bit of code and it seems that they can.
In the documentation for ArrayResize()

- 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 get the follwing warning message. how to resolve the issue?
Warning Message: possible use of uninitialized variable 'ordticket'
Support is appreciated...