MQL5: Writing a News Advisor
Dear friends, colleagues Forex traders and programmers, - hello!
Today's lesson will be devoted to the economic calendar, which is built into Metatrader 5 by default. Using MQL5, we will learn how to “pull out” news and write an adviser using the functions that we will develop.
To create an expert, we use the standard MQL5 classes, thanks to which development is carried out as quickly and efficiently as possible. Well, how to do it, you will learn from our today's video tutorial!
So, the functions are developed and the adviser is written. Alas, it will not be possible to test it in the strategy tester, because functions of the economic calendar are not supported in it. But you can put an expert on a demo account and watch his work. Let's modify our advisor for more flexibility:
- Add the external parameter “GMTOffset” or calculate it automatically, change the expert code taking this parameter into account.
- Add the external parameter “StartBeforeNews” (time in minutes) to place pending orders before the news. Refine the corresponding function.
Previous MQL5 Lessons: