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 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 TraderBCL, Today, 04:38 AM
                2 responses
                8 views
                0 likes
                Last Post TraderBCL  
                Started by martin70, 03-24-2023, 04:58 AM
                14 responses
                105 views
                0 likes
                Last Post martin70  
                Started by Radano, 06-10-2021, 01:40 AM
                19 responses
                606 views
                0 likes
                Last Post Radano
                by Radano
                 
                Started by KenneGaray, Today, 03:48 AM
                0 responses
                4 views
                0 likes
                Last Post KenneGaray  
                Started by thanajo, 05-04-2021, 02:11 AM
                4 responses
                471 views
                0 likes
                Last Post tradingnasdaqprueba  
                Working...
                X