Broker API HubMenu

MQL5 HistoryDealGetInteger()

functionHistoryDealGetInteger()MQL5History

Returns one integer or date property of a deal in the account's history, by ticket.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Independent and unofficialmql5.comchecked

This is an MQL5 function, not an HTTP endpoint. It has no method, no path and no address to send a request to: it runs inside the MetaTrader 5 terminal, in a program written in MQL5.

Signature

The 2 forms of the call on the vendor's page, with the vendor's comments taken out.

long HistoryDealGetInteger(
  ulong ticket_number,
  ENUM_DEAL_PROPERTY_INTEGER property_id
)
bool HistoryDealGetInteger(
  ulong ticket_number,
  ENUM_DEAL_PROPERTY_INTEGER property_id,
  long& long_var
)

Arguments

NameTypeDescription
ticket_numberrequiredulongThe ticket of the deal.
property_idrequiredENUM_DEAL_PROPERTY_INTEGERWhich property to return, as a value of the ENUM_DEAL_PROPERTY_INTEGER enumeration.
long_varrequiredlong&Only in the second form: the long variable that receives the value.

Return value

Type
long, or bool in the second form
What comes back
The page gives two forms: one returns the value itself, the other returns true or false and writes the value into a variable passed by reference.