Delayed drawing and chart updating with MT5/MQL5

 

Does anyone know this issue? Could not find anything about it.

1. Clicking the magnifying glass button changes the zoom, but the chart will update only when a new tick comes in. This means, during weekends never, and during low frequent trading hours simply too late.

2. Comparing the simple Controls.mq4 / Controls.mq5 - within MT4 everything is smooth, but within MT5 everything is delayed like hell and almost unusable. Normal clicking action not a problem at all, but dragging something on the chart ... horrible


Is this a setting i have overlooked or is this a "special feature" of MT5?

Doerk 

 
Doerk Hilger:

Does anyone know this issue? Could not find anything about it.

1. Clicking the magnifying glass button changes the zoom, but the chart will update only when a new tick comes in. This means, during weekends never, and during low frequent trading hours simply too late.

2. Comparing the simple Controls.mq4 / Controls.mq5 - within MT4 everything is smooth, but within MT5 everything is delayed like hell and almost unusable. Normal clicking action not a problem at all, but dragging something on the chart ... horrible


Is this a setting i have overlooked or is this a "special feature" of MT5?

Doerk 

You have force chart updating after make changes

https://docs.mql4.com/chart_operations/chartredraw

ChartRedraw - Chart Operations - MQL4 Reference - MQL4 Documentation
  • docs.mql4.com
ChartRedraw - Chart Operations - MQL4 Reference - MQL4 Documentation
 

See issue #1 - has nothing to do with it.

But anyway, thx for helping. The CChart::Redraw is necessary with MQL5 and not with MQL4, at least not for chart objects but for memory bitmaps.
 
Doerk Hilger:

Does anyone know this issue? Could not find anything about it.

1. Clicking the magnifying glass button changes the zoom, but the chart will update only when a new tick comes in. This means, during weekends never, and during low frequent trading hours simply too late.

2. Comparing the simple Controls.mq4 / Controls.mq5 - within MT4 everything is smooth, but within MT5 everything is delayed like hell and almost unusable. Normal clicking action not a problem at all, but dragging something on the chart ... horrible


Is this a setting i have overlooked or is this a "special feature" of MT5?

Doerk 


Us OnTimer . without tick Set Even for a Mili Second so indicator will execute in mili seconds code. i am sure it will work for you

 
Muhammad Mudasir:

Us OnTimer . without tick Set Even for a Mili Second so indicator will execute in mili seconds code. i am sure it will work for you


I use this all, this is not the reason and does not solve issue #1. Imho nr 1 is nothing but a bug, as many i already found in mql5 as well as in mql4, but MQ is not really willing to solve them, even not if they produce crashes of the terminal.

 
Doerk Hilger:

I use this all, this is not the reason and does not solve issue #1. Imho nr 1 is nothing but a bug, as many i already found in mql5 as well as in mql4, but MQ is not really willing to solve them, even not if they produce crashes of the terminal.

can you show us code so we have better answer
 

Which code? Just click on the magnifying glass at the weekend and see what happens ;)

 
Doerk Hilger: Which code? Just click on the magnifying glass at the weekend and see what happens ;)

I tried it myself on an EUR/USD M15 chart, but could not replicate the issue. The chart updates immediately without any problem, even when running several Indicators on it (Windows 10 Pro, 64 bit, MT5 build 1643 25 Jul 2017).

Do you having anything else running on it that might be indirectly causing the problem?

 
Fernando Carreiro:

I tried it myself on an EUR/USD M15 chart, but could not replicate the issue. The chart updates immediately without any problem, even when running several Indicators on it (Windows 10 Pro, 64 bit, MT5 build 1643 25 Jul 2017).

Do you having anything else running on it that might be indirectly causing the problem?


Hmm, weird. No, there is nothing. I mean, yes, the chart updates, but when I click on (+), the rightmost bar isnt visible anymore - I am somewhere in the middle - and when I click (-), there is lots of space between the rightmost bar and the price-scale. The adjustment of the space between the price-scale and the rightmost bar occurs only when a new tick comes in. 

 
Doerk Hilger: Hmm, weird. No, there is nothing. I mean, yes, the chart updates, but when I click on (+), the rightmost bar isnt visible anymore - I am somewhere in the middle - and when I click (-), there is lots of space between the rightmost bar and the price-scale. The adjustment of the space between the price-scale and the rightmost bar occurs only when a new tick comes in. 

Looks like your initial explanation of the situation is completely misleading and you should update it.

What you don't seem to realise is the "Zoom" scaling works differently in MT4 and MT5. In MT4 (with Auto-Scroll enabled), it keeps the right-hand side aligned, while in MT5, it keeps the left-hand side aligned.

However, in both cases, be it in MT4 or MT5, the chart will not automatically scroll (if auto-scrolling is enabled) until a new tick arrives and it has been like that as far back as I remember, at least since I first started using MetaTrader.

It is especially noticeable even without using the Zoom, when you manually scroll back a chart in time that has Auto-Scroll enabled. You will be able to it, until a new tick arrives and realigns it up all again.

EDIT: When using Zoom in MT4 it aligns (if Auto-Scroll is enabled) by the Right-Hand-Side (of the entire chart), but when Auto-Scroll is disabled, it aligns by the Left-Hand-Side (of the visible part).

In MT5 however, irrespective of whether Auto-Scroll is enabled or not, it always aligns by the Left-Hand-Side of the visible part (hence, why it will not update, until a tick arrives, if auto-scroll is enabled).

 

MT4 jumps back immediately without a tick. Anyway this is pretty much senseless to wait for the next tick ... I dont understand anyway why MQ stucks with this terrible outdated way of charting but thats another topic.