PDA

View Full Version : Problem with close[0] and close[1]


recentrage
07-19-2007, 01:05 AM
Dear traders,

I need some help with close[0] and close[1].

When I DO

set.plot(close[0] > open[0]?1:0)

I have my new plot, all is ok !

But when I do

set.plot(close[0] > close[1]?1:0)

I have nothing - a blank chart !

What can I do to create an indicator witch says "1" if close > close[1].

Thanks and regards,

David

NinjaTrader_Dierk
07-19-2007, 02:14 AM
You will find the problem in your logs.

To fix you'll need to add code like this:

if (CurrentBar < 1)
return; before you accessed Close[1].

recentrage
07-19-2007, 08:51 AM
Dear Dirk,

It's Ok now, thanks.

But what does it mean ?

Regards

David

NinjaTrader_Dierk
07-19-2007, 08:54 AM
Please see here: http://www.ninjatrader-support.com/HelpGuideV6/EnterYourFormula.html

recentrage
07-19-2007, 08:55 AM
Ok, thanks a lot !

David