Getting Pending Order and Actual Executed price

 


   datetime to    = TimeCurrent(),
            from  = iTime(_Symbol, PERIOD_D1, 0);

   ulong    ticket;

   HistorySelect(from, to);

   for(int i = HistoryOrdersTotal() - 1; i >= 0; i--)
   {
      ticket = HistoryOrderGetTicket(i);

      Print(ticket, " - ", HistoryOrderGetDouble(ticket, ORDER_PRICE_OPEN));
   }

I'm trying to code a script to run through my history to see the price slippage.

I'm able to get the Pending Order price but how do I get the executed price?

 

https://www.mql5.com/en/docs/trading/historydealgetdouble

https://www.mql5.com/en/docs/constants/tradingconstants/dealproperties#enum_deal_property_double

Documentation on MQL5: Trade Functions / HistoryDealGetDouble
Documentation on MQL5: Trade Functions / HistoryDealGetDouble
  • www.mql5.com
HistoryDealGetDouble - Trade Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Kang Feng #:

https://www.mql5.com/en/docs/trading/historydealgetdouble

https://www.mql5.com/en/docs/constants/tradingconstants/dealproperties#enum_deal_property_double

Thank you