PDA

View Full Version : Bars ago


shane
11-05-2008, 08:59 AM
Just started my first indicator:

//This plots a line
Plot0.Set(Close[0]);

//This doesn't plot anything
Plot0.Set(Close[1]);

//This plots a line
Plot0.Set(Close[-1]);

Why does 1 bar ago not plot anything and -1 bars ago plots something. Is -1 bars what the value of the next bar will be? That would be nice to know. :-)

NinjaTrader_Josh
11-05-2008, 09:05 AM
Hi shane,

You cannot access negative bars ago values. The reason "1" does not work is because you need to first make sure you have more than one bar on the chart. Please see this tip: http://www.ninjatrader-support2.com/vb/showthread.php?t=3170

shane
11-05-2008, 09:49 AM
thx .