Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Instrument.MarketDepth events

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

    Instrument.MarketDepth events

    Hello, I have a strategy where I access the market depth. In OnMarketDepth I get the MarketDepth object of the instrument which already contains the entire order book so it saves me from making it from scratch. I save this as a snapshot of the order book on every OnMarketDepth update. The only problem is the MarketDepth object is usually a few updates ahead of OnMarketDepth so I end up saving the same MarketDepth object sometimes 20+ times while OnMarketDepth catches up.

    Are there events ONLY for when the MarketDepth object is updated? I had a look through the code multiple times but couldn't find anything like that. I can always build my own order book from OnMarketDepth events but this seems less efficient, as the MarketDepth object seems to get multiple updates at once in the space of a single OnMarketDepth event, then gets nothing for multiple OnMarketDepth events as OnMarketDepth catches up. So it seems monitoring MarketDepth is more efficient as there would be much less events overall.

    #2
    Hello unQuantifiable,

    The correct way to use OnMarketDepth would be to manage the book yourself by using the individual events, we have a sample of how to build the orderbook here: https://ninjatrader.com/support/help...vel_ii_dat.htm

    Comment


      #3
      Hmm ok, just wanted to see if there was an alternative. Thank you.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 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
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X