Need help with OrderModify()

 

- I open a multi lot order with OrderSend().

- I Ordermodify() it with no problem.

- I close out 1 lot with OrderClose().

- Now when I try to modify the order which still has the remainder of the lots, I get an "unknown ticket for OrderModify() function"


The ticket is open, OrderTicket() continues to return the same #, but OrderModify() continues to return the invalid error.


Any help would be GREATLY appreciated.


 
Lou:

- I open a multi lot order with OrderSend().

- I Ordermodify() it with no problem.

- I close out 1 lot with OrderClose().

- Now when I try to modify the order which still has the remainder of the lots, I get an "unknown ticket for OrderModify() function"

The ticket is open, OrderTicket() continues to return the same #, but OrderModify() continues to return the invalid error.

Partial close of a position forms a new position with a new ticket number. You need to find this new ticket number... Note that the OrderSelect() buffer is static; that's why OrderTicket() continues to return the same ticket number (more info -> https://www.mql5.com/en/forum/124632). You need to select the new formed position first...
 
gordon:
Partial close of a position forms a new position with a new ticket number. You need to find this new ticket number... Note that the OrderSelect() buffer is static; that's why OrderTicket() continues to return the same ticket number (more info -> https://www.mql5.com/en/forum/124632). You need to select the new formed position first...


Gordon,

Thanks for the reply. Forex.com told me explicitly,more than once, that the ticket remains open under the same ticket number. Appears to be in direct contradiction with what you're saying here. Is it possible that this is handles differently by different brokers? I don't know what to do here, I'm stopped in my tracks. Any suggestions?

I simply want to close one position and move the stops on others. Using multiple orders is going to get messy.

Thanks again.

 
Lou:

Forex.com told me explicitly,more than once, that the ticket remains open under the same ticket number. Appears to be in direct contradiction with what you're saying here. Is it possible that this is handles differently by different brokers? [...]

I have heard that this might be broker specific, but I have never seen a broker for which the ticket number doesn't change for partial close. But why don't u have a quick look at the 'Trade' and 'Account History' tabs and see if partially closed orders changed their ticket numbers? If u find the answer, please post here... I'm curious about this...
Reason: