Hello guys, I have a question... the following is my code:
Here is the strategy tester settings:
But when it prints it prints this (It prints September 30 rates instead of the last months rates starting TIME LOCAL:
From here: https://www.mql5.com/en/docs/runtime/testing
Simulation of Time in the Strategy Tester
During testing, the local time TimeLocal() is always equal to the server time TimeTradeServer(). In turn, the server time is always equal to the time corresponding to the GMT time -TimeGMT(). This way, all of these functions display the same time during testing.
The lack of a difference between the GMT, the Local, and the server time in the Strategy Tester is done deliberately in case there is no connection to the server. The test results should always be the same, regardless of whether or not there is a connection. Information about the server time is not stored locally, and is taken from the server.

- www.mql5.com
I understand that. But why does it always give me September rates even when I change the date to a custom date say January 1 to February 20. It still gives back the September rates.
I understand that. But why does it always give me September rates even when I change the date to a custom date say January 1 to February 20. It still gives back the September rates.
From the data posted, I don't see a problem. On 2013.10.01 00:00, you are copying 100 M1 rates, so you get data from 2013.09.30 22:21 to 2013.10.01 00:00.
If you get this result with others custom date, please post logs/screenshot to demonstrate this. Also, where and when you function onStart was called ?
I don't know what to say guys....Now it works, same code same everything. Maybe I just needed to restart the MQL and MT5, I think that did the trick. Thank you very much for everything guys.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello guys, I have a question... the following is my code:
Here is the strategy tester settings:
But when it prints it prints this (It prints September 30 rates instead of the last months rates starting TIME LOCAL:
2013.10.15 21:36:21 Core 1 2013.10.01 00:00:00 OPEN: 1.35233CLOSE: 1.35225TIME: 2013.09.30 22:21:00TIME LOCAL: 2013.10.01 00:00:00
2013.10.15 21:36:21 Core 1 2013.10.01 00:00:00 OPEN: 1.35224CLOSE: 1.35222TIME: 2013.09.30 22:22:00TIME LOCAL: 2013.10.01 00:00:00
2013.10.15 21:36:21 Core 1 2013.10.01 00:00:00 OPEN: 1.35222CLOSE: 1.35221TIME: 2013.09.30 22:23:00TIME LOCAL: 2013.10.01 00:00:00
2013.10.15 21:36:21 Core 1 2013.10.01 00:00:00 OPEN: 1.3522CLOSE: 1.35215TIME: 2013.09.30 22:24:00TIME LOCAL: 2013.10.01 00:00:00
2013.10.15 21:36:21 Core 1 2013.10.01 00:00:00 OPEN: 1.35219CLOSE: 1.35238TIME: 2013.09.30 22:25:00TIME LOCAL: 2013.10.01 00:00:00
2013.10.15 21:36:21 Core 1 2013.10.01 00:00:00 OPEN: 1.35237CLOSE: 1.3524TIME: 2013.09.30 22:26:00TIME LOCAL: 2013.10.01 00:00:00
2013.10.15 21:36:21 Core 1 2013.10.01 00:00:00 OPEN: 1.35241CLOSE: 1.35236TIME: 2013.09.30 22:27:00TIME LOCAL: 2013.10.01 00:00:00
2013.10.15 21:36:21 Core 1 2013.10.01 00:00:00 OPEN: 1.35236CLOSE: 1.35239TIME: 2013.09.30 22:28:00TIME LOCAL: 2013.10.01 00:00:00
What am I doing wrong?
Thanks ahead of time.