How to get OrderOpenTime but only the date Without Time

 

Hey,

I have problem to get OrderOpenTime()

but only the date like this : 2021.07.20 without showing the time.

Thank you.

because I want to close the order whenever the day is change. In this example, when the date is 2021.07.21 I will close the order.

 
Formatting is for printing. Just isolate and compare the date.
  1. TimeDayOfWeek(OrderOpenTime() ) != TimeDayOfWeek(TimeCurrent() ) // or TimeDayOfYear
  2. date(OrderOpenTime() ) != date()
              Find bar of the same time one day ago - MQL4 programming forum 2017.10.06