Get OrderId-s which belongs to a Position...

To add comments, please log in or register
aaaTriplaX
115
aaaTriplaX  

Hi Forum,

I have a positionId.

How can i get the orderId-s, which belongs to this position?

Thx in advance, Zoltan.

aaaTriplaX
115
aaaTriplaX  

Perhaps this:

ORDER_POSITION_ID

Position identifier that is set to an order as soon as it is executed. Each executed order results in a deal that opens or modifies an already existing position. The identifier of exactly this position is set to the executed order at this moment.


https://www.mql5.com/en/docs/constants/tradingconstants/orderproperties

Z.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Requests to execute trade operations are formalized as orders. Each order has a variety of properties for reading. Information on them can be obtained using functions Position identifier that is set to an order as soon as it is executed. Each executed order results in a deal that opens or modifies an already existing position. The...
Fernando Carreiro
4448
Fernando Carreiro  

aaaTriplaX: I have a positionId. How can i get the orderId-s, which belongs to this position?

Perhaps this:

ORDER_POSITION_ID

Position identifier that is set to an order as soon as it is executed. Each executed order results in a deal that opens or modifies an already existing position. The identifier of exactly this position is set to the executed order at this moment.


I position can have many Orders associated with it. It is not necessarily a one-to-one relationship.

So, you have the scan the Orders and collect the list of the ones with the same Position ID as the one you have!

To add comments, please log in or register