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 Mindset, 04-21-2026, 06:46 AM
          0 responses
          44 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          54 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          34 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          94 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          56 views
          0 likes
          Last Post PaulMohn  
          Working...
          X