Don't remove certain charts

Created at 26 Nov 2018, 14:53
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!
alexander.n.fedorov's avatar

alexander.n.fedorov

Joined 02.01.2018

Don't remove certain charts
26 Nov 2018, 14:53


Dear Panagiotis, hi.

Suppose I have a robot wich draws differennt objects.

Then I look at the chart and add smth (a square for example) by hand

When the new candle comes the robot redraws all the lines, because there could be a development

before doing that it removes all the chart objects.

Is there a way to not remove objects, made by hand?

 

Regards, 

Sasha


@alexander.n.fedorov
Replies

PanagiotisCharalampous
26 Nov 2018, 15:02

Hi Sasha,

The solution is to give object names to objects drawn in code and then remove only the objects that have been created by the cBot. See below an example.

            Chart.DrawText("object name", "text", Server.Time, 1, Color.AliceBlue);
            Chart.RemoveObject("object name");

Best Regards,

Panagiotis


@PanagiotisCharalampous

alexander.n.fedorov
26 Nov 2018, 15:12

The problem is that there are thousands lines based on index and other criteria by code and only few -  hand made

May be there is an exeption?


@alexander.n.fedorov

alexander.n.fedorov
26 Nov 2018, 15:15 ( Updated at: 21 Dec 2023, 09:21 )


@alexander.n.fedorov

alexander.n.fedorov
26 Nov 2018, 15:40

1. I think it would be a good idea to add to API   "except"

2. Give the ability to add the name to the objekt


@alexander.n.fedorov