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

Level II order book access

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

    Level II order book access

    Hi,

    I am aware of the code sample that demonstrates how to assemble an order book using the OnMarketDepth event, see https://ninjatrader.com/support/foru...ead.php?t=3478.

    Is there a way to achieve the same with less effort, i.e. is there a way to access a pre-existing level II order book that is equally up-to-date?

    Thank you,
    gurk

    #2
    Hello gurko,

    Thank you for your note.

    The link you provide would be the only supported method for pulling bid/ask data from the order book.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      can anyone give me an hint how to subtract from the level2 orderbook bid and ask the traded quantity?

      Thank you!
      Tony

      Comment


        #4
        Hi tonynt, thanks for your post.

        The traded quantity will be the volume from the "Last" data type from OnMarketData. When you get a "Last" update, that means there was a trade at that price and volume. The OnMarketData method could be thought of as the price marker of a chart. It provides a stream of bid, ask, and last price type updates along with their volume.

        Kind regards.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hello,

          thank you for your reply. Yes, of course but the question is how to deduct that quantity at that price from the corresponding price in level2 order book.

          Thank you!
          Tony

          Comment


            #6
            Hi tonynt, thanks for your reply.

            The sample level2 book example just creates a dictionary object to store the price level values, do you want to subtract the last traded volume from the top of the book? If so you would just perform the difference upon the first entry of the bid or ask book.

            I look forward to hearing from you.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Hello,

              yes, if yo mean with "top of the book" the levels with order "0" in that sample. Depending if it ticks down or up I want to subtract from bid or ask side from orderbook.

              Thank you!
              Tony
              Last edited by tonynt; 07-08-2019, 01:43 PM. Reason: typing error

              Comment


                #8
                Hi tonynt, thanks for your reply.

                I'm not sure if I am understanding the need for this. In the example, the Operation.Update flag will signal the new values for a price row, so you do not need to do any manual addition or subtraction. Subtracting a value from the first element of a list is a C# concept that could be researched elsewhere on the web.
                Chris L.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Christopher_R, Today, 12:29 AM
                0 responses
                9 views
                0 likes
                Last Post Christopher_R  
                Started by sidlercom80, 10-28-2023, 08:49 AM
                166 responses
                2,235 views
                0 likes
                Last Post sidlercom80  
                Started by thread, Yesterday, 11:58 PM
                0 responses
                3 views
                0 likes
                Last Post thread
                by thread
                 
                Started by jclose, Yesterday, 09:37 PM
                0 responses
                8 views
                0 likes
                Last Post jclose
                by jclose
                 
                Started by WeyldFalcon, 08-07-2020, 06:13 AM
                10 responses
                1,415 views
                0 likes
                Last Post Traderontheroad  
                Working...
                X