Draw Line from Cbot?
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.
Replies
.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
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:
@Spotware