Trabalho concluído
Termos de Referência
I found a code here, that allows displaying the MQL5 Calendar news in real and backtesting mode as vertical lines, with the news for one currency in one color and the news of the other currency in a different color. However, I am getting an error ("array out of range ") that I want you to fix.
In addition, I want you to create another function that will draw a horizontal line covering some time before and after a news event.
This function will be called "DisplayNewsWindow" and will take as variables (Currency, EventName, and WindowHours). Say that for the Currency , "USD", the EventName "Wholesale Sales m/m" will be on January 10 at 8am, so if I use DisplayNewsWindow ("USD","Wholesale Sales m/m", 2), and horizontal line at the bottom of the chart should appear between 6am and 10 am on that day (i.e., 2hours before and after the news event). The currency name and News event name should appear as tooltip, as you mouse hover the horizontal bar.
I attach the files: "News" is a Class file that saves and updates the list of events in a local computer. "NewsEA" is the EA in which that function is used. You need to create the DisplayNewsWindow function in the News file and use it in the EA.
I think the error is in the fucntion CNews::next2
Ultimately, I want the news events drawn as vertical lines in two colors (one for each currency in a symbol), and some specific news drawn as horizontal lines in the chart, also color coded by currency.