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

"ForceRefesh" there is no forcing here...

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

    "ForceRefesh" there is no forcing here...

    Hello,

    Drawing attention the the following section of the NT8 guide


    Most notebly this sentence

    "Note: As the chart is optimized on a timer, calling ForceRefresh() will NOT immediately trigger a render event. Calling ForceRefesh() simply re-queues the render event to trigger during the next timed event. In other words, it may take up to 250ms for the render event to function."

    When using an event driven command other that OnBarUpdate, lets say it is a toolbar button. THere is a lag caused by NinjaTraders unchangeable 250m before any graphical change can take place. This causes the feeling of substantial disconnect from the UI.

    Is there a way to force the render to take place programmtically? It is a horrible experience pushing buttons with this 250ms lag.....

    I dont need to reduce the 250ms of the chart as much as i need the ability to override this manually on the odd occasion and actually FORCE a refresh rather than queue it.

    See this thread for more info on the same issue. I dont know how to look up the tracking of this submissions though...

    #2
    Hello marty087,

    The ForceRefresh method would be the only supported way to queue a refresh of the chart. What is the specific action that is not happening in a reasonable amount of time?

    The event handler for your button should fire as soon as the button is clicked, but depending what you do in that handler, that may not be updated immediately on the chart.

    If you can explain the outcome of what the button should do I could see if I know of any items to work around that limitation.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      My indicator will calcualte a bunch of techincal levels and then graphically display them using, rays, lines, and text.

      In NT7 there is ChartControl.ChartPanel.Refresh(); which causes the chart to update immediately.

      If i have a button that calculates all the support and reisistance lines on a chart of 10's of thousands of bars, lets say the calcualtion time of my algorithm takes 100ms to process, It processes this and then queues the request to show the lines with "ForceRefresh" which takes another 250ms. So we are looking at 350ms all up. Enough to have the user feeling thouroughly disconnected from the UI when pressing the button.

      In NT7, the same process feels instant. How do I match the funtionality of NT7 in this instance? Or is NT8 "limp" by comparrision in this regard?
      Last edited by marty087; 01-26-2017, 01:55 PM.

      Comment


        #4
        Hello,

        In the case of using Drawing objects, you could try to add a dummy object and remove it after you have done your calculation in the button handler. This would cause the chart to forcibly refresh by resetting the ForceRefresh queue. I had previously commented on this topic here: http://ninjatrader.com/support/forum...36&postcount=7

        Depending on your logic, this could potentially be a solution but this would be something you need to try and see if the result changes. The queuing logic technically should be reset when an object is removed, in the case of the other post that was a resolution in the sense that after the action the dummy object is removed causing the chart to re render.

        In the thread I have linked there is also other undocumented syntax, I would highly advise against using undocumented/internal methods surrounding rendering as these items can cause total platform crashes, not just a handled exception.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          The dummy object didn't work. Thanks for the link.

          If I am honest, I am left scratching my head as to why The NT team has made the force refresh function subject to the minimum chart interval of 250ms, while at the same time stripping the user of the ability to adjust the chart update interval... Is it really that difficult to allow an instant refresh programmatically without opening up Pandora's box?

          For me, this is an issues that really needs to be addressed to ensure that the NT8 is a viable option over NT7. To traders that are accustomed to reading tick pace, 250ms is crippling.

          UPDATE: ChartControl.ChartPanel.Refresh(); has worked perfectly for me. Graphical update time after clicking a button is now instant. HUGE impovement. Just hoping not to have issues using unsupported features...

          Thanks Jesse.
          Last edited by marty087; 01-27-2017, 04:10 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cls71, Today, 04:45 AM
          0 responses
          1 view
          0 likes
          Last Post cls71
          by cls71
           
          Started by mjairg, 07-20-2023, 11:57 PM
          3 responses
          213 views
          1 like
          Last Post PaulMohn  
          Started by TheWhiteDragon, 01-21-2019, 12:44 PM
          4 responses
          544 views
          0 likes
          Last Post PaulMohn  
          Started by GLFX005, Today, 03:23 AM
          0 responses
          3 views
          0 likes
          Last Post GLFX005
          by GLFX005
           
          Started by XXtrader, Yesterday, 11:30 PM
          2 responses
          12 views
          0 likes
          Last Post XXtrader  
          Working...
          X