Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ForceRefresh()

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

    ForceRefresh()

    It seems like ForceRefresh() is an almost immediate call to the OnRender(). The main reason I might use this is in the OnMarketDepth() to update ticks on the L2 display.

    I did try adding this to the OnMarketData() function look and under high volume, the screen as you can image becomes unresponsive.

    Is there a major change in "refresh" of the chart? I am hoping to find something that simply marks the chart as Dirty and let it refresh at a normal rate (100 - 200 ms maybe). Is this not possible in the NT8 structure? I can add a wrapper class that will only fire the "ForceRefresh()" after specific period of time has passed, but don't want to add that overhead if it is built into NT8 already.

    #2
    You're correct that it is an immediate call. ForceRefresh does not queue this refresh, it would just force it to update. If you find you're calling it too frequently, you'd need to implement your own timer. There is not another timer object you can hook on to, if that's part of your inquiry.
    MatthewNinjaTrader Product Management

    Comment


      #3
      We will change ForceRefresh to trigger the chart to refresh on its next render loop. (Instead of immediately)

      Comment


        #4
        Originally posted by NinjaTrader_Brett View Post
        We will change ForceRefresh to trigger the chart to refresh on its next render loop. (Instead of immediately)
        hmmm.. I will be using this tied to button's click and would want that refresh to be immediately.. Could possibly see a need for both..

        -=Edge=-
        NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

        Comment


          #5
          Originally posted by NinjaTrader_Brett View Post
          We will change ForceRefresh to trigger the chart to refresh on its next render loop. (Instead of immediately)
          Brett,

          Is the render loop on a timer or would it only happen on a new bar or change to the bar?

          For example, I was using this to update the Chart to show the Level 2 ladder on the side. This updates much more frequently than the chart itself. I want to make sure I understand what the "next render loop" is in NT8. For NT7 I think you could set a refresh rate, I didn't see that setting under NT8 yet.

          Comment


            #6
            Render loop is on a 250ms timer currently. If there is no new bar tick come in the render loop is skipped. Calling ForceRefresh will force it to render on the next render loop (No matter if a new bar/tick comes in or not).

            For the button use case where you want it instantly use ChartControl.InvalidateVisual() to get an instant refresh.

            Comment


              #7
              Originally posted by NinjaTrader_Brett View Post
              Render loop is on a 250ms timer currently. If there is no new bar tick come in the render loop is skipped. Calling ForceRefresh will force it to render on the next render loop (No matter if a new bar/tick comes in or not).

              For the button use case where you want it instantly use ChartControl.InvalidateVisual() to get an instant refresh.
              Thanks, I think that works.

              What happens if I call "ChartControl.InvalidateVisual() " as part of the OnMarketData() loop, will this freeze the UI?

              Comment


                #8
                You wont want to do that and will want to use the ForceRefresh instead . Since OnMarketData can update in speeds up to 25ms which equates to 40 chart re-draws per second which is a lot of redraw work likely causing bad performance.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by andrewtrades, Today, 04:57 PM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by chbruno, Today, 04:10 PM
                0 responses
                6 views
                0 likes
                Last Post chbruno
                by chbruno
                 
                Started by josh18955, 03-25-2023, 11:16 AM
                6 responses
                436 views
                0 likes
                Last Post Delerium  
                Started by FAQtrader, Today, 03:35 PM
                0 responses
                9 views
                0 likes
                Last Post FAQtrader  
                Started by rocketman7, Today, 09:41 AM
                5 responses
                20 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X