How to get info about deal time?

 

Hello everybody,

I need help to understand which is the simplest way to get informations abut the time execution of an order.

In my EA, order is placed, and results are collected using this code:

 

 bool success=OrderSend(mrequest,mresult);

 

Where mresult is a MqlTradeResult structure. From the documentation I know that in mresult.deal is stored the deal ticket of the operation executed, but then it is not clear to me how to use the deal ticket to get the information about the time when the order has been executed.

Any help would be greatly appreciated. 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Data Structures / Structure of a Trade Request Result
Documentation on MQL5: Standard Constants, Enumerations and Structures / Data Structures / Structure of a Trade Request Result
  • www.mql5.com
Standard Constants, Enumerations and Structures / Data Structures / Structure of a Trade Request Result - Documentation on MQL5
 
   if(HistoryDealSelect(mresult.deal))
   {
      datetime dealOpenTime=(datetime)HistoryDealGetInteger(mresult.deal,DEAL_TIME);
   }
 
angevoyageur:
Ok, thanks a lot, what I hadn't understood from the documentation was that the deal ticket described in mqltraderesult documentation is exactly the ticket number required by historydealgetinteger
 
hardhu:
Ok, thanks a lot, what I hadn't understood from the documentation was that the deal ticket described in mqltraderesult documentation is exactly the ticket number required by historydealgetinteger
You are welcome.
Reason: