Timing out.....

 
I have always struggled with this: can anyone help? I have just placed and order and it closes(for a profit), how do I "timeout" the EA so that it waits one hour to trade. I know I can get the last order close time perhaps and then write something to wait until that time plus an hour? Can anyone show me the code that could do this forme? Thanks..... Dan
 
forexman05:
I have always struggled with this: can anyone help? I have just placed and order and it closes(for a profit), how do I "timeout" the EA so that it waits one hour to trade. I know I can get the last order close time perhaps and then write something to wait until that time plus an hour? Can anyone show me the code that could do this forme? Thanks..... Dan

forexman05,

First you need to select the last order to get the correct close time.

Then you may use something like this:

datetime closetime = OrderCloseTime();

if(TimeCurrent()<(closetime+3600)) { wait or do something else }

Reason: