Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 haas88, 03-21-2024, 02:22 AM
      18 responses
      208 views
      0 likes
      Last Post haas88
      by haas88
       
      Started by Board game geek, Today, 02:20 AM
      0 responses
      1 view
      0 likes
      Last Post Board game geek  
      Started by knighty6508, Today, 01:20 AM
      2 responses
      14 views
      0 likes
      Last Post knighty6508  
      Started by franatas, Today, 01:53 AM
      0 responses
      2 views
      0 likes
      Last Post franatas  
      Started by knighty6508, Today, 01:17 AM
      0 responses
      9 views
      0 likes
      Last Post knighty6508  
      Working...
      X