MQL4 - automated forex trading   /  

Forum

Trading on Time

Back to topics list To post a new topic, please log in or register

avatar
30
dwt1020 2007.12.29 02:21 

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

article

Winners of the Automated Trading Championship 2006

On the 23rd of December 2006, the first annual Automated Trading Championship 2006 was over. 258 developers had competed for the prize of totally 80 000 dollars for 12 weeks. Three developers came out on top of the competition.


avatar
2462
phy 2007.12.29 08:18 

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);

}


avatar
30
dwt1020 2007.12.29 17:26 
I thought about something like that but wasn't sure how to accomplish it..

thanks so much..

avatar
30
dwt1020 2007.12.29 17:28 
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

avatar
2462
phy 2007.12.29 20:23 
dwt1020 wrote:
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.


avatar
30
dwt1020 2007.12.29 20:41 
OH NEVER MIND.. I HAD A BRAIN FART.. I FIGURED IT OUT..

thanks so much..

d
Back to topics list  

To add comments, please log in or register