iTime and Strategy Tester

 

My EA is set to trade only at certain times during the day (not between London close and Asian open), but I cannot get this to work in the strategy tester. 


I thought I might be able to use iTime, but don't know how to get iTime to return values for "hour."

Does anyone know how to get the "hour" when using the stategy tester. Hour() only references the current time and not the Strategy Tester time.

Many thanks.

 
TimeHour(TimeCurrent())
 
Irtron:


TimeHour(TimeCurrent())



Thanks so much Irtron!

 

You might want to check the actual value returned by TimeCurrent() on your system.


On my system, for forward testing, I get TimeCurrent() which is different from Time/iTime which is expected due to different timezones.


During back testing however, TimeCurrent() is the same as Time/iTime.

Reason: