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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          574 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          332 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X