Selects a deal in the history for further calling it through appropriate functions. It returns true if the function has been successfully completed. Returns false if the function has failed. For more details on error call GetLastError().

bool  HistoryDealSelect(
   ulong  ticket      // Deal ticket



[in]  Deal ticket.

Return Value

Returns true if successful, otherwise false.


Do not confuse orders, deals and positions. Each deal is the result of the execution of an order, each position is the summary result of one or more deals.

HistoryDealSelect() clears in a mql5-program the list of deals available for reference, and copies the single deal, if the execution of HistoryDealSelect() has been completed successfully. If you need to go through all deals selected by the HistorySelect() function, you should better use HistoryDealGetTicket().

See also

HistorySelect(), HistoryDealGetTicket(), Deal Properties