- 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,
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.
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? [...]
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
- 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.