Running the attached (and other) EA(s) in the debugger fails to load the Calendar - or am I missing something?
This call:
returns true(???) but the array is empty and the error is set to 4014 = ERR_FUNCTION_NOT_ALLOWED.
The documentation does not say anything about it (debugger & 4014) and the listed errors are only:
I even allowed (just in case) the url: https://www.mql5.com
If the function returns true there is no point to check _LastError which could be set to an unrelated number.
Please post that compiles if you want some to reproduce the issue and help.
If the function returns true there is no point to check _LastError which could be set to an unrelated number.
Please post that compiles if you want some to reproduce the issue and help.
Hmm?? It runs in the debugger so it compiles without error.
Here the moment before CalendarValueHistory() is called:
_LastError = 0 and everything is set correctly.
An now the moment right after this call:
CalendarValueHistor() has returned true, _LastError has been set to 4014, and Print() will be processed right away, this is printed in the log of the debugger:
2023.03.23 07:07:51.527 2023.01.06 00:00:31 OK?? m Test_Cal 47 Calendar: EUR ArrSz: 0 err: 4014
Anyway here is the files I just run
Hmm?? It runs in the debugger so it compiles without error.
Here the moment before CalendarValueHistory() is called:
_LastError = 0 and everything is set correctly.
An now the moment right after this call:
CalendarValueHistor() has returned true, _LastError has been set to 4014, and Print() will be processed right away, this is printed in the log of the debugger:
Anyway here is the files I just run
You run it on the Strategy Tester ? It effectively doesn't work with the Strategy Tester.
There is actually also an error in the documentation, the function returns an int, not a bool. So in your case it returns -1 which effectively means an error 4014.
On a live chart:
2023.03.23 09:08:09.396 test_Calendar__1 (GBPJPY,H1) OK?? m Test_Cal 47 Calendar: GBP ArrSz: 55 err: 0
The documentation should be updated and include these information.
![MQL5 Economic Calendar / CalendarValueHistory in backtest - How to access the built-in economic calendar during backtest MQL5 Economic Calendar / CalendarValueHistory in backtest - How to access the built-in economic calendar during backtest](https://c.mql5.com/36/62/mql5-economic-calendar-calendarvaluehistory.jpg)
- 2019.11.15
- www.mql5.com
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Running the attached (and other) EA(s) in the debugger fails to load the Calendar - or am I missing something?
This call:
returns true(???) but the array is empty and the error is set to 4014 = ERR_FUNCTION_NOT_ALLOWED.
The documentation does not say anything about it (debugger & 4014) and the listed errors are only:
I even allowed (just in case) the url: https://www.mql5.com