• 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.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Level 2 Bid minus Ask Data

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

    Level 2 Bid minus Ask Data

    I was curious if anyone knows if this is possible on how to create something very simple like the following.



    Essentially what I am looking for is to get the data from the Level 2 indicator and take the total from the buy side and the total from the sell side and minus them. Looking at the screen shot I am taking the 2692-2500 = 192 and plotting that with a print on the side. Is this possible? I've tried to find the Level 2 indicator in the indicator editor but it doesn't seem to exist.

    #2
    Hello,

    Thank you for the question.

    This would be possible to create using an indicator, although would not necessarily be simple to create.

    The hardest part would be creating the visual levels as you see on the screen. I would suspect this image is taking use of the plot override in NinjaScript which allows you to draw on the screen using the C# Graphics.

    This would be more of an advanced programming task to complete exactly how you see in the image.

    If you would like to attempt this yourself then I can provide you with some resources that use the plot override so you can see how it is used, other than that there would not really be any documentation on this because it is an advanced programming item.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      What about if I did not want the level 2 visuals at all? I just want the math done which minuses it and prints that out?

      Comment


        #4
        Hello,

        Without the visuals that would be much easier, mainly you would just need to come up with the formula using NinjaScript and ensure it calculates as you expect.

        This can be done using simple Print() statements and the Tools -> Output window to check your output data.

        You could take a look at this example we have on creating a custom level 2 book : http://www.ninjatrader.com/support/f...ead.php?t=3478

        This shows how to use the OnMarketDepth method and has some helpful items that show the ways to get the data.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          For some reason the SampleMarketDepth doesn't actually load anything onto my chart. I also can't even get anything to display in the output window data box.

          Is there another one I should check that actually works?

          Comment


            #6
            Hello,

            This example does not display anything on the chart and will only print the level 2 book depending on the condition that is defined in OnBarUpdate.

            If you look in the code there is a comment stating when the book would be printed to the output window or:

            // When the Close price crosses over the SMA, print the L2 books.
            if (CrossAbove(Close, SMA(5), 1))
            {

            You can comment this out if you just want to see the book right away. The example is just meant to show how you can combine conditions while using the L2 book.

            Most of the reference examples are meant for you to go through the code its self to learn from, many of them will only print to the output window.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              hello, did you ever get a answer to the above question regarding the limit orders showing up on the chart? I am looking for something like this... thanks

              Comment


                #8
                Hello,

                Thank you for the post.

                I wanted to confirm, is this question related to this post? I am unable to see where limit orders have been discussed in this thread, was this question intended for another post?

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by dr0832, 01-04-2019, 10:34 AM
                7 responses
                141 views
                0 likes
                Last Post Lancer
                by Lancer
                 
                Started by cbentrikin, Today, 07:46 PM
                0 responses
                4 views
                0 likes
                Last Post cbentrikin  
                Started by RedDuke, Today, 06:14 PM
                0 responses
                4 views
                0 likes
                Last Post RedDuke
                by RedDuke
                 
                Started by DariusDeck, Today, 04:22 PM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_Marco  
                Started by pstrusi, Today, 05:05 PM
                1 response
                3 views
                0 likes
                Last Post pstrusi
                by pstrusi
                 
                Working...
                X