Hi!
The following code demonstrates the issue. Objects are created but OnChartEvent function is never called. If somebody knows why it should not work or how to make it work please help me.
It looks to me like you are setting up several charts; but OnChartEvent() runs on a single chart, i.e. it will not catch all events from all charts, but the events from the chart the EA is loaded to
It looks to me like you are setting up several charts; but OnChartEvent() runs on a single chart, i.e. it will not catch all events from all charts, but the events from the chart the EA is loaded to
Thanks, it makes clear the issue. On current chart it works for me too without problems. Now that it has become clear I have another question. How to change some properties of objects created in other charts (not current)? As in the example I'd like to set some text to OBJ_TEXT objects situated in some charts with known IDs.
Hello
In that case, you can use ObjectSetString(), with the property OBJPROP_TEXT
regards
This code works (tested with an EA on a live chart).
Yes, it works but not the way I'd expect. The code should create an object in every chart windows you have opened. Then it should change text for each object created. But the only object with changed text is the one situated in the current chart, objects in other charts remain with "Text" label as they had initially.
In that case, you can use ObjectSetString(), with the property OBJPROP_TEXT
regards
Oh, thanks again! You have saved me a lot of time digging in the documentation.
Your welcome :) But I may say that MQL documentation looks ok :)
regards

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi!
The following code demonstrates the issue. Objects are created but OnChartEvent function is never called. If somebody knows why it should not work or how to make it work please help me.