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

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 pmachiraju, 11-01-2023, 04:46 AM
          8 responses
          148 views
          0 likes
          Last Post rehmans
          by rehmans
           
          Started by mattbsea, Today, 05:44 PM
          0 responses
          5 views
          0 likes
          Last Post mattbsea  
          Started by RideMe, 04-07-2024, 04:54 PM
          6 responses
          33 views
          0 likes
          Last Post RideMe
          by RideMe
           
          Started by tkaboris, Today, 05:13 PM
          0 responses
          5 views
          0 likes
          Last Post tkaboris  
          Started by GussJ, 03-04-2020, 03:11 PM
          16 responses
          3,283 views
          0 likes
          Last Post Leafcutter  
          Working...
          X