DEAL_EXTERNAL_ID() missing from CDealInfo

 

The HistoryDealGetString() has a DEAL_EXTERNAL_ID string property for  HistoryDealGetString(),
but the 
CDealInfo class does not have an equivalent DEAL_EXTERNAL_ID string function. Why not?

If the CDealInfo class implementation incomplete or is the DEAL_EXTERNAL_ID now an obsolete property?

Is there a way to use the CDealInfo class to retrieve the DEAL_EXTERNAL_ID?

I searched the MT% forums for references to DEAL_EXTERNAL_ID , but it didn't return any relevant information.

Documentation on MQL5: Trade Functions / HistoryDealGetString
Documentation on MQL5: Trade Functions / HistoryDealGetString
  • www.mql5.com
Returns the requested property of a deal. The deal property must be of the string type. There are 2 variants of the function. 1. Immediately...
 
Don Baechtel: ... but the CDealInfo class does not have an equivalent DEAL_EXTERNAL_ID string function. Why not?

It does, but unfortunately not documented ...

..\MQL5\Include\Trade\DealInfo.mqh

   //--- fast access methods to the string position properties
   string            Symbol(void) const;
   string            Comment(void) const;
   string            ExternalId(void) const;
//+------------------------------------------------------------------+
//| Get the property value "DEAL_EXTERNAL_ID"                        |
//+------------------------------------------------------------------+
string CDealInfo::ExternalId(void) const
  {
   return(HistoryDealGetString(m_ticket,DEAL_EXTERNAL_ID));
  }

When in doubt, take a look at the source code. You may find extra functionality that is not properly documented.

 

Also, you can use the CDealInfo::InfoXXX() methods to get other properties, when not implemented explicitly by the class ...

Access to MQL5 API functions

 

InfoInteger

Gets the value of specified integer type property

InfoDouble

Gets the value of specified double type property

InfoString

Gets value of specified string type property

 
Fernando Carreiro #:
CDealInfo

Where can I find the source code for class CDealInfo?
The Go to Definition/Declaration does not take me there.

Should not Go to Definition take me to the source code for CDealInfo?

Thanks for the quick replies.

 
Don Baechtel #Where can I find the source code for class CDealInfo? The Go to Definition/Declaration does not take me there. Should not Go to Definition take me to the source code for CDealInfo
  
 
Fernando Carreiro #:
  

That's a BIG help.  THANKS.