Is there a way to manage OnChartEvent() for multiple indicators on the same chart?

 

Hi,

I have 2 indicators which I wrote that running on the same chart.   They are both quite OnChartEvent oriented with MOUSE_MOVE turned on.

If I run each Indicator without the other running, all of my CHARTEVENT_MOUSE_MOVE part of my code will work smoothly (visually) without any noticeable lag.


If I add both of these indicators to the same chart, then both of them start to lag.


If I create a brand new indicator and put all my code from both of the indicators into 1, it works perfectly smoothly again.


Is there a way to help my indicators run smoothly when they are both running on the same chart?


I don't understand why it's struggling to run smoothly, does anyone know anything about this please?


Thanks

 

In case someone has a problem like this in future.


Looks like you shouldn't make too many requests to get objects parameters (such as getting the object time/price) too often when you run multiple indicators using OnChartEvent.  Going over my code I found some places to improve on its efficiency in both my indicators and this basically solved my problem.