Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Automatically refresh chart every few minutes

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

    Automatically refresh chart every few minutes

    hello

    is it possible to refresh charts (F5) automatically using a scrip or an addon every few minutes?

    Thanks.
    saumil

    #2
    F5 performs a 'Reload NinjaScript', which reloads all indicators, which
    appears to 'refresh' the chart, because all indicators end up re-processing
    all the bars on the chart, forcing each indicator to completely repaint itself.

    You could use a Timer and SendKeys to do that.

    But that is probably not a good long term solution.

    Why?
    With some indicators that are real-time only, F5 forces these indicators to see
    every bar on the chart as historical, meaning the 'real-timeliness' effects of those
    real-time indicators will disappear after the refresh.. Also, with a lot of 'days back'
    loaded on to the chart, and especially with some hefty cpu-intensive indicators
    running, there could be a noticeable delay as all bars get re-processed.

    My point is:
    A larger issue probably exists that underlies your question -- do you have
    an indicator that only seems to work properly if you keep pressing F5
    every few minutes? If so, that is a separate issue, and can usually be
    fixed.
    Last edited by bltdavid; 08-28-2020, 01:25 AM.

    Comment


      #3
      My point is:
      A larger issue probably exists that underlies your question -- do you have
      an indicator that only seems to work properly if you keep pressing F5
      every few minutes? If so, that is a separate issue, and can usually be
      fixed.


      Exactly. I see missing TPOs unless i do F5 refresh.
      So how can it be fixed?

      Thanks for reply.

      Comment


        #4
        What is the name of the indicator you are referring to?
        Last edited by bltdavid; 08-28-2020, 04:28 AM.

        Comment


          #5
          coderfortraders.com Pro Suite Gold.

          as new data comes in some spots are missing in the TPO chart.

          so is it Ninja issue or indicator issue ?

          Comment


            #6
            Hello saumil,

            Thanks for opening the thread.

            If you are seeing issues with that indicator, the question would be best addressed to the developer of that indicator. In this case, I would suggest reaching out to CodeForTraders to get their insight on the matter you are seeing with missing TPO's.

            As bltdavid mentions, it is possible to force refreshes by invoking the F5 key on a timer, but we would not recommend doing this at all.

            We look forward to assisting.
            JimNinjaTrader Customer Service

            Comment


              #7
              Thanks Jim & bltdavid

              However the larger issue is some form of automated refresh which is missing and if it can be included in future version of NT8 it would be great!

              Comment


                #8
                Originally posted by saumil View Post
                However the larger issue is some form of automated refresh which is missing and if it can be included in future version of NT8 it would be great!
                My 2˘ is this:
                NinjaTrader may or may not add an automated refresh feature.
                That's certainly their prerogative -- such a feature could be a good thing.
                But I prefer they decline, on the grounds that it could become a vendor crutch.
                Why? Because vendors need to be encouraged to write proper functioning code,
                and not depend on some 'feature' in NT8 to compensate for their incompleteness.

                I've been in software engineering round-table discussions where a feature request
                could actually degrade the overall product experience in some way or another.
                Given the 'law of unintended consequences' this feature feels like one of those,
                ie, the potential for vendor abuse is arguably a real thing, and so my Engr Mgmt
                gut reaction is it should be declined. IMHO, of course.

                Therefore, I think the real larger issue is: the vendor needs to address the problem.

                Have you brought this issue to their attention?
                What was their response?

                -=0=-

                In the meantime, you might also consider using AutoHotkey to automate pressing
                the 'F5' key.

                Comment


                  #9
                  Originally posted by bltdavid View Post
                  In the meantime, you might also consider using AutoHotkey to automate pressing
                  the 'F5' key.
                  I should have mentioned that AutoHotkey supports timers.

                  Why? Because it seems kind of ridiculous to write an AutoHotkey
                  script to, uh, press the 'F5' key ... Why? Because AHK scripts are
                  themselves invoked by assigning them to a key ... so they, uh, require
                  a key press to activate ... nothing to gain if you substitute one key
                  press for another, right?

                  But, if you could add a timer to that script, well, now you've got
                  something ...

                  Comment


                    #10
                    wow. Never thought of that. Thanks bltdavid. will try it out.

                    Thanks

                    Comment


                      #11
                      Could you modify a custom NinjaScript indicator to send the F5 key to the operating system using the C# method SendKeys(), but perform this at the close of each bar and only refresh the current closed bar, not the chart history? I really need the indicator to see each bar as historical. The indicator historical plots are way better than the live market plots.

                      Comment


                        #12
                        Hello Tavor,

                        Invoking the F5 key to reload NinjaScripts will reload all NinjaScripts on the chart. This would not reload "just the last bar."

                        The question should instead be: what is the root issue with the realtime calculation, and how can that be solved?

                        Note that if you use Calculate.OnBarClose, your calculations would be performed the same with historical processing as they would with realtime processing. If you trust the OnBarClose calculated values form your indicator more, you can consider keeping an OnBarClose instance of your indicator on the chart.
                        JimNinjaTrader Customer Service

                        Comment


                          #13
                          Hi Jim, great feedback...thank you! Here's the rub with the indicator. The indicator requires calculate "On each tick" because it's tracking the average delta over 15 one minute bars? If I set it to "On bar close" in the live market it doesn't plot. The indicator signals when it gets at or above 2 standard deviations from that 15 period average. In this case the indicator will plot on the bar with either 2 arrows (2 standard deviations threshold met) or 3 arrows (3 standard deviations threshold met.) If the Standard Deviation Multiplier is changed from 2 to 1, then the indicator will plot on the bar with either 1, 2, or 3 arrows.

                          I'm trying to understand the following and I know these questions are more suitable for the developer, but any feedback is appreciated: If I load a historical chart and apply the indicator or do an F5 in the live market, the indicator plots are how I want them. So there must be something in the code that causes the indicator to plot the same way in both those scenarios. However, in the live market the indicator plots totally different. If the indicator is coded with rules on when to plot then why would it plot differently dependent on if the indicator was applied to historical chart/performing an F5 in the live market or plotting in realtime in a live market?

                          I agree that Calculate.OnBarClose in the realtime would solve this issue and give me the historical processing I'm looking. That's essentially how the indicator is plotting with historical chart load or F5. So it can plot OnBarClose, but in realtime it won't plot at all with that setting. That's what I don't understand.

                          Comment


                            #14
                            Hello Tavor,

                            This question would indeed require a further look from the developer. -We could not explain how the indicator was written and how its code operates.
                            JimNinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by bltdavid View Post

                              I should have mentioned that AutoHotkey supports timers.

                              Why? Because it seems kind of ridiculous to write an AutoHotkey
                              script to, uh, press the 'F5' key ... Why? Because AHK scripts are
                              themselves invoked by assigning them to a key ... so they, uh, require
                              a key press to activate ... nothing to gain if you substitute one key
                              press for another, right?

                              But, if you could add a timer to that script, well, now you've got
                              something ...
                              AHK refreshes automatically - no key needs to be assigned.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Aviram Y, Today, 05:29 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post Aviram Y  
                              Started by quantismo, 04-17-2024, 05:13 PM
                              3 responses
                              25 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by ScottWalsh, 04-16-2024, 04:29 PM
                              7 responses
                              34 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by cls71, Today, 04:45 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post cls71
                              by cls71
                               
                              Started by mjairg, 07-20-2023, 11:57 PM
                              3 responses
                              217 views
                              1 like
                              Last Post PaulMohn  
                              Working...
                              X