How to draw a line?

Created at 31 Dec 2013, 03:17
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!
OL

Old Account

Joined 14.10.2013

How to draw a line?
31 Dec 2013, 03:17


Hi, I was wondring if anyone could help me figuring out how you draw a horizontal line insted of placing a position. I would like to know this so i can see if my robot  does what i want it to.

 

Thanks 


@Old Account
Replies

daemon
31 Dec 2013, 09:36

 ChartObjects.DrawHorizontalLine("line", Symbol.Bid, Colors.Red);

/api/reference/internals/chartobjects/drawhorizontalline-738f


@daemon

Old Account
31 Dec 2013, 17:25

Thanks, but I can't get it to work. I tryed plasing it under OnStart() just to test, but nothing happened.

Happy New Year BTW


@Old Account

Old Account
31 Dec 2013, 17:46

I got it to work when i started the robut using the code below, but I still can get it to work when backtesting, is it not supported?

double y = Symbol.Bid;
ChartObjects.DrawHorizontalLine("hLine", y,         
       Colors.Yellow, 2, LineStyle.Lines);

@Old Account

jeex
01 Jan 2014, 13:16

No drawing while backtesting

Drawing is not supported in backtesting.


@jeex

Old Account
01 Jan 2014, 15:35

Ok, thanks


@Old Account