Horizontal Lines

Created at 02 Mar 2019, 21:27
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!
A.

a.fernandez.martinez

Joined 02.03.2019

Horizontal Lines
02 Mar 2019, 21:27


Hello,

 

Is there a way for a bot to get the prices of the horizontal lines I manually placed on a chart ? Even if I have to code it myself, thanks!


@a.fernandez.martinez
Replies

PanagiotisCharalampous
04 Mar 2019, 11:08

Hi a.fernandez.martinez,

See below how to do this

            foreach (var obj in Chart.Objects)
            {
                if (obj is ChartHorizontalLine)
                {
                    var price = (obj as ChartHorizontalLine).Y;
                }
            }

Best Regards,

Panagiotis


@PanagiotisCharalampous

a.fernandez.martinez
11 Mar 2019, 02:32

Thanks, I'm also wondering : is there a way to access horizontal lines on other charts.

For example if you place the cBot on EURUSD can it access the horizontal lines in GPSUSD ?

 

Best regards


@a.fernandez.martinez

PanagiotisCharalampous
12 Mar 2019, 12:14

Hi a.fernandez.martinez,

No there is no such feature. A cBot operates on a single chart.

Best Regards,

Panagiotis


@PanagiotisCharalampous

a.fernandez.martinez
12 Mar 2019, 14:33

Thanks Panagiotis Charalampous you're the best


@a.fernandez.martinez