Same Ticket number for Order and Position ?

 
Hi everyone, hope you're well

I have a confusion between position ticket numbers and order numbers, 

Unless I'm mistaken, yesterday in my backtest I found myself with an identical ticket number for a position and an order? 

Is this possible? 

Should I use the unique Deal ticket numbers? 

Try to read all the documentation on this page. If you have any other useful links, I'd love to hear from you.

Best Reguards,
ZeroCafeine
Orders, Positions and Deals in MetaTrader 5
Orders, Positions and Deals in MetaTrader 5
  • www.mql5.com
Creating a robust trading robot cannot be done without an understanding of the mechanisms of the MetaTrader 5 trading system. The client terminal receives the information about the positions, orders, and deals from the trading server. To handle this data properly using the MQL5, it's necessary to have a good understanding of the interaction between the MQL5-program and the client terminal.
 
ZeroCafeine:
Hi everyone, hope you're well

I have a confusion between position ticket numbers and order numbers, 

Unless I'm mistaken, yesterday in my backtest I found myself with an identical ticket number for a position and an order? 

Is this possible? 

Should I use the unique Deal ticket numbers? 

Try to read all the documentation on this page. If you have any other useful links, I'd love to hear from you.

Best Reguards,
ZeroCafeine
Simple answer:


Read about this constant: POSITION_IDENTIFIER
 
Dominik Egert #:
Simple answer:


Read about this constant: POSITION_IDENTIFIER

Thank you very much, I'm going to work with order tickets instead.

How can I tell if an order is still pending or has already been executed?

I'm thinking of using the ENUM_ORDER_STATE enumerator with the result ORDER_STATE_PLACED For an already placed order ?

Or is just checking the result of the OrderSelect boolean function enough?

Best Reguards,
ZeroCafeine

 
ZeroCafeine #:

Thank you very much, I'm going to work with order tickets instead.

How can I tell if an order is still pending or has already been executed?

I'm thinking of using the ENUM_ORDER_STATE enumerator with the result ORDER_STATE_PLACED For an already placed order ?

Or is just checking the result of the OrderSelect boolean function enough?

Best Reguards,
ZeroCafeine

Problem Solved, tks you 😊