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 NTEducationTeam, 07-11-2025, 08:49 AM
          0 responses
          52 views
          0 likes
          Last Post NTEducationTeam  
          Started by saltminer, 07-07-2025, 01:43 PM
          1 response
          95 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by idude, 07-08-2025, 05:06 AM
          0 responses
          44 views
          0 likes
          Last Post idude
          by idude
           
          Started by music_p13, 07-05-2025, 11:33 PM
          1 response
          51 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by gubbar924, 03-18-2018, 05:15 PM
          43 responses
          5,511 views
          0 likes
          Last Post ESMC377
          by ESMC377
           
          Working...
          X