Can MQL5 Economic Calendar be used on the Strategy Tester?

To add comments, please log in or register
Victor Guedez
21
Victor Guedez  
Hello all,

I've searched all day long but only could find news about it saying "soon... to be used with robots and tester...". But If I launch the tester it always give me 0 events for any given date and no errors being reported. Could please someone throw some light on this?
Sergey Golubev
Moderator
114694
Sergey Golubev  

If economic calendar was written in txt file (or some other file) downloaded from some/any source - so yes (there are free NewsTrader EAs for trading and backtesting). 
You can look at the following old links/threads/etc (something shouldbe fixed and improved because those tools are very old ones but if you are the coder so you can do it).

============

Economic Calendar

The beginning:

  1. Indicators/EAs for news and trading signals - the thread
  2. Economic Calendar EA - the thread
  3. Economic Calendar EA - the second thread
  4. News Trader EA thread (MT4) 
  5. AvoidTheNews.mqh for short term systems - the thread with files
  6. News Reader Indicator! - the thread (MT4) 
  7. FF Calendar Indicator for MT - the thread (MT4) 

After

  1. All about Calendar tab and Macro Economic Events - the key thread 
  2. Nonfarm Payrolls - expert for MetaTrader 5 
  3. Studying the CCanvas Class. How to Draw Transparent Objects - the article 
  4. Regression Analysis of the Influence of Macroeconomic Data on Currency Prices Fluctuation - the article  
  5. Building an Automatic News Trader - the article  

Sergey Golubev
Moderator
114694
Sergey Golubev  

And this is new summary - 

----------------

All about Calendar tab and Macro Economic Events

Victor Guedez
21
Victor Guedez  

Hello Sergey, thanks for you reply.


But I was talking about the MQL5 Economic Calendar that is built-in. I was in a rush and forgot to include that in the Title, sorry.


PD: Could some mod edit the title to be explicit? Thanks.
Sergey Golubev
Moderator
114694
Sergey Golubev  
VicGuedez:

...

PD: Could some mod edit the title to be explicit? Thanks.

Yes, I corrected.

Victor Guedez
21
Victor Guedez  

Hello Sergey,     

Do you know why is this forbidden on Tester?

ResetLastError();
bool base_loaded = CalendarValueHistory(base_values, from_date, to_date, NULL, base_currency);
Print("Updating... Error code ", GetLastError());

This prints:

Updating... Error code 4014

Error code 4014 stands for "function not allowed" as far as I know. But the docs say nothing about it. Is this a bug or am I missing something?


PD: Worst part is that on tester "base_loaded" is "true" and no events were loaded into "base_values".

Sergey Golubev
Moderator
114694
Sergey Golubev  
VicGuedez:

Hello Sergey,     

Do you know why is this forbidden on Tester?

...

I am not a coder sorry ..

Martin
262
Martin  
Victor Guedez:

Hello Sergey,     

Do you know why is this forbidden on Tester?

This prints:

Error code 4014 stands for "function not allowed" as far as I know. But the docs say nothing about it. Is this a bug or am I missing something?


PD: Worst part is that on tester "base_loaded" is "true" and no events were loaded into "base_values".

Hey Victor,

Have you solved the Calendar implementation issue by any chance?

Thanks,

Martin

Chris70
615
Chris70  

Yes, with a little workaround the Economic Calendar can also be used in the tester: see this https://www.mql5.com/en/forum/326554#comment_13913614 thread and the links that I mention there (just click on the translate button for the links in the german forum).

[edit: I removed the attached file, use the file in my next comment instead]
Chris70
615
Chris70  

... and because many people seem to have problems to get the economic calendar working (=in both tester and live trading) and this topic seems to come up over and over again, I now added a detailed description as comments directly in the file,

so here it is with the update:

Files:
News.mqh 24 kb
To add comments, please log in or register