Can I simulate a CHARTEVENT_OBJECT_CLICK?

 

Hi guys,

is that possbile in a code? One indicator makes some calculations then it should simulate an object-click to activate a second indicator. No other solutions are needed because this is also for educational purposes.

Thanks! 

 
Marcus Riemenschneider:

Hi guys,

is that possbile in a code? One indicator makes some calculations then it should simulate an object-click to activate a second indicator. No other solutions are needed because this is also for educational purposes.

Thanks! 

You shouldn't need to simulate an object click.

If the first indicator satisfies whatever conditions, call the second indicator.

 
Keith Watford:

You shouldn't need to simulate an object click.

If the first indicator satisfies whatever conditions, call the second indicator.

But would it be possible to simulate an object click if I know the object name

 
Marcus Riemenschneider:

Hi guys,

is that possbile in a code? One indicator makes some calculations then it should simulate an object-click to activate a second indicator. No other solutions are needed because this is also for educational purposes.

Thanks! 

Read up on EventChartCustom().

As far as I know you won't be able to get the id==CHARTEVENT_OBJECT_CLICK but I'm sure you can work around that.

Basic example. Indicator #1 sends this:

EventChartCustom(0,CHARTEVENT_OBJECT_CLICK,0,0,NULL);

 Indicator #2 can check for this chart event id:

if(id==CHARTEVENT_CUSTOM CHARTEVENT_OBJECT_CLICK)

(you'll probably want to change lparam / dparam / sparam in the EventChartCustom)
 

 
honest_knave:

Read up on EventChartCustom().

As far as I know you won't be able to get the id==CHARTEVENT_OBJECT_CLICK but I'm sure you can work around that.

Basic example. Indicator #1 sends this:

EventChartCustom(0,CHARTEVENT_OBJECT_CLICK,0,0,NULL);

 Indicator #2 can check for this chart event id:

if(id==CHARTEVENT_CUSTOM CHARTEVENT_OBJECT_CLICK)

(you'll probably want to change lparam / dparam / sparam in the EventChartCustom)
 

Cool, I will try it that way. Thank you!
Reason: