I have worked out that my issue is that one of my indicators is using lots of draw objects, so if I load let's say 20 days, there are thousands of draw objects loaded. This causes the performance issues when I use the drawing tools and try to adjust the colour of say a manually drawn horizontal line. If I reduce the days loaded to say 5, as my indicator has less draw objects on the chart, the performance issue disappears when working with the drawing tools. But I am going to want many more than 5 days of tick data loaded at times.
My drawing code is all in OnBarUpdate(), I haven't got my head around OnRender() yet. I have tried the NT8 Best Practices - Performance Practices - Restricting OnRender() calculations to visible ChartBars : by wrapping the code below around my drawing objects code within the OnBarUpdate() section. This reduces the screen blackouts to seconds instead of minutes. Is there anything else I can do to eliminate them altogether?
if (ChartBars != null)
{
/* restricting this loop to only the ChartBars.From/ToIndex limits the loop to only what is visible on the chart. This reduces
the random spikes in CPU useage that drawing lots of objects that are not visible can cause*/
for (int barIndex = ChartBars.FromIndex; barIndex <= ChartBars.ToIndex; barIndex++)
}
} {


Leave a comment: