Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volume[1] nothing return

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Volume[1] nothing return

    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

    #2
    Any errors in the log tab? Both Volume[1] and VOL()[1] should work for accessing the previous bar's volume.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      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 ?

      Comment


        #4
        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 -

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          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/...ead.php?t=3170
          Thnx
          Thnx
          Thnx

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          43 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          25 views
          0 likes
          Last Post PaulMohn  
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          162 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          98 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          158 views
          2 likes
          Last Post CaptainJack  
          Working...
          X