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

Loading Instruments via Add() is slow

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

    Loading Instruments via Add() is slow

    Hi,

    This is my first time posting in this forum so please bear with me. Also, I am a newbie at programming indicators in NinjaScript. In my Initialize() method I have the following lines of code:

    Code:
    // Add symbols			
    			Add("$EURUSD", PeriodType.Minute, timeFrameInMinutes); // index 1
    			Add("$GBPUSD", PeriodType.Minute, timeFrameInMinutes); // index 2
    			Add("$USDCHF", PeriodType.Minute, timeFrameInMinutes); // index 3
    			Add("$USDJPY", PeriodType.Minute, timeFrameInMinutes); // index 4
    			Add("$USDCAD", PeriodType.Minute, timeFrameInMinutes); // index 5
    			Add("$AUDUSD", PeriodType.Minute, timeFrameInMinutes); // index 6
    			Add("$NZDUSD", PeriodType.Minute, timeFrameInMinutes); // index 7
    The indicator is now running correctly however I am bothered by the fact that going through these lines takes NinjaTrader a long time to load. Is this normal for an indicator loading this much instruments via Add? Is there any alternative way to do this faster/more efficiently?

    Thanks!

    #2
    Welcome to our forums Karl - yes depending on how many days you load the primary series on your charts for this could take some loading time. Which data provider are you working with?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Welcome to our forums Karl - yes depending on how many days you load the primary series on your charts for this could take some loading time. Which data provider are you working with?
      Thanks for replying Bertrand. I'm using Kinetick as my data provider. So one of the things that I can do to hasten load times is to decrease the number of days loaded? Can this be done in the indicator programmatically? Thanks!

      Comment


        #4
        You're welcome, ok. Correct, the less data it had to load overall, the quicker performance should be. It really depends how much you need for your analysis. Programmatically setting this would not be an option unfortunately, it would depend on what you set to use for primary series.

        Allowing more control here is on our feedback list for our next major update of the platform.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,404 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        95 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        8 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        160 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        9 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X