The Drawline works is argument

Created at 09 Apr 2018, 10:34
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!
Bits's avatar

Bits

Joined 14.03.2018

The Drawline works is argument
09 Apr 2018, 10:34


The DrawLine function only draws the last  value,the old line being Drawed is lost.

 public override void Calculate(int index)
        {
            CulBarInfo(index, MarketSeries, BarInfos);
            //Print(BarInfos.Count);
            ChartObjects.DrawLine("kk", index - 1, 0, index - 1, 131, Colors.Red, 2, LineStyle.Solid);
            ChartObjects.DrawText("ddf", index.ToString(), StaticPosition.BottomCenter);
        }


@Bits
Replies

PanagiotisCharalampous
10 Apr 2018, 11:05

Hi yearn2012,

You need to change the object name each time. See below an example

ChartObjects.DrawLine(index.ToString(), index - 1, 0, index - 1, 131, Colors.Red, 2, LineStyle.Solid);

Best Regards,

Panagiotis


@PanagiotisCharalampous

Bits
15 Apr 2018, 19:28

RE:

Panagiotis Charalampous said:

Hi yearn2012,

You need to change the object name each time. See below an example

ChartObjects.DrawLine(index.ToString(), index - 1, 0, index - 1, 131, Colors.Red, 2, LineStyle.Solid);

Best Regards,

Panagiotis

Thanks,Panagiotis !


@Bits