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

accesing LevelII

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

    accesing LevelII

    Hi everybody...
    first of all thanks for giving support.

    Now, this question has been already asked but not properly answered yet, I'm afraid

    I need to read data from level II, using onmarketdepth()

    But how can I sum de total sizes in each side?

    And how can my code change the color of the background, in order to stress the biggest size in the levelII window?

    Any idea?
    thanks


    If you were as kind as to avoid redirecting me to the famous link http://www.ninjatrader-support.com/H...?OnMarketDepth, i would appreciate it

    #2
    Hi level2, welcome to the forums!

    I'm afraid this question has been answered correctly.. I actually programmed this myself a few weeks back. Please see post #6 by auspiv (me) on this thread. After you import the indicator, it will show up as SampleMarketDepth in the indicator list.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thanks for your welcome

      Sorry, I read several threads on this topic but it seems that I missed that thread. Terrific one, congratulations. I'll read it in further detail right now.

      Just a little question...
      When reading the MarketDepthEventArgs we find the 'Operation' argument with three possible values:

      Insert, Remove and Update.

      Insert means that a new price appears in this side (bid/ask)
      Update means that values are updated in a previously displayed price
      And Remove means....?

      Comment


        #4
        Originally posted by level2 View Post
        Insert, Remove and Update.

        Insert means that a new price appears in this side (bid/ask)
        Update means that values are updated in a previously displayed price
        And Remove means....?
        Those terms refer to the necessary action to keep the Level II book updated. You have Insert and Update correct, and Remove simply means remove that price from the Level II book.

        In general, you can probably ignore all those functions, and just run all your Level II codes below the insert/update/remove functions (at the very bottom of OnMarketDepth()). That way everything is up to date, and you don't have to worry about how to update the book yourself.
        AustinNinjaTrader Customer Service

        Comment


          #5
          Here is an interesting way to use it, in the bottom indicator, user selectable from 5 - 10 levels. Lets you keep your eye off the Dom and colored background is a quick givaway.
          Attached Files
          eDanny
          NinjaTrader Ecosystem Vendor - Integrity Traders

          Comment


            #6
            Thanks for all your answers guys. Let's hope this post will be useful for other people interested as well

            What I'm trying is to PAINT the book dinamically INTO the chart in order to keep track all the time of "where is the biggest size" in relation with the last price traded whitout need to look at a book ever changing.

            Originally posted by NinjaTrader_Austin View Post
            Those terms refer to the necessary action to keep the Level II book updated.
            Maybe that explains why before an UPDATE usually appears a REMOVE?
            A REMOVE with size=0, by the way.

            Originally posted by NinjaTrader_Austin View Post
            In general, you can probably ignore all those functions, and just run all your Level II codes below the insert/update/remove functions (at the very bottom of OnMarketDepth()). That way everything is up to date, and you don't have to worry about how to update the book yourself.
            May I be so bold as to ask you to develop a little bit further this last paragraph ?

            Comment


              #7
              If you're trying to get a visual display of the book onto your chart, you might want to take a look at Eds Level II on this page. I think it might be exactly what you're looking for.

              Expanding on the last paragraph: The NinjaTrader SampleMarketDepth script is a well-developed sample that generates and then continuously updates a Level II book. I was referring to placing any L-II logic below all the insert/update/remove functions so you wouldn't have to worry about modifying the price ladders yourself. By the time OnMarketDepth gets to this,
              Code:
              else if (e.Operation == Operation.Update && e.Position < rows.Count)
                          {
                              rows[e.Position].MarketMaker    = e.MarketMaker;
                              rows[e.Position].Price            = e.Price;
                              rows[e.Position].Volume            = e.Volume;
                          }
              you have a readable, accurate array that can be accessed very easily.

              The below code would print the bid and the ask. The two arrays that contain the book are called askRows and bidRows, and the best bid is indexed at bidRows[0], and the best ask is indexed at askRows[0]. The second level of bid/ask prices would be accessable at bidRows[1] and askRows[1], and so on.
              Code:
              if (e.Operation == Operation.Update && e.Position == 0)
                          {
                              Print("Ask Price=" + askRows[0].Price + " Volume=" + askRows[0].Volume);
                              Print("Bid Price=" + bidRows[0].Price + " Volume=" + bidRows[0].Volume);
                          }
              AustinNinjaTrader Customer Service

              Comment


                #8
                The best futures trading community on the planet: futures trading, market news, trading charts, trading platforms, trading strategies


                Scroll down to jtstats level II indicator and download.
                RJay
                NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                Comment


                  #9
                  ready for nt7?

                  has this indicator been converted to nt7.

                  Comment


                    #10
                    OnMarketDepth

                    Hi,

                    I would like to ask a question related to the post below, specifically the code after the line (e.Operation == Operation.Update && e.Position == 0). How would you go about exposing the bidRows[0].Price to access from another indicator?

                    Originally posted by NinjaTrader_Austin View Post
                    If you're trying to get a visual display of the book onto your chart, you might want to take a look at Eds Level II on this page. I think it might be exactly what you're looking for.

                    Expanding on the last paragraph: The NinjaTrader SampleMarketDepth script is a well-developed sample that generates and then continuously updates a Level II book. I was referring to placing any L-II logic below all the insert/update/remove functions so you wouldn't have to worry about modifying the price ladders yourself. By the time OnMarketDepth gets to this,
                    Code:
                    else if (e.Operation == Operation.Update && e.Position < rows.Count)
                                {
                                    rows[e.Position].MarketMaker    = e.MarketMaker;
                                    rows[e.Position].Price            = e.Price;
                                    rows[e.Position].Volume            = e.Volume;
                                }
                    you have a readable, accurate array that can be accessed very easily.

                    The below code would print the bid and the ask. The two arrays that contain the book are called askRows and bidRows, and the best bid is indexed at bidRows[0], and the best ask is indexed at askRows[0]. The second level of bid/ask prices would be accessable at bidRows[1] and askRows[1], and so on.
                    Code:
                    if (e.Operation == Operation.Update && e.Position == 0)
                                {
                                    Print("Ask Price=" + askRows[0].Price + " Volume=" + askRows[0].Volume);
                                    Print("Bid Price=" + bidRows[0].Price + " Volume=" + bidRows[0].Volume);
                                }

                    Regards,
                    suprsnipes

                    Comment


                      #11
                      suprsnipes,

                      I am happy to assist you.

                      Here is a reference sample on exposing indicator values : http://www.ninjatrader.com/support/f...ead.php?t=4991

                      Please let me know if I may assist further.
                      Adam P.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by nicthe, Today, 09:24 AM
                      1 response
                      5 views
                      0 likes
                      Last Post nicthe
                      by nicthe
                       
                      Started by samish18, Today, 10:13 AM
                      0 responses
                      5 views
                      0 likes
                      Last Post samish18  
                      Started by kenz987, Yesterday, 10:20 AM
                      2 responses
                      13 views
                      0 likes
                      Last Post kenz987
                      by kenz987
                       
                      Started by nicthe, 08-23-2023, 07:53 AM
                      7 responses
                      197 views
                      0 likes
                      Last Post nicthe
                      by nicthe
                       
                      Started by stalt, 12-28-2015, 01:36 PM
                      6 responses
                      1,536 views
                      0 likes
                      Last Post giulyko00  
                      Working...
                      X