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 ETFVoyageur, Today, 02:08 AM
              0 responses
              4 views
              0 likes
              Last Post ETFVoyageur  
              Started by kujista, 04-22-2024, 07:46 AM
              3 responses
              12 views
              0 likes
              Last Post kujista
              by kujista
               
              Started by kujista, 04-23-2024, 06:23 AM
              7 responses
              57 views
              0 likes
              Last Post kujista
              by kujista
               
              Started by SentientDavid, Today, 01:34 AM
              0 responses
              7 views
              0 likes
              Last Post SentientDavid  
              Started by MrForgetful, Today, 01:28 AM
              0 responses
              6 views
              0 likes
              Last Post MrForgetful  
              Working...
              X