it's working w/ live or demo but in strategy tester i don't have any results ...
in strategy tester i see results if i remove the hour and minute part like:
if(DayOfWeek()==5)
if(DayOfWeek()==5 && Hour() == EntryHour && Minute()>=EntryMinute)
According to the Documentation https://docs.mql4.com/dateandtime/DayOfWeek should be OK in the Strategy Tester, "Note: At the testing, the last known server time is modelled."
Before the if add a print, Print("Day of the week is: ", DayOfWeek()); see if you get what you expect to get . . . if you do then you have another issue . .
- https://www.mql5.com/en/forum/127483 reported that DayOfWeek() always returns 5 in the tester. Probably the same with Hour and Minute - returning the time of test start.
datetime now = TimeCurrent(); if( TimeDayOfWeek(now)==5 && TimeHour(now) == EntryHour && TimeMinute(now)>=EntryMinute)
- Or use my code
thanks, but the day part is working without hour and minute ...
the problem is:
&& Hour() == EntryHour && Minute()>=EntryMinute)
could it be that Strategy Tester is not working w/ day, hour and minute condition ?
but i don't get any result ... no orders ... nothing ... :-)
only if I removed hour() and minute() it's working
it starts counting the minutes from:
2011.08.09 17:18 EA EURUSD,M5: Hour is: 17 Minute is 18
to
2011.08.30 23:59 EA EURUSD,M5: Hour is: 23 Minute is 59
hm - the condition should be open pending order every friday at 23:58
on live server it is working, but in tester nothing happen ...
it starts counting the minutes from:
2011.08.09 17:18 EA EURUSD,M5: Hour is: 17 Minute is 18
to
2011.08.30 23:59 EA EURUSD,M5: Hour is: 23 Minute is 59
hm - the condition should be open pending order every friday at 23:58
on live server it is working, but in tester nothing happen ...
Add in the Day to the Print, maybe your test data doesn't have that time on Friday . . my local Friday midnight I can't place a trade because the markets are closed . .

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
how to make backtest possible for this code?