Parameter "chart_id" of ObjectCreate()... when it can be useful?

karp wak
68
karp wak  

I wonder in what situation the "chart_id" parameter of the ObjectCreate() function can be useful.

All the examples I have seen so far have this parameter equal to zero.

Can someone give me a little explanation or provide a link where I can see an example of its use when it is different from zero?

Thank you very much!!

Keith Watford
Moderator
31216
Keith Watford  

If you want to create an object on a different chart to which the EA or Indicator is attached, then you will use the ID of that chart.

eg. My indicator may be monitoring a number of symbols and sometimes it may open a new chart of the relevant symbol and place objects on it.

karp wak
68
karp wak  
Keith Watford:

If you want to create an object on a different chart to which the EA or Indicator is attached, then you will use the ID of that chart.

eg. My indicator may be monitoring a number of symbols and sometimes it may open a new chart of the relevant symbol and place objects on it.

100% understood !! :-)
Thank you so much Keith !!