Codeing a maximal Order Open Time with weekend filter

 

Hello,

i want to codeing into my EA that a order can be just for exampel 120 minuts open, then the EA should close the Order, when he is longer then 120 minutes open.

But i have a problem with the weekends, when the forex close at friday and open at sunday or monday, then i want that the order keep open for another houer, if the order have been open for exampel at friday evening then the forex have close and sunday or monday the forex open again i dont want the order to be automatic close, because the of weekend time.

At moment i just use the Order open time and the TimeCurrent() function to see how long the order is open.

Does somebody undestand my problem and know a solution how to codeing that right?