Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ERROR : tried to load additional data

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

    ERROR : tried to load additional data

    Good morning
    I specify that I am a total beginner and that the message is translated by google because I am French and do not speak English, alas...
    I try to develop an indicator by calling another indicator but I have the following error message 'TDUBuySellMomentum' tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state. Attempted to load ZN JUN23 Globex: 1 Tick
    Yet I think I'm doing it right since put the call here: (I thought all the data was loaded )
    Code:
    protected override void OnStateChange()
            {
    
                if (State == State.SetDefaults)
                {
                    Description 
                     ...
                    AddLine(Brushes.DarkTurquoise, 0, "ZeroLine");            
                }
                else if (State == State.DataLoaded)
                {
                    TDUBuySellMomentum1    = TDUBuySellMomentum(Close, NinjaTrader.Data.BarsPeriodType.Second, 15, 15, 2, TDUBuySellMomentumDisplayType.CandleOutline, 10, 60, 400, 4);
                }​
    I finally specify that I am in simulation, if that has an impact...
    I need your help
    thank you​

    #2
    You need to adddataseries(barsperiodtype.second, 15) assuming those are 15 second bars in the tdu indicator, and you need to do that in state.configure. You can't add a nested indicator in state.dataloaded unless all of the data series that it requires have already been loaded in the configure state.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello bicou,

      Thanks for your post.

      QuantKey_Bruce is correct. This error message means that you would need to define an additional 15-second data series to your script if you want to use that series for the indicator in your code.

      The AddDataSeries() method would be used to add the additional data series to the State.Configure section of code in your script.

      See this help guide page for more information and sample code: https://ninjatrader.com/support/help...dataseries.htm
      Please let me know if I may assist further.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment


        #4
        Thank you for your reply.
        A more general question if you allow: Is there an order of preference when declaring the different "States...." because you might as well take good practices from the start.
        THANKS​

        Comment


          #5
          Hello bicou,

          Thanks for your notes.

          You may define the States in OnStateChange() in any order. That said, typically it goes State.SetDefaults, State.Configure, State.DataLoaded, etc.

          See this help guide page for more information about each NinjaScript State and what they do: https://ninjatrader.com/support/help...tatechange.htm

          For information about the lifecycle of a NinjaScript, you may review this help guide page: https://ninjatrader.com/support/help...fecycle_of.htm

          Please let me know if I may assist further.
          <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

          Comment


            #6
            Thanks
            Your answer is perfect for me​

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            566 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            330 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            547 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            548 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X