Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketDepth Update...

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

    OnMarketDepth Update...

    I'm checking out SampleMarketDepth. I see that the "order book" on the DOM is updating values a lot quicker than the SampleMarketDepth script, (or my OrderBook app for that matter). Is there a way to update the order book like the DOM gets updated? Is there something like the Update() function to force updates from incoming MarketDepth()? I'm *assuming* that the DOM is getting it's data from OnMarketDepth()?

    #2
    Originally posted by funk101 View Post
    I'm checking out SampleMarketDepth. I see that the "order book" on the DOM is updating values a lot quicker than the SampleMarketDepth script, (or my OrderBook app for that matter). Is there a way to update the order book like the DOM gets updated? Is there something like the Update() function to force updates from incoming MarketDepth()? I'm *assuming* that the DOM is getting it's data from OnMarketDepth()?
    You are walking into a trap trying to analyze the DOM. The big guys know that.
    Get a day job.

    Comment


      #3
      Hey, great response! Look forward to an intelligent answer from someone please?

      Comment


        #4
        Should be the same. Printouts are not necessarily the best way to view for updates since it takes time to actually get it outputted, but it should be the same.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Yeah, totally not the same. If I print from "within" OnMarketDepth() it's the same. If I print from "outside" of OnMarketDepth() it waits for OnBarUpdate(). My indicator overrides Plot(), I just need to figure out the best way for OnMarketDepth() and Plot() to see each other.

          Comment


            #6
            Not sure what you mean outside. If you want to print this information you should print it from OnMarketDepth() directly for the most up-to-date information. If you are using Plot() you need to remove the redraw delays from the chart if you are going to even be able to remotely get the same. Go to the Chart Properties to do this.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Sorry for being vague, similar to your samplemarketdepth, you get data from onmarketdepth, and populate a List<>. Then in onbarupdate() you loop through and Print() the values. So, yes I guess the chart properties "lag" is the problem there. What I'd like to do is this:

              OnMarketDepth(MarketDepthEventArgs e)
              {
              //g is not seen in here, obviously.
              g.DrawString(blah);

              }



              override Plot([params])
              {
              base.Plot([params');
              etc...
              }

              Comment


                #8
                So to clarify, did changing the Chart Properties resolve it for you or not?
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  No, it didn't. I guess I have to figure out how to access the Graphics obj, Rectangle obj, min, max from OnMarketDepth().

                  Comment


                    #10
                    Can you not create your list from OnMarketDepth() and bring that over into Plot()? What happens from Plot() will only update when the charting decides to update it.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Yes, that's what happens. I create my Lists<> in MarketDepth() then in Plot() I loop through and g.Drawstring() works nice. 'Cept, the lag -> when chart decides to update. So, obviously this does not work, but, for example: ...

                      OnMarketDepth(MarketDepthEventArgs e, Graphics g, Rectangle bounds, double min, double max)
                      {
                      foreach (loop)
                      {
                      g.DrawString(blah);
                      }
                      }

                      I know I'm missing something, some things in C# elude me.

                      Comment


                        #12
                        You can't just bring the Plot over into OnMarketDepth() like that. There's no overload method for that. Unfortunately if you want to draw things from your indicator it will only draw when the Plot method updates.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Hey thanks for answering these questions, I know it's beyond the scope, I appreciate it. Yes, I knew there was no overload for that.

                          Comment


                            #14
                            Originally posted by NinjaTrader_Josh View Post
                            Not sure what you mean outside. If you want to print this information you should print it from OnMarketDepth() directly for the most up-to-date information. If you are using Plot() you need to remove the redraw delays from the chart if you are going to even be able to remotely get the same. Go to the Chart Properties to do this.
                            Could you please elaborate on how to remove the redraw delays from a chart?
                            I see something called "Display update interval(sec)" is that it? can it be = 0?
                            would that mean the chart will update whenever onMarketDepth is called?

                            Comment


                              #15
                              laserwolf, correct you would set the chart update interval to it's min - 0.1msec to see quicker drawings. The OnMarketDepth and Plot would still listen to different events, thus there's no guarantee that they are in sync per default.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              574 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              333 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              101 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              553 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              551 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X