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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        93 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        138 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        123 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        73 views
        0 likes
        Last Post PaulMohn  
        Working...
        X