Need help for calendar eco and variable

GREED  
Hello,



I can't do what I want to do, despite several hours of research.

I would like to get the time of the next economic announcement of the day which has a high importance (I already found the formula: ENUM_CALENDAR_EVENT_IMPORTANCE, but I don't know how to use it) to store it in a variable and when the time of this announcement is over, it goes to the next announcement

I don't know if my explanations are very clear, if needed I can explain more in detail.



Thank you in advance for your help!

fxsaber  
#include <fxsaber\Calendar\Calendar.mqh> // https://www.mql5.com/ru/code/32430

input int inAmountNews = 5;

void OnTick()
{
  CALENDAR Calendar;
  
  Calendar.Set();
  
  Comment(Calendar.ToString(0, inAmountNews));
}


GREED  
Thank you very much for your precious help!
fxsaber  
GREED #:

I just want to display the date and time of the announcement, like on the screen, is it possible?

#include <fxsaber\Calendar\Calendar.mqh> // https://www.mql5.com/ru/code/32430

void OnTick()
{
  CALENDAR Calendar;
  
  Calendar.Set();
  
  Comment(Calendar[0].time);
}
GREED  
fxsaber #:

Thank you very much! And especially thank you for responding so quickly!