Draw Line from Cbot?

Created at 30 Apr 2015, 16:36
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!
ON

onemind

Joined 30.04.2015

Draw Line from Cbot?
30 Apr 2015, 16:36


Hi all

I am trying to draw a line from my cbot but obviously the cbot doesnt have the "index" field that indicators have.

Is there a way to set the x coordinate to a previous bar without using a date and time?

 

Thanks for any help.


@onemind
Replies

Spotware
19 Jun 2015, 11:56

Dear Trader,

There is a way to set x coordinate to a previous bar using indexes.

The following code snippet is an example of drawing lines using indexes:

        [Parameter("Source")]
        public DataSeries Source { get; set; }


        protected override void OnStart()
        {
            var index = Source.Count;
            var price = Symbol.Bid + Symbol.PipSize;
            ChartObjects.DrawLine("line", index - 1000, price, index, price, Colors.Blue, 2, LineStyle.Solid);
        }

 


@Spotware

.ics
27 Jun 2015, 04:56

RE:

Spotware said:

Dear Trader,

There is a way to set x coordinate to a previous bar using indexes.

The following code snippet is an example of drawing lines using indexes:

        [Parameter("Source")]
        public DataSeries Source { get; set; }


        protected override void OnStart()
        {
            var index = Source.Count;
            var price = Symbol.Bid + Symbol.PipSize;
            ChartObjects.DrawLine("line", index - 1000, price, index, price, Colors.Blue, 2, LineStyle.Solid);
        }

 

Is this line also drawn during backtesting? Because i tried this snippet for education purpose, but don't notice any result.

Thanks in advance.


@.ics

Spotware
29 Jun 2015, 15:20

Dear Trader,

The line will not be drawn. ChartObjects is disabled in backtesting.


@Spotware

nmaxcom
02 Jan 2017, 08:20

RE:

Spotware said:

Dear Trader,

The line will not be drawn. ChartObjects is disabled in backtesting.

Why??


@nmaxcom

pavel
12 Feb 2017, 18:18

RE: RE:

nmaxcom said:

Spotware said:

Dear Trader,

The line will not be drawn. ChartObjects is disabled in backtesting.

Why??

 

It is still disabled? How can i visualise anything in backtesting?

WHY is it disabled?


@pavel