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

Refreshing the Chart

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

    Refreshing the Chart

    With NT, charts refresh only when new data arrives. I have things going on that I would like to see without having to wait for the next tick. Is there a way to refresh a chart from within a NT script?

    Thanks
    Dave

    #2
    Originally posted by DaveS View Post
    With NT, charts refresh only when new data arrives. I have things going on that I would like to see without having to wait for the next tick. Is there a way to refresh a chart from within a NT script?

    Thanks
    Dave


    You won't have anything happening in OnBarUpdate,

    You'll need to use OnMarketDepth for bid/ask changes, or do some sort of timing interrupt.

    Comment


      #3
      Hi sledge
      Thanks for your reply. Yes, I realised it would need to be outside OnBarUpdate.
      I think its probably not possible in NT

      Comment


        #4
        Hello DaveS,

        If you want to do some calculations regardless if there is any incoming ticks you would have to have a custom event with a timer object. You may view an example of this at the following thread.
        JCNinjaTrader Customer Service

        Comment


          #5
          Originally posted by DaveS View Post
          Hi sledge
          Thanks for your reply. Yes, I realised it would need to be outside OnBarUpdate.
          I think its probably not possible in NT
          You would have to create your own CustomEvent(), most probably a Timer() of some sort.

          Comment


            #6
            Why not just invalidate and update the ChartPanel when you have something ready to display?

            Code:
            public void Refresh()
                    {
                        m_ChartControl.ChartPanel.Invalidate();
                        m_ChartControl.ChartPanel.Update();
                    }
            This, of course, repaints the panel immediately.
            Last edited by BigWaveDave; 02-24-2013, 03:48 PM.

            Comment


              #7
              Originally posted by BigWaveDave View Post
              Why not just invalidate and update the ChartPanel when you have something ready to display?

              Code:
              public void Refresh()
                      {
                          m_ChartControl.ChartPanel.Invalidate();
                          m_ChartControl.ChartPanel.Update();
                      }
              This, of course, repaints the panel immediately.
              That code would still have to be called by the CustomEvent(), though I usually just use ChartControl.Refresh().

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,603 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              8 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              18 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              4 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              12 views
              0 likes
              Last Post Javierw.ok  
              Working...
              X