Hi All,
In MQL4 language, if we use OrderClose() function to close just a part of the lots of the entire position, the EA will close the actual position ticket(number), and create another position ticket(number) with the remaining lots.
I need to catch the new ticket number that is generated!
If there aren't any other positions created, between the creation of the order and the partial close, I can use
to catch the following position ticket number.
But in case, there are an aleatory number of open positions / partial closes, between the creation of a position and the partial close, I cannot catch the ticket number.
Does anyone has ever come across this situation?
Can someone help me?
Thanks in advance.
In MQL4 language, if we use OrderClose() function to close just a part of the lots of the entire position, the EA will close the actual position ticket(number), and create another position ticket(number) with the remaining lots.
Inserted Code
OrderClose(OrderTicket(),(OrderLots()/2),Bid,3,Pink);
If there aren't any other positions created, between the creation of the order and the partial close, I can use
Inserted Code
OrderTicket()+1
But in case, there are an aleatory number of open positions / partial closes, between the creation of a position and the partial close, I cannot catch the ticket number.
Does anyone has ever come across this situation?
Can someone help me?
Thanks in advance.