I have an expert opening to many orders .
buy I can't close them all at once .
all I need is this equation:
if one open orders closed (TP or SL) then Close all orders.
Can you wrote to me the Condition Line:
"If one of opened orders closed "
I don't know if I understood your condition correctly but I am assuming something it should be something like this.
static int PrevOpenedOrders = 0;
if(PrevOpenedOrders < OrdersTotal())
PrevOpenedOrders = OrdersTotal();
else if(OrdersTotal()< PrevOpenedOrders)//This can be OrdersTotal()==PrevOpenedOrders -1 but I didn't write it because if there were 2 orders hit TP at once there will be an error
for(int i = OrdersTotal() - 1; i>=0; i--)
bool res = OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),slippage);
Print("Error in closing the order #",OrderTicket());
PrevOpenedOrders = 0;
Překladač to hodil do cze automaticky:) Díky
The translator translated it into Czech. THx