Using time for backtesting

 

Hi,

I am currently rewriting one of EAs, and I do lot of backtesting using internal MT4 tester.

The problem is that I am using time functions to limit trading time to periods that I feel are good for trading, but while testing it seems that MT4 is using current time, and not time in past data?

Any ideas?

 

Server time is modeled during backtesting. Are you using localtime instead of server time?

 
Use TimeCurrent() instead of TimeLocal().
 
TimeCurrent() works in EA's not in CI's.