Sorry, but your query is not very clear, but here are some pointers:
- Visually, on MetaTrader, the Order's ticket number is right there in the column called "Order" in the "Trade" or "Account History" tab. There is no mouse click involved - you just read the number of the display. There is not copy/paste function for the Order Ticket number.
- Programmatically, in MQL4, you can access the ticket number via the OrderTicket() function, once you have selected an Order with the OrderSelect() function.
Thanks for your reply!
The real purpose of my issue is "How to reverse specific order in the order list of Meta terminal Trading Tab "
Just like when you open several orders of one symbol (in the same chart) and one of them have different direction from others (for example. Order 1 ... Order 3 are Short positions but Order 4 is Long position and Order 5 ... Order N are Short positions).
Due to the current MT4 Terminal only have simple right click menu in trading tab.
Yes ! We have open / close / modify / delete order menu but NO Reverse a certain order menu in the mouse right click !
Once I got a ticket No.which is the unique identifier of a certain order, I can transfer it to my EA GUI then I can do whatever I want!
Thanks for your reply!
The real purpose of my issue is "How to reverse specific order in the order list of Meta terminal Trading Tab "
Just like when you open several orders of one symbol (in the same chart) and one of them have different direction from others (for example. Order 1 ... Order 3 are Short positions but Order 4 is Long position and Order 5 ... Order N are Short positions).
Due to the current MT4 Terminal only have simple right click menu in trading tab.
Yes ! We have open / close / modify / delete order menu but NO Reverse a certain order menu in the mouse right click !
Once I got a ticket No.which is the unique identifier of a certain order, I can transfer it to my EA GUI then I can do whatever I want!
What do you mean by "Reverse a certain order"? There is no such thing as reversing an order (at least, not in the MetaTrader environment)!
If you mean a kind of Stop-and-Reverse or maybe something like a "Hedging" effect on the same symbol, then those are concepts specific to your trading strategy and has nothing to do with order management (i.e. open, modify, close or delete).
Your original request was for a Ticket number, for which I supplied some answers. If you want to apply a SAR or Hedging strategy, then you have to implement those either manually or via an EA that applies your trading strategy logic!
Yeah! There's no such function in current MT4 environment as we all know it.
It's a kind of Close & Reverse but not concern about "Hedging" strategy. Holding one order still and reversing another one. In Chinese, holding different direction orders on the same symbol is not 'Hedge' but 'lock'.
It's more about money management than trading strategy.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, Gurus:
Does anybody know how to get a specific Order's Ticket No. through one click in order list of the terminal trading tab?
Current situations:
1. Double click one of the order list in trading tab & pop out a dialog window (Yes! The Interface for the operations of deleting / modifying / closing a certain order in the order list of trading tab)
But I didn't have any idea how to get the exact order's ticket No. which is just shows on the window's title as we've familiar with it.
I've got through the MQL4 manual as RTFM but didn't get any useful info.
2. Without any mouse action in trading tab just runs the for loop function through the order's array (Yes! Just as we've known as an EA/Script/Indicator did) in the order list.
For loop function visit every single order in the order's array by a counter & OrdersTotal() which need take time as an indirect way to get an order's all info in details.
Any of your hints / examples / advice will be sincerely appreciated in advance! Thanks!