Good morning, i''m new in the mql5 community.
I created an indicator to show day separators.
First I coded it using the default OBJ_VLINE, but then I moved to canvas since I want to have the line transparent.
At the moment I'm just updating the Canvas if OnChartEvent is called (for easier testing), but I've noticed that when I scroll the chart, the lines "lags", and they take some time to update to the new position.
Is there something is doing wrong? Maybe some slow function? Or am I missing something?
Thanks in advance.
In my opinion, at the moment there is only one way to solve the problem of delays. It is necessary to disable the native chart, and draw this chart also on the canvas. I understand that you will not like this solution. But until MQ changes the lagging event model with very slow ChartGet functions..., there is no other way to do it. Moreover, this approach has several great performance advantages, but this is a separate topic.
It is also necessary to remember that in the Expert this lag will be several times less than in the indicator.
How to create your own chart on canvas, you can see this example(The time for forming a canvas chart with bars is approximately 0.1-0.2 milliseconds.):
In my opinion, at the moment there is only one way to solve the problem of delays. It is necessary to disable the native chart, and draw this chart also on the canvas. I understand that you will not like this solution. But until MQ changes the lagging event model with very slow ChartGet functions..., there is no other way to do it. Moreover, this approach has several great performance advantages, but this is a separate topic.
It is also necessary to remember that in the Expert this lag will be several times less than in the indicator.
How to create your own chart on canvas, you can see this example(The time for forming a canvas chart with bars is approximately 0.1-0.2 milliseconds.):
I will try to implement what you suggested, as it seems to be the only solution if I want to use transparent objects without scroll "lag".
My only question now is if it is worth it for just a "sessions and days separator" indicator, maybe I should use this for more complicated projects...
Lets hope MQ will solve this in the near future...
Thanks for your response.
Hi Nikolai,
I will try to implement what you suggested, as it seems to be the only solution if I want to use transparent objects without scroll "lag".
My only question now is if it is worth it for just a "sessions and days separator" indicator, maybe I should use this for more complicated projects...
Lets hope MQ will solve this in the near future...
Thanks for your response.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Good morning, i''m new in the mql5 community.
I created an indicator to show day separators.
First I coded it using the default OBJ_VLINE, but then I moved to canvas since I want to have the line transparent.
At the moment I'm just updating the Canvas if OnChartEvent is called (for easier testing), but I've noticed that when I scroll the chart, the lines "lags", and they take some time to update to the new position.
Is there something is doing wrong? Maybe some slow function? Or am I missing something?
Thanks in advance.