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

Indicator loading data multiple time unnecessarily?

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

    Indicator loading data multiple time unnecessarily?

    I have an indicator and over the last couple of days I noticed a big slow-down whenever it reloads. The slow-down is caused by Interactive Brokers feeding out the data really slowly (I'm comparing it to IQFeed).

    It wasn't like this when I started out with the indicator in January otherwise I wouldn't have taken this development plan further. Now though I have what I have and IB is making it a total killer to use because any change means that NT7 goes away and thinks about it for a minute or more while IB outputs the data requested.

    I have these multiple time-frame loading (I use them to calculate support and resistance levels on different time-frames):

    Code:
            protected override void Initialize()
            {
                Overlay = true;
                ZOrder = -1;
                CalculateOnBarClose = false;
                Add(PeriodType.Year, 1);
                Add(PeriodType.Month, 1);
                Add(PeriodType.Week, 1);
                Add(PeriodType.Day, 1);
                Add(PeriodType.Minute, 240);
                Add(PeriodType.Minute, 120);
                Add(PeriodType.Minute, 60);
                Add(PeriodType.Minute, 30);
                Add(PeriodType.Minute, 15);
    So can I do anything to work around this issue?

    I originally had the Add() calls in the opposite order, but that makes no difference.

    Surely though NT7 should realise that it's already gone and got all the data it needs once, without re-doing it all several times?

    #2
    Do you mean when you reload the chart manually? Or just an updating date?

    How many "Days to load" are you setting on the chart?

    In your OnBarUpdate events, do you filter for BarsInProgress?
    MatthewNinjaTrader Product Management

    Comment


      #3
      I mean every time the indicator is loaded. On opening the workspace, on reloading ninjascript, on changing the indicator settings.

      It's set to load 20 days.

      I do filter for BarsInProgress and various operations happen for the different time-frames.

      What is mystifying is that the Ninjatrader Control Center shows always that iit is just loading yesterday, that's all. Repeatedly. Might be nothing, but it strikes me as strange that it never says it's loading more, especially since it's loading those long time-frames.

      Comment


        #4
        I also mean every time the dataseries is changed - either instrument or time-frame. It's a major issue with Interactive Brokers - I can't develop against IB, the minute-long hang-ups are driving me mad.

        Comment


          #5
          Hello adamus,

          Thank you for your response.

          NinjaTrader loads data from your data provider whenever it determines it could potentially not have all the data pertaining to the requested time period.

          You can find additional information on when NinjaTrader loads historical data from the provider at the following link: http://www.ninjatrader.com/support/h...rical_data.htm

          Please let me know if you have any questions.

          Comment


            #6
            Hi Patrick,

            today NinjaTrader is not reloading the data in the same way so the problem isn't manifesting itself.

            From the article you linked to, it seems this must be a cache-related problem. What could be the difference today that makes the cache function, compared to Friday? It isn't my indicator that is different - I didn't make any changes to it, so it must be something in the workspace surely?

            Comment


              #7
              Hello adamus,

              Thank you for your response.

              It is hard to say what could have occurred. It could be corrupted information in the cache that caused the behavior, but that doe snot seem likely as it is working now.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Pattontje, Yesterday, 02:10 PM
              2 responses
              33 views
              0 likes
              Last Post Pattontje  
              Started by abdo22, Yesterday, 03:15 PM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by f.saeidi, Yesterday, 02:09 PM
              3 responses
              20 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Jltarrau, Today, 05:57 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by kujista, Today, 06:23 AM
              0 responses
              2 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X