Dear experts!
Tell me the MQL functions for accessing the data of the MetaTrader 5 economic calendar. I would like something like
datetime GetNextNews(string symbol, uint importance, datetime fromTime)
datetime&[] GetAllNews(string symbol, uint importance)double GetActualValue(string symbol, uint importance, datetime newsTime)
double GetForecastValue(string symbol, uint importance, datetime newsTime)
double GetPreviousValue(string symbol, uint importance, datetime newsTime)
There is a calendar in MT5, but there is no software access to it. Anyway, I didn’t find the relevant material in the documentation.
For MT4, expert advisors/indicators are written that load data from external resources (such as ForexFactory, Investing.Com). There is nothing working for MT5, at least in the public domain, and the built-in calendar can only be used visually, without access in the code.
Help, dear experts!
MQL functions for accessing the MetaTrader 5 economic calendar
Share
_money_maker_
Good day, I remember when we were talking about the MQL calendar, we thought that there would be not only programmatic access to the native calendar, but also access to the history of values? or am I confusing something? please tell me in this direction work is underway or is it already all development, with regard to the calendar?
nume
No, the question is not about alternative sources. You don’t need a calendar to make a calendar. There are two specific aspects here: 1) how quickly the calendar displays current values and 2) how quickly it is possible to programmatically compare current values with forecast or previous values and open trades based on this. I don’t know who is lying, but there are no calendars that are too fast on the web. Therefore, the calendar in mkl5 is of interest. The speed here should be measured in milliseconds.
alexvd
If you have activated the calendar on the chart, then nothing prevents you from programmatically running through the OBJECT_EVENT objects on the chart and counting their values. 2-line script
void OnStart()
{
for(int i=0;i<ObjectsTotal(ChartID(),-1,OBJ_EVENT);i++)
Print(""",ObjectGetString(ChartID(),ObjectName(ChartID(),i,-1,OBJ_EVENT),OBJPROP_TEXT),"" at ",datetime(ObjectGetInteger(ChartID(),ObjectName(ChartID(),i,-1,OBJ_EVENT),OBJPROP_TIME)));
}
In addition, it is now possible to request and receive alternative calendars on the network without using third-party DLLs. See the description of the WebRequest function.
marketeer
Write a request to the service Desk. In a good way, of course, you need programmatic access to the events of the built-in calendar.