You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
MT5 has asynchronous updating of chart properties. I.e. the fact that we set a property does not mean that the terminal immediately picked it up. The ChartRedraw() function is used to have all properties re-read by the terminal. You can also use the ChartGet... ObjectGet functions, in this case properties will also be re-read.
I haven't come across this information anywhere. Stumbled across it, found the solution, now I'll know.
What is it? Here at the beginning of the section Operations with charts:
Functions for working with charts. All operations with charts are applicable only in Expert Advisors and scripts.
Functions that set properties of a chart are actually used to send commands to change it. If these functions are successfully executed, the command is included into the general event queue of the chart. Changing a graph is done while processing the event queue of the given graph.
For this reason, you should not expect an immediate visual update of the chart after calling these functions. In general case the chart update is performed by the terminal automatically by change events - new quote arrival, change of chart window size, etc. To forcibly update the chart appearance, use the ChartRedraw() command to redraw the chart.
I haven't come across this information anywhere. Stumbled across it, found the solution, now I will know.
Which is what exactly? Here at the beginning of the section Operations with charts:
I didn't say it wasn't there, I just haven't come across it (or forgot). Thanks.
What about my suggestion to generate a CHART_CHANGE event when changing chart properties such as the mouse event tracking flag? Maybe you could do that?
Of course, because this information is not available anywhere (it turns out it is, see above:))). I was tormented with this problem myself, until I turned to the service desk. There they told me that changes in properties of objects on the chart occur asynchronously. And judging by your example it concerns the properties of the chart itself.
More in the section Graphic objects:
A group of functions designed to work with graphical objects related to any specified chart.
The functions that specify properties of graphical objects, as well as the operations of creating ObjectCreate() and moving ObjectMove() objects on the chart are actually used to send commands to the chart. If these functions are successfully executed, the command is included into the general queue of events of the chart. Visual change of properties of graphical objects is performed while processing the event queue of a given chart.
For this reason, you should not expect immediate visual updating of graphical objects after calling these functions. In general case the updating of graphical objects on the chart is performed by the terminal automatically by the change events - arrival of a new quote, changes in the chart window size, etc. For forced updating of graphical objects use the ChartRedraw() command to redraw the chart.
More in section Graphic objects:
It's clear and familiar with objects, but I expected something different from the graph properties.
Should I not repeat my suggestion? Or should I put it into a service-desk?
New article MQL5 Bylaw Manual : Indicator Subwindow Controls - Buttons has been published:
Author: Anatoli Kazharsk
Very nice tutorial, I really hope you'll publish a bit more on this, thanks a lot!
Anatoli,
I want to say thank you for your contributions to the MQL5 community. Your examples have launched me forward several months in the development of my own code. Again, many thanks.
I have a need to use this "indicator" for Open Long, Open Short, Close All, and Set Trailing Stop buttons. My problem is that I need to interact with my EA so that I can
1) get to these functions within the EA, and
2) get EA recommendations by flashing the "Open Long" button when the pSAR, the CCI, the MACD or other indicators trigger.
So here's my question: How can I make the EA communicate with the indicator buttons, and make the indicator buttons interface with the EA?
Thank you in advance,
CipherPips
Thank!
I think that's the version do you like more: Graphical Interfaces I: Preparation of the Library Structure (Chapter 1)
Follow continuation of this series. There will be many detailed examples.