Hi all,
I'd like to know what value DayOfYear()/DayOfWeek() would return if I tried to use them on a Saturday/Sunday. Would I get a value corresponding with a weekend (i.e Saturday/Sunday) or would it would return a value corresponding with the time of the last tick before market close for the week (i.e a Friday)?
I'd test it myself but I can't do it in real time as it's a weekday and I'm unaware of how to simulate this in strategy tester (if it's possible) as I obviously can't start on a weekend.
Thanks in advance!
They will use the time of the last tick.
This is not necessarily the last tick on Friday as some brokers offer cryptos at the weekend.
I will move this to the MQL4 and MT4 section. In future please post in the correct section.
- DayOfYear is based off of the last server time. Once the market is closed, there are no ticks, so server time will not be changing.
- You can see this by using OnTimer (which does not work in the tester.)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I'd like to know what value DayOfYear()/DayOfWeek() would return if I tried to use them on a Saturday/Sunday. Would I get a value corresponding with a weekend (i.e Saturday/Sunday) or would it would return a value corresponding with the time of the last tick before market close for the week (i.e a Friday)?
I'd test it myself but I can't do it in real time as it's a weekday and I'm unaware of how to simulate this in strategy tester (if it's possible) as I obviously can't start on a weekend.
Thanks in advance!