Removing All Objects From All Symbols .Chart.RemoveAllObjects();

Created at 30 Dec 2024, 00:47
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
TO

TommyFFX

Joined 07.12.2021

Removing All Objects From All Symbols .Chart.RemoveAllObjects();
30 Dec 2024, 00:47


Hello,

 

I want to clean up charts in the OnStop of my plugin.
But I'm only able to clean up the Objects of current symbol of the chart.
Chart.RemoveAllObjects();

Is there a way to remove all objects of all symbols in the chart in the OnStop ?

Kind Regards



        public IEnumerable<ChartFrame> FindAllChartFrames() => ChartManager.OfType<ChartFrame>();

        protected override void OnStop()

        {

            foreach (var chartFrame in FindAllChartFrames())

            {

                chartFrame.Chart.RemoveAllObjects();

            }

        }


 


@TommyFFX