Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug in OnMarketDepth

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

    Bug in OnMarketDepth

    I have code:

    protectedoverridevoid OnMarketDepth(MarketDepthEventArgs e)
    {
    Print(
    string.Format("Depth: {0} {1} {2} {3}", e.MarketDataType, e.Operation, e.Price, e.Volume));

    which produces output:
    Depth: Ask Insert 113.7 25
    Depth: Ask Insert 113.72 20
    Depth: Ask Insert 113.73 159
    Depth: Ask Insert 113.74 185
    Depth: Ask Insert 113.75 152
    Depth: Ask Insert 113.76 196
    Depth: Bid Insert 113.69 20
    Depth: Bid Insert 113.71 16
    Depth: Bid Insert 113.7 34
    Depth: Bid Insert 113.69 191
    Depth: Bid Insert 113.68 330
    Depth: Bid Insert 113.67 282


    113.69 comes twice. In the NT DOM it is 20. But in the code I have to replace with 191 as it came after.

    DOM is pretty much static - after trading hours it doesnt move at all. 20 was before I reloaded my indicator and 20 after that.

    But in my data it is 191.

    I connected to IB.

    I need this somehow fixed as I cant count volume in bid/ask ladders.

    Thanks

    #2
    OnMarketData() is correct in its events. Try switching DOM to different instrument and back again to see if it shows the 191.
    RayNinjaTrader Customer Service

    Comment


      #3
      To double check, are you using SuperDOM or Level II window? If this is a stock, you should use Level II window. You likely will see two rows for the price 113.69 each with different volume levels. This is an insert operation not an updata at that price level.
      RayNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      41 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
      29 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      46 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      37 views
      0 likes
      Last Post CarlTrading  
      Working...
      X