I am trying to modify pending orders with order tickets, The problem is that if I attach the EA on 2 or more different charts order tickets are mixed and this is a problem, can someone help me? below is the complete code of the logic.
//---4 Count total orders placed by the EA on current Symbolstring orderSymbol_;
int ordersTotal = OrdersTotal();
int expertOrders = 0;
long orderMagicEXT;
ulong orderTicket;
for(int i = 0; i < ordersTotal; i++)
{
orderTicket = OrderGetTicket(i); // Get Order Ticketif(!OrderSelect(orderTicket))
{
Print("There is an error on OrderSelect Function: " + (string)GetLastError());
} // Select ticketlong orderMagic = OrderGetInteger(ORDER_MAGIC); // Get Order Magic Number
orderMagicEXT = orderMagic;
orderSymbol_ = OrderGetString(ORDER_SYMBOL);
//-- Add Symbol filter tooif(orderMagic == I_magicNumber && Symbol() == orderSymbol_)
{
expertOrders++;
}
}
//---4---------------------------------------------
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.
Hello everyone,
I am trying to modify pending orders with order tickets, The problem is that if I attach the EA on 2 or more different charts order tickets are mixed and this is a problem, can someone help me? below is the complete code of the logic.