I have looked around, and I have determined how to use the time of day / day of week to determine strategies in my EA. My question is, does this actually work in the strategy tester? (I am not sure how the strategy tester pulls the time) - Props to Raptor for this source code btw.
Additionally my preference in live trading would be to pull from a ntp so I could use GMT, so that regardless of server time, my EA operates when I want it to. I understand this would be forward testing only, without writing test code to provide dummy info.
For different days, such as sat / sun I have code like this in several places
Will this perform properly in Strategy testing? - I understand that some data is grabbed from the server at start of program, and other is grabbed from server, and without restating documentation I believe I am not using any "start of program" data, but I am unsure of proper operation in strategy testing.
Thank you for looking :)
Thank you very much. So TimeDayOfWeek(TimeCurrent()) will return the current day of the week on the server. How do I manage to always work on GMT time, regardless of server used? (for example I give to my buddy who uses FXDD instead of FXCM and the servers are in different time zones, so the trading windows would be different) Right now I have the departure from server time as a manual input, but hoping for something better.
Thanks
// https://www.mql5.com/en/forum/127483 reports DayOfWeek() always returns 5 in tester. // https://www.mql5.com/en/forum/144021 2013.03.18 (Build 509) reports no problems. // https://www.mql5.com/en/forum/146843/page2#840945 fixed in 2013
So DayOfWeek now works fine, but you'll still need TimeDayOfWeek(gmtTime)- Convert server time to gmt then do your tests. See my code
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have looked around, and I have determined how to use the time of day / day of week to determine strategies in my EA. My question is, does this actually work in the strategy tester? (I am not sure how the strategy tester pulls the time) - Props to Raptor for this source code btw.
Additionally my preference in live trading would be to pull from a ntp so I could use GMT, so that regardless of server time, my EA operates when I want it to. I understand this would be forward testing only, without writing test code to provide dummy info.
For different days, such as sat / sun I have code like this in several places
Will this perform properly in Strategy testing? - I understand that some data is grabbed from the server at start of program, and other is grabbed from server, and without restating documentation I believe I am not using any "start of program" data, but I am unsure of proper operation in strategy testing.
Thank you for looking :)