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

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.
      Brandon H.NinjaTrader Customer Service

      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.
          Brandon H.NinjaTrader Customer Service

          Comment


            #6
            Thanks
            Your answer is perfect for me​

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by andrewtrades, Today, 04:57 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            5 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            7 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X