Using time for backtesting

[Deleted]  

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?

[Deleted]  

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

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