closing orders after 15mins

 

Hi all,

i'm currently working on an EA, and i want it to close opened orders after 15mins of opening the order, is it correct to express the condition like this

if(TimeCurrent()-OrderOpenTime())>=900)

where 900=60secs X 15

Any help will be highly appreciated.

Thanks.

 
int TicketAge(int TicketNumber)
   {
    int Age;
    OrderSelect(TicketNumber,SELECT_BY_TICKET);
    Age=TimeCurrent()-OrderOpenTime();
    return(Age);
   }
i use the function above, and it looks like your formula, i guess your approach is correct ;-)
 
meikel wrote >>
i use the function above, and it looks like your formula, i guess your approach is correct ;-)

thanks meikel,

but does anyone have a different opinion?

i need your opinions to be successful.

please.

Reason: