|
Obuli Govindaraju
2011-12-25 22:10:59
|
|
So a PaneObject.DrawLine function draws a line from start co-ordinate to end co-ordinate.
The x-axis of this co-ordinate is bar index and y co-ordinate is the price correct?
Now when I execute this script below I expect to see a line from (startIndex,close[startIndex]) to (endIndex,close[endIndex]) but it is not working.
The script is drawing a line from endIndex-1 to endIndex and beyond. What am I doing wrong?
Here is the script.
Chart chart = Charts.GetSelectedChart();
PaneObject pane = chart.Panes[0].CreatePaneObject("Pane");
int endIndex = chart.ChartData.EndIndex;
int startIndex = chart.ChartData.StartIndex;
double startValue = chart.ChartData.GetTimeSeries("close")[startIndex];
double endValue = chart.ChartData.GetTimeSeries("close")[endIndex];
LineObj line = pane.DrawLine("Lines",startIndex,startValue,endIndex,endValue);
line.Line.Color = Color.BlueViolet;
pane.Update();
|
|