Get Deal IN ticket from Deal OUT ticket

 

Hi, 


is there an easy way to get the ticket number of a Deal IN knowing a Deal OUT ticket? 

Given a Deal OUT ticket, how can I get a Deal IN ticket?


Thanks

 
1. Get position id of out deal.(DEAL_POSITION_ID)
2. Use HistorySelectByPosition to access deal in.

Documentation on MQL5: Trade Functions / HistorySelectByPosition
Documentation on MQL5: Trade Functions / HistorySelectByPosition
  • www.mql5.com
Retrieves the history of deals and orders having the specified position identifier. Parameters position_id [in]  Position identifier that is...
 
Yashar Seyyedin #:
1. Get position id of out deal.(DEAL_POSITION_ID)
2. Use HistorySelectByPosition to access deal in.

Thank you, truly helpful!