Chart Events Lag

 
I'm experiencing huge lags when using chart events (e.g. CHARTEVENT_OBJECT_CLICK, CHARTEVENT_KEYDOWN). After a chart object (button) or key has been pressed the response time is around 1-2 seconds. Is it just me?
Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Types of Chart Events
  • www.mql5.com
Standard Constants, Enumerations and Structures / Chart Constants / Types of Chart Events - Documentation on MQL5
 
For me too. I think these events can happen after a new tick only, but no idea why? I made a 1 second OnTimer event handler, it has a same problem.
 
stamat:
I'm experiencing huge lags when using chart events (e.g. CHARTEVENT_OBJECT_CLICK, CHARTEVENT_KEYDOWN). After a chart object (button) or key has been pressed the response time is around 1-2 seconds. Is it just me?

I have the same problem too, is there any way to fix it ?

Buttons some times work and some times don't work.

 
  1. OnTimer/OnTick/OnCalculate/OnChartEvent can not run while the code is in one of the others. Make sure you do the minimum amount of work necessary.
  2. My GUI (MT4) has no delays with keys or button click (even with 1 second timer.) There can be a delay in removing the GUI when there is a network delay in OrderSend.
              Indicators: 'Money Manager Graphic Tool' indicator by 'takycard' Forum - Page 6
 
The problem may not be related to event handling but to the way MT5 is reflecting operations i.e. ObjectCreate / ObjectDelete etc. on graphical objects on chart. I noticed that while in MT4 these operations are processed immediately in MT5 I need to wait for a new tick to see changes on screen if I'm using CHARTEVENT_OBJECT_CLICK to initiate operation on graphical object. I resolved this by adding ChartRedraw every time I want to see the immediate effect.