PDA

View Full Version : Volume[1] nothing return


Nikoli
03-31-2010, 04:53 AM
Hi

in my indicator Close[1] or Hight[1] return right value.
But why Volume[1] nothing return ?

How I can get value Volume[n] ?

Tnkx

NinjaTrader_Bertrand
03-31-2010, 04:58 AM
Any errors in the log tab? Both Volume[1] and VOL()[1] should work for accessing the previous bar's volume.

Nikoli
03-31-2010, 05:50 AM
Any errors in the log tab? Both Volume[1] and VOL()[1] should work for accessing the previous bar's volume.

Pls, try it on Y's comp :
- create indicator in Wizard (Tools-NewScript-Indicator)
- change Close[0] on Volume[1] in code

protectedoverridevoid OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.

//Plot0.Set( Close[0] );
Plot0.Set( Volume[1] );
...

and Y can look - indicator not plote value
but if write
Plot0.Set( Volume[0] );

all right plot.

Where error ?

NinjaTrader_Bertrand
03-31-2010, 06:00 AM
Did you add the needed CurrentBar's check at the OnBarUpdate start? Likely not, thus you run into this issue here accessing the previous bar info -

http://www.ninjatrader-support2.com/vb/showthread.php?t=3170

Nikoli
03-31-2010, 08:10 AM
Did you add the needed CurrentBar's check at the OnBarUpdate start? Likely not, thus you run into this issue here accessing the previous bar info -

http://www.ninjatrader-support2.com/vb/showthread.php?t=3170

Thnx
Thnx
Thnx