MT5 Tester: history cache build error

 
Hi I have already done some tests with the metatrader5 successfully, but now always comes the error message :history cache build error. Unfortunately, I have google so far no solution for the problem can find. Does anyone know how to fix the error?
 

Very similar story here: I have an expert [that I built myself].

On the same instrument (EURUSD), same time period [last year, starting from 01/01/2021] and with the same input parameters it runs successfully in visual mode, but fails quite miserably in the non-visual backtest, feeding ": history cache build error" non-stop.

The expert was just ported from MQL4 to MQL5, seemingly works on live quotes and, as I mentioned, tests fine in visual.

I do have a few safeguards in my code to skip some sections if it's testing and not visual, checked them all, nothing suspicious.

I tried flipping through the different "modelling" options and different time periods, to no avail.

Unfortunately the error itself is not very descriptive and I couldn't find great deal of information on that error online - any help/advice on how can I debug it would be greatly appreciated.

Like, what does that actually mean, what could be causing it, is there anything in my code I should possibly check/verify that might be causing it?

Can't share the snippet, unfortunately - tens of intertwined libraries there just migrated from MQL4.

 
tory_ :


What build and what operating system? An example of how to take and insert the necessary information:

Forum on trading, automated trading systems and testing trading strategies

Very Glitchy MetaTrader

Vladimir Karputov, 2021.03.16 04:20

If you have a question, first of all you should show the first three lines from the 'Journal' tab


(select these lines, copy to the clipboard and paste into the message using the button Code). It should look like this:

2021.03.16 05:13:07.133 Terminal        MetaTrader 5 x64 build 2832 started for MetaQuotes Software Corp.
2021.03.16 05:13:07.134 Terminal        Windows 10 build 19042, Intel Core i7-9750H  @ 2.60GHz, 26 / 31 Gb memory, 842 / 947 Gb disk, IE 11, UAC, GMT+2
2021.03.16 05:13:07.134 Terminal        C:\Users\barab\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075

 
Vladimir Karputov:

What build and what operating system? 

2021.07.26 21:09:18.415 Terminal        Darwinex MetaTrader 5 x64 build 2981 started for Tradeslide Trading Tech Limited
2021.07.26 21:09:18.417 Terminal        Windows 10 build 19043, Intel Core i7-4770  @ 3.40GHz, 1 / 15 Gb memory, 772 / 931 Gb disk, IE 11, UAC, GMT+8
2021.07.26 21:09:18.417 Terminal        C:\Users\Rigal\local\MT5-Darwinex
 
tory_ :

You can experiment: install another MetaTrader 5 in a new folder, connect to the 'MetaQuotes-Demo' server and update to build '3003'.

 

Didn't help, unfortunately:

Is there any limit on number of pairs/timeframes an expert could use in test?

My expert is built of "blocks" each implementing the strategy.

It seems my test runs fine for a subset of these blocks on a subset of symbols.

Say, if I use one strategy and enable 10 symbols - it works.

Same expert doesn't work if I turn few other strategies on.


However, it's not just the number of permutations: one particular strategy, if enabled on just one symbol - already causes the error above.

So it seems to have something to do with my code - but I don't know where to start digging, the error message is ever helpful :)

 

The problem still persists.

Any help would be appreciated.

 
tory_:

The problem still persists.

Any help would be appreciated.

How would you want someone to help ? Your issue is obviously related to your code, which we can't see.

Fix your code.

 
Alain Verleyen:

How would you want someone to help ? Your issue is obviously related to your code, which we can't see.

Fix your code.

Bold statement for the issue that

- doesn't point to any problem with the EA

- same EA works perfectly fine on a chart

- only appears for some EAs and not for the others

- for some EAs only happens when you test it not in visual mode and doesn't happen once you switch to visual

- nothing suggests what the actual problem is, there are no errors/warnings in the log


Clearly, there could be something about the code that triggers the problem

But sharing somewhat a hundred of .mqh files making the library layer won't help anyway: I can't imagine anyone willingly digging through that amount of perfectly compiling code trying to spot the reason for the terminal malfunction.


I'm merely asking for a guidance on where should I dig, a direction - because this error message is really not helpful, I can't find any explanation anywhere on what could be the cause, what might be triggering it.


Here's the EA though and a set.

Give it a try: I just ran a test on EURUSD M30, real ticks since 2015. Works in visual mode, fails miserably otherwise.

I randomly commented out portions of code creating indicators, timers, whatever else I suspected might contribute, all in vain.

 
tory_:

Bold statement for the issue that

- doesn't point to any problem with the EA

- same EA works perfectly fine on a chart

- only appears for some EAs and not for the others

- for some EAs only happens when you test it not in visual mode and doesn't happen once you switch to visual

- nothing suggests what the actual problem is, there are no errors/warnings in the log


Clearly, there could be something about the code that triggers the problem

But sharing somewhat a hundred of .mqh files making the library layer won't help anyway: I can't imagine anyone willingly digging through that amount of perfectly compiling code trying to spot the reason for the terminal malfunction.


I'm merely asking for a guidance on where should I dig, a direction - because this error message is really not helpful, I can't find any explanation anywhere on what could be the cause, what might be triggering it.


Here's the EA though and a set.

Give it a try: I just ran a test on EURUSD M30, real ticks since 2015. Works in visual mode, fails miserably otherwise.

I randomly commented out portions of code creating indicators, timers, whatever else I suspected might contribute, all in vain.

<*. ex* file deleted>

 
tory_:

Bold statement for the issue that

- doesn't point to any problem with the EA

- same EA works perfectly fine on a chart

- only appears for some EAs and not for the others

- for some EAs only happens when you test it not in visual mode and doesn't happen once you switch to visual

- nothing suggests what the actual problem is, there are no errors/warnings in the log


Clearly, there could be something about the code that triggers the problem

But sharing somewhat a hundred of .mqh files making the library layer won't help anyway: I can't imagine anyone willingly digging through that amount of perfectly compiling code trying to spot the reason for the terminal malfunction.


I'm merely asking for a guidance on where should I dig, a direction - because this error message is really not helpful, I can't find any explanation anywhere on what could be the cause, what might be triggering it.


Here's the EA though and a set.

Give it a try: I just ran a test on EURUSD M30, real ticks since 2015. Works in visual mode, fails miserably otherwise.

I randomly commented out portions of code creating indicators, timers, whatever else I suspected might contribute, all in vain.

An ex5 is of no help.

A log would maybe provide some useful information.

Otherwise there is only one thing to do, isolate the minimal code to reproduce the issue.

There is no useful information anywhere about this "history cache build error".

An idea but I don't see how it would be related, but who knows. Are you using "#property tester_everytick_calculate" in your code ? If not try to add it.

Reason: