• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.


No announcement yet.

Partner 728x90


Access to all Book orders

  • Filter
  • Time
  • Show
Clear All
new posts

    Access to all Book orders

    Hello Ninjas

    We need to build a complete "Order Book" similar thats usually usage in B3 (Brazil).
    The all platforms here in Brazil show to traders the complete Order Book (Image atached) each order included the brokerage firm ID who sent the order.


    1 - I have already studied the entire MarketDeph method and have no way to rebuild the "order book" correctly with the method. Therefore I need to access Level II order by order before the system grouped into price levels.

    2 - Here in Brazil each on the BooK "executed order" and each "posted order" has the ID of the broker that sent the order. Exist some way to access this information in MD?
    For NinjaTrader 8 to have acceptance of the Brazilian traders would be very important to have access to the complete book with the brokerages.

    Attached Files

    Hello MarceloF,

    Thanks for your post.

    I may suggest to use the SampleLevel2Book example for analyzing the order book for a given instrument. From the context of an AddOn you could subscribe to the MarketDepthUpdate event to subscribe to Market Depth updates for multiple instruments.

    SampleLevel2Book - https://ninjatrader.com/support/help...vel_ii_dat.htm

    MarketDepth - https://ninjatrader.com/support/help...arketdepth.htm

    To answer your second question, this would involve analysis of the order book to see, for example. where a bid/ask are placed and to see if volume traded at that bid/ask or has exceeded that level. If it has the order was filled, if it has been Removed without the conditions to fill becoming true, the order was pulled.

    Some additional threads on studying level 2 data with Market Depth Updates are linked below.


    Please let me know if I can be of further assistance.
    Last edited by NinjaTrader_Jim; 03-15-2019, 12:47 PM.
    JimNinjaTrader Customer Service


      Hi Jim
      I understood what you told me, but I woul like to know if have a way to access roder by order.
      I can identify order by order monitoring the price with de volume (incresase), but I can not identify which order (or part of order) is canceled, threfore i do not know whats is the correct sequence of orders in the same price, because when ocurs the cancellation I dont know if were cancelled the first order... or the last order... or one order specific betweem the first order and the last order.
      I use this command and accses all ask/bid, but is all orders cumsum volumes in the price level

      for (int index = 0; index < e.Instrument.MarketDepth.Asks.Count; index++)

      Print("ASKS "+index+" "+e.Instrument.MarketDepth.Asks[index].MarketMaker+" "+
      e.Instrument.MarketDepth.Asks[index].Price+" "+
      e.Instrument.MarketDepth.Asks[index].Time+" "+

      I really need to know have some way of accessing the separate orders (without being grouped by price)


        Hello MarceloF,

        I do not believe there would be a good way to identify this.

        You may see how many orders are added to the book, and the amount of volume at the price could tell you where your position would be as far the order in which the exchange fills orders.

        However, once you place your order, you may see changes in volume, which may involve orders filled or removed before or after your order submission. Since their is no obvious identifier like an OrderID to distinguish which order got removed, we would not know how the position would be changed when the volume changes.

        Please let me know if there is anything else I can do to help.
        JimNinjaTrader Customer Service


        Latest Posts


        Topics Statistics Last Post
        Started by Gav_G, Today, 02:12 PM
        0 responses
        1 view
        Last Post Gav_G
        by Gav_G
        Started by Gav_G, Today, 01:41 PM
        0 responses
        Last Post Gav_G
        by Gav_G
        Started by kweiss, Today, 01:21 PM
        0 responses
        Last Post kweiss
        by kweiss
        Started by digibob, Yesterday, 06:45 AM
        2 responses
        Last Post NinjaTrader_ChrisL  
        Started by cutzpr, Today, 08:44 AM
        0 responses
        Last Post cutzpr
        by cutzpr