Whatever you said in bold is incorrect, that line of code will return a non-zero number if the order was successfully sent.jjgengis wrote: I think there's something wrong in your solution....
ticketB=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,Coment,Magic,0,Green);
this row mean that ticketb will be -1 if the function Ordersend fail and 0 in case the order is gone to the market. The algorithm to extract the number ticket of your order is another.
If I've understood well your thought....
JJ
joancb just needs to check if it's equal to -1 before trying to select and modify that order