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 sjsj2732, Today, 04:31 AM
          0 responses
          20 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          279 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          279 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          130 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          89 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X