Although I am not too proficient with these methods yet (nor with much of MQL in general), I would suggest one concept.
Give your object group a "handle" of sorts which you define as a button somewhere, which tracks all of your Gann objects. When this object is clicked, select/unselect the linked objects.
Aside from this I really have no practical way of helping. :) Good luck, and I'd like to hear back what method you choose.
Is there a way to achieve what I need with current MQL5?
- www.mql5.com
Although I am not too proficient with these methods yet (nor with much of MQL in general), I would suggest one concept.
Give your object group a "handle" of sorts which you define as a button somewhere, which tracks all of your Gann objects. When this object is clicked, select/unselect the linked objects.
Aside from this I really have no practical way of helping. :) Good luck, and I'd like to hear back what method you choose.
it's a good idea.
But the pb is that there can be many groups of objects,
and therefore i would need a button for every group.
Which number of groups is uncertain.
So I would have to create a button everytime a group of objects is created.
Which... sucks...
But it's a good idea for a single group of objects. Thank you for this.
I will ask again if selected event will be / is planned in MQL5 someday.
I will check this out. Thank you for suggestion.
Anyhow, is CHARTEVENT_OBJECT_SELECTED event planned for a future version of MQL5?
Or has this event a chance to be a part of MQL5 in the future?
I want to know this, to plan for the future.
Thanks again for suggestion.
I think existing events are quite enough to solve your task. See EventChartCustom
Event |
Value of the id parameter |
Value of the lparam parameter |
Value of the dparam parameter |
Value of the sparam parameter |
Event of a mouse click in a graphical object belonging to the chart |
CHARTEVENT_OBJECT_CLICK |
the X coordinate |
the Y coordinate |
Name of the graphical object, on which the event occurred |
You can detect mouse click on a chart object and then check if this object is selected - https://www.mql5.com/en/docs/constants/objectconstants/enum_object_property
Identifier |
Description |
Property Type |
OBJPROP_COLOR |
Color |
color |
OBJPROP_STYLE |
Style |
|
OBJPROP_WIDTH |
Line thickness |
int |
OBJPROP_BACK |
Object in the background |
bool |
OBJPROP_SELECTED |
Object is selected |
bool |
- www.mql5.com
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I created groups of objects (say 5 gann lines with different ratios).
And I want to detect when user selects/deselects one of them, to select other 4 lines automatically.
Since there's only click object event, and I don't know what was the state before the click, or if it was double click, or if the property "Select objects by single mouse click" is checked or not....
I was wondering if this event could be added, if project managers see this event as general interest.
For me it would be very very useful.
Thank you.
Ps.
Is there a way to achieve what I need with current MQL5?