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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        68 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        151 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        100 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        288 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X