That's not the code you used to get the bogus number. No print statement.
Show all relevant code. We have no idea what int_OrderOpenDayOfWeek, OpenOrderLot, etc. are.
If the OrderType is less than 2, it is an open order (Buy or Sell). No need to check the OpenTime.
Why are you assigning the time to a double price?
int x = OrdersTotal();
for (int i = 0; i < x; i++)
In the presence of multiple orders (one EA multiple charts, multiple EAs, manual trading), while you are waiting for the current operation (closing, deleting, modifying) to complete, any number of other operations on other orders could have concurrently happened and changed the position indexing and count:
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Thanks Fernando
I opened a trade to try the code , and I had a large number 12054
I though it should be somewhere from 1 to 6 ?
Show your code! We can't just guess what you are doing wrong if you don't show it.
I added the code
That is incomplete. Show how you are testing it's value or printing it out.
EDIT: There is also another problem with your code:
In the presence of multiple orders (one EA multiple charts, multiple EAs, manual trading), while you are waiting for the current operation (closing, deleting, modifying) to complete, any number of other operations on other orders could have concurrently happened and changed the position indexing and count:
Loops and Closing or Deleting Orders - MQL4 programming forum
CloseOrders by FIFO Rules - Strategy Tester - MQL4 programming forum - Page 2 #16
MetaTrader 5 platform beta build 2155: MQL5 scope, global Strategy Tester and built-in Virtual Hosting updates - Best Expert Advisors - General - MQL5 programming forum #1.11
My bad I was printing the line of the code next to the day
Alert( int_OrderOpenDayOfWeek , __LINE__);
this solve it
Alert( int_OrderOpenDayOfWeek + " | ", __LINE__);
Thanks a lot Fernando and William
My bad I was printing the line of the code next to the day
Alert( int_OrderOpenDayOfWeek , __LINE__);
this solve it
Alert( int_OrderOpenDayOfWeek + " | ", __LINE__);
Thanks a lot Fernando and William