You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.
Thank you for your reply Alain,
Tried the property, didn't help - also, I have previously commented out the section where I call Create() on the indicator wrappers (all of them are wrapped in objects from include/Indicators), didn't help either.
I guess you are right, I will have to strip it down to a minimal portion of code reproducing the issue.
Ugh, going to be tedious :(
Here's the log, I can't spot anything useful, unfortunately:
Actually, thanks for everyone's help, I found at least one culprit: in my code I was trying to be smart and skip ticks where they didn't require processing.
The code looked like this:
Turned out one of the TF variables was not initialized.
MT4 lets it pass somehow, but MT5 doesn't.
Took me few hours of stripping the code off before I got it.
It would have helped if MT has logged that I'm requesting negative timeframe ;)
In addition to that, I was loading the value for ENUM_APPLIED_PRICE from the set that was saved in MT4.
Any example of PRICE_CLOSE (which is = 0 in MT4) was obviously invalid in MT5.
Another one down.
Same thing happened to me when I tried testing my EA with historical data from a week ago. It seems only a specific asset produces the issue. Problem is, I've developed this EA on MetaTrader 5 from the beginning and it worked before. Plus I don't recall using any non-initialized variables. Well, I've got some work to do, stripping down 4000 lines of code (not counting several .mqh files) to a bare minimum...
Edit: it seems the problem in my case was simply the lack of historical data on the cloud servers. Strange...
I fell on this problem.
I solved it by changing the period, my EA was computing periods from input parameters, maybe it ouput an inexisting period.
Same error here, it happened first on one of my PCs and 30 minutes later on another PC! I lost an hour on the first PC changing EAs, changing symbols, inputs and so on. Then I went to the other PC, made 5-10 successful backtests and suddenly the same error appeared. (I have optimized and backtested this EA literally hundreds of times before that)
I can run the same EA with another symbol.. which I find very strange.
No solution yet.
P.S. I have enough RAM and harddisk space on both machine
SOLVED - my brokerage has quotes issues at the moment. I cant see any tick data for EURUSD between 2007 and august 2024. My base currency is EUR. Every time I try to replace the EURUSD data with a full data set AND the pc is connected to the internet, the problem reappears. When I cut the connection, mt5 does not replace my set with the broker's broken set and the problem is gone.
its the Chart Timeframes. I would say it is a "bug" but it could also be a "feature". lolz. You got ask the developrs.
PERIOD_H1 == 60 to in MT4
but
PERIOD_H1 = 16385 in MT5
in MT4, period is basically the number of seconds. H1 = 60.
in MT5, this is true for anything under 60 mins only. From PERIOD_H1 and above, the integer assigned is NOT the number of seconds anymore.
check #1 of this article for details >> https://www.mql5.com/en/articles/81
How would you want someone to help ? Your issue is obviously related to your code, which we can't see.
Fix your code.
It's NOT the code, To execute the code you need the 'History'' which is not build correctly. I have the same error with experts which did run on this machine - and still do run on another machine - using the SAME broker and account. It MUST BE anything with Metatrader or the tester.
Same error here, it happened first on one of my PCs and 30 minutes later on another PC! I lost an hour on the first PC changing EAs, changing symbols, inputs and so on. Then I went to the other PC, made 5-10 successful backtests and suddenly the same error appeared. (I have optimized and backtested this EA literally hundreds of times before that)
I can run the same EA with another symbol.. which I find very strange.
No solution yet.
P.S. I have enough RAM and harddisk space on both machine
SOLVED - my brokerage has quotes issues at the moment. I cant see any tick data for EURUSD between 2007 and august 2024. My base currency is EUR. Every time I try to replace the EURUSD data with a full data set AND the pc is connected to the internet, the problem reappears. When I cut the connection, mt5 does not replace my set with the broker's broken set and the problem is gone.
Here it happened with two (2) different brokers which are not relatet to each other. Visual and without visual, From Open Prices Only until Ebery tick based on real ticks.
Here it happened with two (2) different brokers which are not relatet to each other. Visual and without visual, From Open Prices Only until Ebery tick based on real ticks.
why argue against messages that are not even current? If you have an issue, then, post your code. Not many get any help -- that dont have any code to show -- first.
Those that do get responses, are mostly like "we can not see your screen", or "we can not read your mind", or my favourite "our crystal balls are broken/cracked".
The issues above, are usually due to the coder that has failed to confirm that the ea has all of the candles that it requires, prior to the start of trading; and more often than not the coder has also failed to use the "debugger", a feature of meta editor.