CHARTEVENT_OBJECT_SELECTED event?

 

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? 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
 

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.

 
ifmihai:

Is there a way to achieve what I need with current MQL5? 

 

Yes, it is possible. See video for article at https://www.mql5.com/en/forum/414
Discussion of article "The Price Histogram (Market Profile) and its implementation in MQL5"
  • www.mql5.com
Discussion of article "The Price Histogram (Market Profile) and its implementation in MQL5".
 
Lugner:

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. 

 
Rosh:
Yes, it is possible. See video for article at https://www.mql5.com/en/forum/414

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

ENUM_LINE_STYLE

OBJPROP_WIDTH

Line thickness

int

OBJPROP_BACK

Object in the background

bool

OBJPROP_SELECTED

Object is selected

bool

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Properties - Documentation on MQL5
Reason: