Can I simulate a CHARTEVENT_OBJECT_CLICK?

To add comments, please log in or register
Marcus Riemenschneider
280
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! 

Keith Watford
Moderator
13961
Keith Watford  
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.

Marcus Riemenschneider
280
Marcus Riemenschneider  
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

honest_knave
Moderator
2302
honest_knave  
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)
 

Marcus Riemenschneider
280
Marcus Riemenschneider  
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!
To add comments, please log in or register