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 : A hosted indicator tried to load additional data. All data must first be load

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

    #16
    I am also being haunted by this error message. Switched on my PC and got the famous message "A hosted indicator tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state."

    Now the indicator had been working flawlessly yesterday evening. I went back to a prior version. Same problem - indicator would not run. Got the same error message.

    Even when adding the indicator to a virgin chart, I got that message. What I did then was deleting all workspaces, and once the workspaces were all deleted, the error message was gone.

    This points to a serious problem with serializing data. The additional data that was loaded was obviously coming from that workspace/chart. I am further investigating what may have caused the problem.
    Last edited by Harry; 02-11-2017, 04:35 AM.

    Comment


      #17
      My is working now. I had to only execute OnBarsUPdate 2 minute Bars Else an object for the pivot was not being created. Thank-you very much!

      Comment


        #18
        Hello,

        The Piviots indicator adds a secondary series. The Pivots indicator adds a daily series using AddDataSeries(BarsPeriodType.Day, 1);. It is required that this is also added to any script that calls the Pivots indicator.

        Then you must require there to be at least one bar on this secondary day series before being able to make any calls to the Pivots.

        if (CurrentBars[0] < 1 || CurrentBars[1] < 1)
        return;

        This would require both a primary bar and a daily bar before processing any code.

        The Pivots uses if (BarsArray[1].DayCount <= 0)return; and this may also be required for any host script to ensure enough bars of the secondary series is loaded.


        From the help guide:

        "Should your script be the host for other scripts that are creating indicators and series dependent resources in State.DataLoaded, please make sure that the host is doing the same AddDataSeries() calls as those hosted scripts would. For further reference, please also review the 2nd example below and the 'Adding additional Bars Objects to NinjaScript' section in Multi-Time Frame & Instruments"



        Also:

        "Note: To maximize data loading performance, any NinjaScript object (indicator or strategy as host) which references a multi-series indicator which calls AddDataSeries must include it's own calls to AddDataSeries(). For example, if the code above was included in an indicator, and that indicator was referenced in a NinjaScript strategy, then the hosting strategy will need to include the same calls to AddDataSeries(). When the strategy adds the additional Bars objects, the calls to AddDataSeries() within the indicator will be ignored. If the Bars objects are not added by the strategy in such cases, and error will be thrown in the Log tab of the Control Center that would read - "A hosted indicator tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state.""




        Any secondary series added with AddDataSeries() in an indicator (hosted script) also has to be added to the strategy or other indicator calling the indicator (host script).

        Any custom series must be initialized when State is State.DataLoaded.

        Any secondary series added should have a CurrentBar check for that bars series index to ensure there are enough bars for any calls that will be made.
        Last edited by NinjaTrader_ChelseaB; 08-13-2018, 12:49 PM.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          Hello [email protected],

          Harry has let me know in another thread, this behavior can only be reproduced when TickReplay is enabled.



          We've got the behavior reported.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            I get this in live with TDA. I'm not loading data.
            The only thing I can think of is the mapping I added for the ticker is not being picked up because of the other bug where it isn't saving.

            Comment


              #21
              Hi sledge,

              Is your error being triggered by a script?

              Is the script calling the Pivots or adding a secondary series and using GetBar()?

              Do you have TickReplay enabled?

              (Is your chart completely blank and not loading cached historical data?)
              Chelsea B.NinjaTrader Customer Service

              Comment


                #22
                Is your error being triggered by a script? Correct.

                Is the script calling the Pivots or adding a secondary series and using GetBar()? No.

                Do you have TickReplay enabled? No.

                (Is your chart completely blank and not loading cached historical data?) No, but the chart isn't updating. It does work fine on standard symbols that are predefined (SPY, ^VIX). Some how I managed to get it to work last week Monday morning around 8:00am, but I could not for the life of me get it today. I gave up. I works fine in NT8B9 on my other laptop, since the Instrument edit doesn't get lost.

                Further information: Pivots throws the same error, and so does EMA in that chart.
                This chart is completely dead.

                I created a new chart and my indicator is now working.

                So the steps I have to do with NT8B4 when restarting -

                1) Open Instrument Editor,
                2) changed to US Equities ETH
                3) add TDA Symbol $ISSU to ^ADV
                4) connect to TDA
                5) Create new ^ADV chart
                6) Add indicator to chart.

                If I don't do these steps in this order, it probably won't work.

                Comment


                  #23
                  There is a general problem with release 8.0.4.0 that it does not correctly apply instrument settings. For example all changes in trading hours are not applied to the template <instrument settings>. Changes in rollover dates are not correctly applied.

                  I have switched back to 8.0.3.1.

                  It may well be that the problems go away when you go back to the prior release.

                  Comment


                    #24
                    Hello Sledge,

                    The error "A hosted indicator tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state." does not require real-time data, this only requires historical data.

                    Is this the error you are reporting?

                    Does the indicator call any other indicators?

                    I have asked:
                    Is the script calling the Pivots or adding a secondary series and using GetBar()?

                    You have responded:
                    No.

                    Then you say:
                    1) Open Instrument Editor,
                    2) changed to US Equities ETH
                    3) add TDA Symbol $ISSU to ^ADV

                    You are saying that you are adding additional series to the script with AddDataSeries(), is this correct?
                    But .GetBar() is not being called, is this correct?

                    Please simplify your indicator to the bare minimum to reproduce this behavior and post an export with your next post so that I may test on my end.
                    Last edited by NinjaTrader_ChelseaB; 02-28-2017, 10:01 AM.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #25
                      Does this error still occur in latest version of NT8?

                      Am I right, that I have to look inside every indicator which I am using in my strategy regardless if it is an system or third-party indicator to detect usage of additional DataSeries?
                      Otherwise I am not able to know if I have to duplicate AddDataSeries calls?

                      Comment


                        #26
                        Hello DarthTraderson,

                        Yes, in the latest version of NinjaTrader 8 (8.0.7.1) any series added to an indicator must also be added to the host strategy or indicator.

                        From the help guide:
                        "Should your script be the host for other scripts that are creating indicators and series dependent resources in State.DataLoaded, please make sure that the host is doing the same AddDataSeries() calls as those hosted scripts would. For further reference, please also review the 2nd example below and the 'Adding additional Bars Objects to NinjaScript' section in Multi-Time Frame & Instruments"



                        Unfortunately, no, NinjaTrader does not detect added series when the script is compiled, but instead detects this in run-time as the script is enabled. If the hosted series is not satisfied the error will be produced.

                        Would you like to submit a feature request to trigger an error after the script is compiled if the hosted series is not satisfied in the host script?
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #27
                          Yes I would like to add a feature request.

                          In addition to the error message there should be a comment on which DataSeries should be added to the host script, right after compilation. Otherwise and using locked and protected indicators we don't know which series to add. We always have to ask the developer.

                          Please give this request a very high priority because it is easy to implement but in my opinion very critical for further usage of NT8 and third party tools.

                          Comment


                            #28
                            Hello DarthTraderson,

                            Your request for the unsatisfied hosted data series error message to include the bars period information of the referenced series is being tracked with ID #SFT-2548.

                            Please note, it is up to the NinjaTrader Development to decide if and when a feature request will be implemented.

                            Thank you for the suggestion. Please let me know of any other requests you have for the NinjaTrader platform.
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #29
                              False contract month loaded after changing the bar period

                              NT 8.0.8.0 Had a special case this morning.

                              (1) I open a 30 min chart with a future contract month (such as ZB 12-17) a few days prior to rollover in mode "mergebackadjusted". As a result NinjaTrader correctly displays a chart for the current contract month ZB 09-17.

                              (2) I then apply an indicator that loads daily and minute data via a secondary bar series in State.Configure.

                              Code:
                              AddDataSeries(BarsPeriodType.Minute, 1);
                              AddDataSeries(BarsPeriodType.Day, 1);
                              (3) In a third step I change the bar period from 30 min to 60 min and get the well-known error message

                              "A hosted indicator tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state."


                              Hidden problem

                              The message was obtained although there was no hosted indicator. The indicator does not call any other NinjaScript indicators and was simply applied to a plain chart.

                              The real problem lies elsewhere.

                              When I add an indicator to a chart with a contract that has not yet become the front month contract, NinjaTrader substitutes the selected contract with the front month contract. In the case that I have described above, the indicator applied to ZB 12-17 is actually running on ZB 09-17. This is shown in the upper left corner of the chart.

                              However, when I change the bar period from 15 min to 60 min, the subsitution does no longer work. NinjaTrader now tries to run the indicator on data for ZB 12-17 which is not yet loaded. This causes the error message.


                              Problem can be identified on the chart

                              When the indicator is first applied to the chart it runs on the current front month contract ZB 09-17. When the bar period is changed from 30 min to 60 min, the indicator is now applied to the future front month contract ZB 12-17. As NinjaTrader has not loaded the data for this contract month in mode mergebackadjusted, the indicator fails to run.

                              See screenshots below.
                              Attached Files
                              Last edited by Harry; 09-12-2017, 12:03 PM.

                              Comment


                                #30
                                Hello Harry,

                                Thank you for reporting the behavior.

                                I will look into this and report the behavior if I am able to reproduce.

                                I appreciate your patience.
                                Chelsea B.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by elirion, Today, 01:36 AM
                                0 responses
                                3 views
                                0 likes
                                Last Post elirion
                                by elirion
                                 
                                Started by gentlebenthebear, Today, 01:30 AM
                                0 responses
                                2 views
                                0 likes
                                Last Post gentlebenthebear  
                                Started by samish18, Yesterday, 08:31 AM
                                2 responses
                                9 views
                                0 likes
                                Last Post elirion
                                by elirion
                                 
                                Started by Mestor, 03-10-2023, 01:50 AM
                                16 responses
                                389 views
                                0 likes
                                Last Post z.franck  
                                Started by rtwave, 04-12-2024, 09:30 AM
                                4 responses
                                33 views
                                0 likes
                                Last Post rtwave
                                by rtwave
                                 
                                Working...
                                X