- Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6.
- Indicators with alerts/signal
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
I tried to test my strategy in the MT4 tester. My strategy requires some minimum amount of bars in the window. I downloaded the full archive so my usual trading windows have the full hystory and even the testing window seems have the full history. But when I insert a piece of the code into my advisor like Print (Bars), it shows me that the testing window has only few thousand bars. Why is the case? Thank in advance for any help.
First make sure you've set the needed number of bars in your history/chart here: MT4 >> Tools >> Options >> Charts tab.
Then downlowad that history in MT4 >> Tools >> History Center.
First make sure you've set the needed number of bars in your history/chart here: MT4 >> Tools >> Options >> Charts tab.
Then downlowad that history in MT4 >> Tools >> History Center.
Yes, I did it, thank you. Downloaded the full history of quotes and set the required amounts in the both boxes. But it didn't help. And I said both the trading window and the testing window reflect the full history of quotes, e.g. the testing windows reflects the history down to 1999.
But when I put into my expert the code like this:
if(Bars<MinInterval)
{
Print (Bars);
Print("Not enough bars");
return;
}
,
it is reflected in the expert's report tab like this:
2019.06.05 20:10:49.207 2019.06.04 23:59:12 kolm EURUSD,M15: Not enough bars
2019.06.05 20:10:49.207 2019.06.04 23:59:12 kolm EURUSD,M15: 28056
2019.06.05 20:10:49.207 2019.06.04 23:58:54 kolm EURUSD,M15: Not enough bars
2019.06.05 20:10:49.207 2019.06.04 23:58:54 kolm EURUSD,M15: 28056
Taking into account that it is a 15 min timeframe, and so with the the history down to 1999 it must contain about 500000 bars, 28056 as reflected in the expert is not evidently the correct number.
28056 is the number of bars from the initial date to the end date. So for a reason the expert just doesn't the history before the initial date.
Did you restarted your MT4 terminal for these changes to take effect?
Try putting your history max bars settings to 1000000 or 10000000 and restart your platfom, then download the needed history from MT4 >> Tools >> History Center.
Did you restarted your MT4 terminal for these changes to take effect?
Try putting your history max bars settings to 1000000 or 10000000 and restart your platfom, then download the needed history from MT4 >> Tools >> History Center.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use