Trading on Time

 
I am writing an EA that opens and closes trades at a specific time, but if there is no tick data for a few minutes then the trade time comes and goes and I miss the trade?
Is besides writing a trade time window, is there a way around this? Perhaps someone else has already written an EA like this I can use as a template..

Thanks in Advance

David
 

Put the EA n a loop, and it is no longer dependent upon ticks (after it gets the first one to start).

Use TimeLocal() inside the loop for timing.

while (IsStopped() == false){

... your code

Sleep(1000);

}

return(0);

}

 
I thought about something like that but wasn't sure how to accomplish it..

thanks so much..
 
OH.. one other question.. Why do you suggest I use time local? Does this mean I need to also check local time for placing the orders?

thanks

d
 
dwt1020:
OH.. one other question.. Why do you suggest I use time local? Does this mean I need to also check local time for placing the orders?

thanks

d


TimeServer() gives the time of the last tick, which you weren't happy with.

 
OH NEVER MIND.. I HAD A BRAIN FART.. I FIGURED IT OUT..

thanks so much..

d
Reason: