Delay to get Calendar Data after publication -- Do you have Solution ? :)

 

Hi everyone, 

I'm on my first EA (with mql5) and I have some trouble. 

My goal: Get new datas from Calendar event after maximum 5sec. 

Unforthunetly I get new data sometimes after 1 minutes, sometimes 4 minutes.. It's too long ! 

I don't understand why, I use  EventTimer() to launch the trigger who check the change_id:


void OnTimer()
  {
  
   if(next_event[0].name != NULL){
      changeEventId();
   }
   else{
   }
  }
  

void changeEventId(){
   MqlCalendarValue values[];
   ulong change_id = next_event[0].change_id;
   if(CalendarValueLastByEvent(next_event[0].event_id, change_id , values) > 0){
         PrintFormat("%s: XXX  change detecte oldId: %d, newId: %d", __FUNCTION__, next_event[0].change_id, change_id);
         ArrayPrint(values);
   }
   else{
   }
}

 I hope you can a little bit help me, thank's ! 

Xasmy

 
XasmY:

Hi everyone, 

I'm on my first EA (with mql5) and I have some trouble. 

My goal: Get new datas from Calendar event after maximum 5sec. 

Unforthunetly I get new data sometimes after 1 minutes, sometimes 4 minutes.. It's too long ! 

I don't understand why, I use  EventTimer() to launch the trigger who check the change_id:


 I hope you can a little bit help me, thank's ! 

Xasmy

There is a delay in the mql5 calendar .. im struggle with it too! Do you already find out the solution? I use the ontick function to get the actual value of an event. But take sometimes a minuut to have the actual value for example nfp. And then the biggest movement is already happend 
 

How did you measure the delay? Did you look at other calendar and see that the same event is already published there but not in the MQL5 calendar?

Do you understand that the planned exact time of news release can never happen with 0 seconds precision. Usually there is a bias - in either direction - news can be published slightly earlier or slightly after planned time. And 1 minute lag is practical, imho.

 
Stanislav Korotky #:

How did you measure the delay? Did you look at other calendar and see that the same event is already published there but not in the MQL5 calendar?

Do you understand that the planned exact time of news release can never happen with 0 seconds precision. Usually there is a bias - in either direction - news can be published slightly earlier or slightly after planned time. And 1 minute lag is practical, imho.

Your totally right but there is one thing were youre wrong. 
Youre right about news launcing is not in 1 seconde. Yes it take some time.
But the mql5 calendar has a delay of 30 seconde and sometimes 2 minutes. 
I saw that with my ea. My ea print the time at the moment the actual value is online. That 's how i know about the delay. 
And yes there are websites with a very lower delay like investing.com , ive 2 screens so for me it easy to check out.
And my question was if someone has a solution for the delay? Do you have some solution? Is there something  i can do ? If you have some advice i really appreciate that. Every tip is very welkome  
 
muntje #:
And yes there are websites with a very lower delay like investing.com , ive 2 screens so for me it easy to check out.
And my question was if someone has a solution for the delay? Do you have some solution? Is there something  i can do ? If you have some advice i really appreciate that. Every tip is very welkome  

The built-in calendar is a service, which MQ provides in partnership with some (not disclosed yet) news provider, so the delays you observe can occur either on the provider side or on the MQ server - in both cases we can do nothing with this, as MQ should fix it.

The only obvious workaround is to use the external news sources with low latency.