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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        43 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        30 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        47 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        38 views
        0 likes
        Last Post CarlTrading  
        Working...
        X