Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart Buffering

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

    Chart Buffering

    Hi guys

    I'm using some OnMarketDepth information on my chart. I have spent the last 5 hours trying to figure out why the information displaying on my chart is not the same as the DOM, I just now realised that the chart is not updating properly. Is there some sort of chart buffer or something because essentially what happens is as soon as I click on the chart with my mouse the values in the cells change to be correct. So the logic in the background is right and all the events are processing (has to be otherwise it could not change to the correct results). The chart is just not drawing them at times, it's as if it's decided not to refresh itself on occasion.

    My chart interval setting is more than sufficient at like 0.3 seconds but seriously some updates just don't happen for like 10 seconds, I click on the chart and everything corrects itself.

    Any ideas or pointers?

    Thanks
    Ross

    #2
    For extra info I'm working on an indicator that is overriding the Plot method.

    public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
    {
    }

    One thing I notice in debugging is that the plot method is called every time I click in the chart space and the running through the Plot methods code. I have a suspicion the screen not updating until I click on the chart has something to do with this but am not entirely sure.

    Comment


      #3
      Hi Ross,

      A chart normally only updates when there's been a trade, or when you click as you've found. Market depth can update much more frequently than that. If you're drawing on a chart in OnBarUpdate(), then there's always delay possible with market depth values.

      You may consider overriding the plot method, to draw on the chart independent of bar updates. This area is outside our scope of support, but you can see a sample available at Tools > Edit NinjaScript > Indicator > CustomPlotSample
      Ryan M.NinjaTrader Customer Service

      Comment


        #4
        Thanks very much Ryan, yes i just found this other thread and it all makes sense to me now.

        I was forgetting that the Plot method is only called off a graphical tick, it explains perfectly why at times I was getting updates and others not.

        Anyway, the answer to this problem was on this thread.



        I have used the forced refresh method and it works great.

        Cheers
        Ross

        Comment


          #5
          Great you were able to sort it out. Thanks for updating and sharing that thread for reference.
          Ryan M.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          571 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          330 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
          548 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          549 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X