Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to retrieve instantaneous volume for current bar as it's building

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

    How to retrieve instantaneous volume for current bar as it's building

    I would like to be able to retrieve the current volume of a bar as it's building like when the vol() indicator shows it building up instantly on the current bar. I would assume I would retrieve this value during the OnMarketUpdate event but so far only able to see the volume total for the bar after it's finished that bar.

    #2
    The volume in the Volume series is kept up to date as ticks arrive.

    Trying using Calculate.OnEackTick, then every time OnBarUpdate
    is called, the value in Volume[0] represents the current volume
    accumulated thus far.

    The value in Volume[0] stops updating when the bar closes.

    Comment


      #3
      UPDATE: I re-installed NT8 and now it works. Odd problem

      I'm having so much trouble getting current volume. I have tried the above like this:


      In State.Configure()
      VOL1 = VOL();

      In Bar.Update()
      CurrentVolume = Volume[0]; // VOL1[0];

      If I use VOL1[0] it gives me the final bar volume. If I use it like shown it gives me volume always of only 1. Yet the Vol() indicator is showing it live instanteously.
      Last edited by jalley; 06-08-2021, 11:07 AM.

      Comment


        #4
        Hello jalley,

        Attached is an export of an example that prints the time and the volume on each tick.
        Attached Files
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        581 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        338 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X