how can Orders, Positions and Deals be linked together? - page 2

 
How can I retrieve this number through report history?
 
Kaden407 #:
How can I retrieve this number through report history?
"HistorySelectByPosition() creates in a mql5 program a list of orders and a list of deals with a specified position identifier for further reference to the elements of the list using the appropriate functions. To know the size of the list of deals, use function HistoryDealsTotal(), the size of the list of orders in the history can be obtained using HistoryOrdersTotal(). To run through elements of the orders list, use HistoryOrderGetTicket(), for elements of the deals list - HistoryDealGetTicket()."
Documentation on MQL5: HistorySelectByPosition / Trade Functions
Documentation on MQL5: HistorySelectByPosition / Trade Functions
  • www.mql5.com
Retrieves the history of deals and orders having the specified position identifier. Parameters position_id [in]  Position identifier that is...
 
Ryan L Johnson #:
"HistorySelectByPosition() creates in a mql5 program a list of orders and a list of deals with a specified position identifier for further reference to the elements of the list using the appropriate functions. To know the size of the list of deals, use function HistoryDealsTotal(), the size of the list of orders in the history can be obtained using HistoryOrdersTotal(). To run through elements of the orders list, use HistoryOrderGetTicket(), for elements of the deals list - HistoryDealGetTicket()."
Thank you!!