MT4 Strategy Tester Returns Zero for Other Timeframes
Posted: Wed Sep 27, 2023 8:21 am
Hello everyone,
I am encountering an issue with the MT4 Strategy Tester when running my Expert Advisor (EA). The problem arises when my EA requests data from timeframes other than the one the tester is running on; it consistently returns a value of zero.
Here's a simplified excerpt from the code that demonstrates the issue:
void OnTick()
{
Print(iClose(NULL, PERIOD_M1, 1));
Print(iClose(NULL, PERIOD_M5, 1));
Print(iClose(NULL, PERIOD_M15, 1));
}
When I run the Strategy Tester on the M1 timeframe, it returns the correct closing price for M1, but returns zero for M5 and M15. The same pattern holds true when testing on other timeframes; it only returns the correct value for the timeframe being tested.
Here are some additional details:
All necessary data has been downloaded and is correctly located in the respective folders:
.fxt files in /tester/history
.hst files in /history/Servername
The tester does not overwrite or redownload data upon starting.
The modeling quality is 99.9% in each test.
MT4 Version: 4.00 build 1380
Tickstory Version: 1.9.7.11 (Build date: 2023-07-05)
I am quite confident that my code is correct, as the issue persists even with this simplified code snippet. Has anyone else experienced this issue, or does anyone have suggestions on how to resolve it?
Thank you in advance for your assistance!
I am encountering an issue with the MT4 Strategy Tester when running my Expert Advisor (EA). The problem arises when my EA requests data from timeframes other than the one the tester is running on; it consistently returns a value of zero.
Here's a simplified excerpt from the code that demonstrates the issue:
void OnTick()
{
Print(iClose(NULL, PERIOD_M1, 1));
Print(iClose(NULL, PERIOD_M5, 1));
Print(iClose(NULL, PERIOD_M15, 1));
}
When I run the Strategy Tester on the M1 timeframe, it returns the correct closing price for M1, but returns zero for M5 and M15. The same pattern holds true when testing on other timeframes; it only returns the correct value for the timeframe being tested.
Here are some additional details:
All necessary data has been downloaded and is correctly located in the respective folders:
.fxt files in /tester/history
.hst files in /history/Servername
The tester does not overwrite or redownload data upon starting.
The modeling quality is 99.9% in each test.
MT4 Version: 4.00 build 1380
Tickstory Version: 1.9.7.11 (Build date: 2023-07-05)
I am quite confident that my code is correct, as the issue persists even with this simplified code snippet. Has anyone else experienced this issue, or does anyone have suggestions on how to resolve it?
Thank you in advance for your assistance!