Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Does the bid/ask still hold accumulated resting orders?

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

    Does the bid/ask still hold accumulated resting orders?

    Hi all,

    Back in 2018, for NT7, someone clarified that the volume on a historical bid and ask series is not the traded volume, but the accumulated resting order volume-at-price over the bar's time period.

    See https://forum.ninjatrader.com/forum/...ask-bid-series

    Is that still true for NT8?

    Thanks!

    #2
    Hello wadams,

    Thank you for your inquiry.

    Yes, what JoshG posted in your linked forum post is still applicable to NinjaTrader 8.

    Please let us know if you have any other questions.

    Comment


      #3
      That was a quick reply! Thanks, NinjaTrader_Gaby.

      Can you spot check my understanding a little bit more?

      I'm guessing that accumulation does not happen with a 1-tick series. The volume values are effectively a snapshot.

      For example, I'm adding series like the following:

      Code:
      else if (State == State.Configure)
      {
          AddDataSeries(Instrument.FullName, BarsPeriodType.Tick, 1, MarketDataType.Ask);
          AddDataSeries(Instrument.FullName, BarsPeriodType.Tick, 1, MarketDataType.Bid);
      }​
      When "State == State.Historical" and I'm accessing the series with the following code:

      Code:
      protected override void OnBarUpdate()
      {
          if (State == State.Realtime) return;
      
          if (BarsInProgress == 1)
          {
              lastAskPrice = Close[0];
              lastAskVolume = Volume[0];
              return;
          }
          else if (BarsInProgress == 2)
          {
              lastBidPrice = Close[0];
              lastBidVolume = Volume[0];
              return;
          }
      }​
      then the "lastAskVolume" and "lastBidVolume" variables (defined in the class scope) should each have a snapshot of the last recorded resting order volumes for the ask and bid.

      Is that correct?
      Last edited by wadams; 12-08-2023, 08:44 AM.

      Comment


        #4
        Hello,

        Thank you for your response.

        Yes, Volume[] will be the last value for each of the series you added (since you are using BarsInProgress conditions).

        As a side note, you should be using AddDataSeries(null instead of AddDataSeries(Instrument.FullName, to assume the primary instrument correctly.

        Please let us know if you have any other questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X