>Time Filter

 
I've been searching everywhere to try to find a way to code a time filter - ie. only trade between 8:00 and 17:00. I am new to MQL4, but am learning, so if anyone has a suggestion, could you please tell me where in the code to place it and what to use?

Thanks a million pips!

Scott
 
Scotty

Just go to this link.

http://www.cubesteak.net/2006/08/3-fold-trading-hours-filter-for-ea/

A programmer has already put one together and you should be able to extract the code from his little free EA posted there.

Regards

FxNorth
 
Great, thanks! That look exactly like what I need. However... Where in the code should I be placing this code? It doesn't seem to be working anywhere I place it. Is there something else I need to do to make it work?

Edit:
In reading the page is says:
"Simply wrap all your EA logic in the call to HourlyFilter()"

and

"Pseudo code for placement in the Start() function is:
if HourlyFilter()
{
PerformEALogic();
}
else return (0);"

Being new to MQL4, I'm not sure exactly what this means. I'm sure it's very simple, but I'm a noob ;-)


Thanks again!
 
Scott

Sorry my friend, I am not a programmer. You are not far off the mark though and will need to post again to ascertain what line of logic it is you are missing.

If you don't get an answer here, I suggest you go to www.forex-tsd.com sign up and post a new thread like "Time filter programming question".

TSD is free and I'm sure someone will answer quickly.

Regards

FxNorth
Reason: