Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Split volume by bid and ask

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

    Split volume by bid and ask

    Hi,

    How can I retrieve how much of the volume was made by hitting the ask and how much by hitting the bid (using level 1 if that’s relevant)?

    As an example: candle’s total volume is 10k. Which was made by 4k hitting the bid and 6k by hitting the ask.

    How can I get the 4k and the 6k of the total volume?
    I tried to look into built in volume indicators, but they don’t seem to address the issue, but only display the total volume eventually (even the Volume Up Down indicator).

    #2
    Can someone help please? Anyone?

    Comment


      #3
      Hello xfactscout,

      You would need to add a 1-tick ask series and 1-tick bid series with AddDataSeries() or sort the ask and bid updates from OnMarketData() or OnBarUpdate() (if ask and bid historical data is not available) with logic.

      Fortunately, I have example scripts you may find helpful.
      LastVolumeAtAskBidOBUTest_NT8.zip
      LastVolumeAtAskBidOMDTest_NT8.zip
      Attached Files
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hi Chelsea,
        So if I am reading your example code correctly, the On Market Update version is more "robust", in that it provides one additional user (bool) selection, if real-time data should be used. Is that a correct interpretation?
        Thank you, and also especially for the code examples -- much appreciated.

        Comment


          #5
          Hello tradeologist,

          One is historical tick data and the other is using market updates.

          The option for real-time is because OnMarketData() only runs in real-time unless TickReplay is enabled.
          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
          547 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          323 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          99 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          543 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          545 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X