I can't get ORDER_PRICE_OPEN from history

 

I can't get ORDER_PRICE_OPEN from history

      ulong ticket=226163366;
      HistoryOrderSelect(ticket);
      Alert("ORDER_VOLUME_INITIAL "+HistoryOrderGetDouble(ticket,ORDER_VOLUME_INITIAL));
      Alert("ORDER_PRICE_OPEN "+ HistoryOrderGetDouble(ticket,ORDER_PRICE_OPEN));
      Alert("ORDER_TP "+ HistoryOrderGetDouble(ticket,ORDER_TP));
      Alert("ORDER_POSITION_ID "+ HistoryOrderGetInteger(ticket,ORDER_POSITION_ID));

as a result I get:

 ORDER_VOLUME_INITIAL 0.01
 ORDER_PRICE_OPEN 0.0
 ORDER_TP 1.19100
 ORDER_POSITION_ID 226163366



Price open I am not getting the correct result. There is always 0.

I have no idea how to get the purchase price from history. Please tell me how to get this price?

 
Everything works great. Example:  History Deals and Orders
History Deals and Orders
History Deals and Orders
  • www.mql5.com
The 'History Deals and Orders' script shows absolutely all properties of deals and orders from the trading history over a given time interval.
 
Ireneusz Pacek:

I can't get ORDER_PRICE_OPEN from history

as a result I get:

Price open I am not getting the correct result. There is always 0.

I have no idea how to get the purchase price from history. Please tell me how to get this price?

Can you post a screenshot showing this order in MT5 History tab ?
 
market-price == 0.
 
Alain Verleyen:
Can you post a screenshot showing this order in MT5 History tab ?
history

I attach scrin

 
Vladimir Karputov:
Everything works great. Example:  History Deals and Orders
scrin result script


Your help is great. The script also sees Open Price = 0.0

But I understood that I could use Price Current. I understand that Price Current is the opening price. This solves my problem.


Thanks a lot.

Reason: