Add Lines to Chart Using Robot

Created at 08 Oct 2018, 12:30
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!
YI

yisrgg

Joined 02.04.2016

Add Lines to Chart Using Robot
08 Oct 2018, 12:30


Hello everyone,

I would like my robot to draw one horizontal line on the chart. The problem using ChartObjects.DrawHorizontalLine is, that the lines are removed when I stop the robot. Do you have any idea, how to prevent that?

I have also thought about creating an indicator to draw the lines, but then I don't know how to add an indicator to the chart using a robot. Do you know, how I can call an indicator froma robot? This indicator should remain in place after stopping the robot too.

Thank you very much in advance.


@yisrgg
Replies

PanagiotisCharalampous
08 Oct 2018, 12:37

Hi fcomanjoncabeza,

For a line to stay on the chart you need to make it interactive. See how below.

            var line = Chart.DrawHorizontalLine("Test", Symbol.Bid, Color.AliceBlue);
            line.IsInteractive = true;

Best Regards,

Panagiotis


@PanagiotisCharalampous

yisrgg
08 Oct 2018, 13:15

RE:

Panagiotis Charalampous said:

Hi fcomanjoncabeza,

For a line to stay on the chart you need to make it interactive. See how below.

            var line = Chart.DrawHorizontalLine("Test", Symbol.Bid, Color.AliceBlue);
            line.IsInteractive = true;

Best Regards,

Panagiotis

Thank you very much. Do you have any alternative for the API version 3.0?

Kind regards


@yisrgg

PanagiotisCharalampous
08 Oct 2018, 14:05

Hi fcomanjoncabeza,

No this feature has been introduced in v3.01. It will be released to brokers soon.

Best Regards,

Panagiotis


@PanagiotisCharalampous