I need help creating a code, whereI want to close if my order is open for more than 7 days to include in my EA.
I am trying to use OderOpenTime() function but not able to calculate till current time to get the no days difference.
Please suggest some code / function where I can calculate the number of days and check with the open order date and close the trade if it is open for more than 7 days.
thanks in advance.
(TimeCurrent()-OrderOpenTime())>(7*24*3600) ... close the order