-
Why did you post your MT4 question in the MT5 EA section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time post in the correct place. The moderators will likely move this thread there soon. -
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
Messages Editor - Of course, it is. You are reading open orders, therefor there is no OrderCloseTime.
-
Why did you post your MT4 question in the MT5 EA section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time post in the correct place. The moderators will likely move this thread there soon. -
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
Messages Editor - Of course, it is. You are reading open orders, therefor there is no OrderCloseTime.
- Of course, it is. You are reading open orders, therefor there is no OrderCloseTime.
Will - While I solved the original issue and what I was trying to do, as I think more about your response it isn't making sense to me. The function OrderClosePrice() is returning the price I closed at. How can I get the close price of an order but not the close time? Can you elaborate on what I am missing?
You are not making any sense!
The function OrderClosePrice() is returning the price I closed at.
What do you expect it to return??
If the order is closed, it returns the close price.
If the order is open it returns the current price (Ask for a sell, Bid for a buy).
You are reading open orders. OrderClosePrice is the current market. OrderCloseTime is zero. What part of “open orders” is unclear?
if(OrderSelect (x, SELECT_BY_POS, MODE_TRADES)) {

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello - I have copied a snippet of my code below. It is attempting to write a bunch of order information to file upon closing a trade. The order functions I use (OrderTicket(),OrderSymbol(),Order_Type,OrderOpenPrice(),OrderClosePrice(), etc) all write the correct values to file. However OrderCloseTime() is writing 1970.01.01 00:00:00 for every trade, even as the OrderOpenTime returns the correct value. Note that I am running this in the strategy tester, not on a live account.