protected override void Initialize()
{
Add(PeriodType.Day,1);
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 1){
DrawHorizontalLine("line",SMA(200)[0],Color.Red);
Print(Time[0]+" "+SMA(200)[0]+" "+Close[0]);
}
}
When I load this script and it prints the daily values, it gives me one 3 days of values since my chart window is only set for 3 days. Yet it will not draw the line.
The output as of today is
9/9/2010 12:00:00 AM 629.9 632.3
9/10/2010 12:00:00 AM 630.366666666667 631.3
9/11/2010 12:00:00 AM 631.15 633.5
Where it seems to be jumping to tomorrow,and the SMA(200) value according to a daily chart is around 640, not 630.3666 for today. It is also wrong for the other days.
-Alex
Comment