Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to calculate trades at bid or ask price

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

    how to calculate trades at bid or ask price

    I assume GetCurrentBidVolume and GetCurrentAskVolume simply are a measure of the number of "booked" trades at that the respective price, not the volume/quantity traded at the respective price...is this correct?

    If so, what would be the most efficent way to calculate the number of trades that occured at the bid price and ask price?

    #2
    tulanch,

    That is correct. To get the actual trades at certain prices would be complicated. You would need to keep track of your own variable that tracks every single tick and categorizes them for each different price. You would likely need to create some Array or maybe a Hashtable of sorts to store this information. Unfortunately this is outside the scope of what we can offer support for as it is much more involved C# programming.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      thanks for the clarificaiton...

      then it looks like the MarketDataEventArgs method will make this data available...init some variable, then ...see if last was = ask/bid or outside...accumulate the totals...then on updatebar plot the current values, reset, and repeat..sounds possible...

      This being the way to proceed, One more question...

      Will the system make MarketDataEventsArgs calls during an UpdateBar call or is there some inheriant timing factor that makes this not an issue? Meaning, do I need to be concerned about the value in a global value that gets updated in MarketDataEventsArgs at the instant it gets reset to 0 in UpdateBar?

      Is this or is this not an issue?

      Comment


        #4
        tulanch,

        I have developed and am still creating new volume indicators.

        Check them out here.



        They are free with a nominal donation to support the website.

        RJay
        RJay
        NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

        Comment


          #5
          tulanch, OnMarketData() is called for every change in Level1 data, OnMarketDepth() for every change in Level2 data.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          176 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          93 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          130 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          210 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          186 views
          0 likes
          Last Post CarlTrading  
          Working...
          X