Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on trying to load additional data

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

    Error on trying to load additional data

    I have 3rd party indicators and data series that are being used. When I try to select the 3rd party data series in the strategy analyzer, I get the error "test tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state."
    I tried looking for guidance on previous posts regarding this issue, but am unable to solve.

    Thank you.

    #2
    Hello Kal1221,

    Thanks for the post.

    The error you are getting is fairly specific, that is generated when the script uses data but the parent script didnt add the same data.

    If you built your own strategy you will need to know what data that indicator adds and then add the same data in your strategy.

    https://ninjatrader.com/support/help...=adddataseries



    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you.
      How do I go about adding these additional data series? Is this something that needs to be coded in?

      Comment


        #4
        Hello

        Correct, here is one of the samples from the link in the last post so I can help clarify:

        Code:
        protected override void OnStateChange()
        {
           if (State == State.Configure)
           {
               // Add a 5 minute Bars object - BarsInProgress index = 1
              AddDataSeries(BarsPeriodType.Minute, 5);
        
           }
        }
        In this sample it is adding a 5 minute series. Assuming the indicator was using a 5 minute series this is what would be added to the strategy. If you used the strategy builder to create this you would instead add this data using the additional data tab.

        If you look in the control center log tab at the error does it specify any other information? In some cases the error can list what series the indicator is adding.


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse,

          I am using the strategy builder and I am unsure how I can add this data. I don't see it in the additional data tab.

          The control center log tab also says "Attempted to load RTY 12-20 Globex: Range 8"
          Range 8 is the data series its trying to load.

          Thanks Jesse

          Comment


            #6
            Hello Kal1221,

            Thanks for taking a look at the error for that information.

            it looks like the indicator is using a range bar so to add that you would need to go to the Additional data tab -> Check use primary instrument unless RTY was not primary in that case select it. In the Type dropdown select Range, then use 8 as the value.

            That will add the secondary the indicator is using and will let it work, depending on how the indicator was programmed it may or may not work as a signal but that will at the least allow for adding it visually.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Hi Jesse,

              The "Range 8" is the name for the custom data series that loads. I suspect its based on a range format for the chart.
              Changing the primary instrument to RTY and Range 8 as you suggested does not work.
              Is it possible for me to share screen with you? Might be easier to walk through this if you are available. Thanks Jesse.

              Comment


                #8
                Hello Kal1221,

                Changing the primary instrument to RTY and Range 8 as you suggested does not work.
                You would need to add the Range 8 in the strategy and not the chart. The Primary on the chart Can be RTY or not, if its not you need to also specify that in the strategy when you add the secondary data by adding the RTY instrument there. The Range 8 needs to be in the strategy specifically and the chart primary can be something else.

                When you made this change in the strategy did you completely remove the strategy from where it was applied and re apply a totally new instance? If you tried doing an F5 that won't work in this case to load the change of data.

                If you added the range but still see a problem can you check the log and make sure it still says range 8 and not a different type or period? It is possible you may need to do this multiple times if that indicator loads multiple data sources. Another factor here would be if the indicator has any option to make its added secondary series variable for example it has a user input to specify it. That type of indicator will not likely be able to be used in this type of use case.

                Regarding a remote session, while we are not able to work on code over remote we can try to work on this further either on the forum or through email. If the custom indicator being used is something which is free and you can link to that I could try to see what would be required. If the item is something protected the next step could be to contact the vendor to see if any other details can be provided on what series it had used in its code.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Hi Jesse,

                  After doing some research on the data series, the data series I have is a hybrid Renko bar.
                  I am trying to add it as a data series by following the instructions here:

                  "You can add a custom BarsType which is installed on your system by casting the registered enum value for that BarsPeriodType. For example: AddDataSeries((BarsPeriodType)14,10);

                  You'd first need to get the registered enum value. You can get that by using this indicator which is publicly available on our NinjaTrader Ecosystem website:Here is a basic guideline of how to import NinjaScript add-ons in NinjaTrader 8:

                  Note — To import NinjaScripts you will need the original .zip file.

                  To Import:
                  1. Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
                  2. From the Control Center window select the menu Tools > Import > NinjaScript Add-on...
                  3. Select the downloaded .zip file
                  4. NinjaTrader will then confirm if the import has been successful.

                  Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'

                  Once installed, you may add the indicator to a chart by:
                  • Right click your chart > Indicators... > Select the Indicator from the 'Available' list on the left > Add > OK
                  Once you know what the custom bar type's enum is, you can then use that when adding your data series:

                  AddDataSeries((BarsPeriodType)enum,10);

                  Make sure you use the actual value that you got for your bars type from the above indicator - adding data series dynamically is not supported, so you can't use a variable there."

                  After installing the Bars Type Identifier and adding it to my chart, nothing appears to be happening. The screen looks the same.
                  Any idea how to resolve this?
                  Thank you.

                  Comment


                    #10
                    Hello Kal1221,

                    The indicator will output to the Output window, you would need to have that open before running it.

                    Please let me know if I may be of additional assistance.
                    JesseNinjaTrader Customer Service

                    Comment


                      #11
                      Hi Jesse,

                      I have been working to try to pull data from a unirenko chart and to enter a trade based on the DM of the unirenko and the current loaded chart.
                      The code I have is the following:


                      else if (State == State.Configure)
                      {
                      AddDataSeries(new BarsPeriod {
                      BarsPeriodType =(BarsPeriodType)2018,
                      BarsPeriodTypeName = "UniRenko",
                      BaseBarsPeriodValue = 1,
                      Value = 2,
                      Value2 = 4
                      });
                      }

                      else if (State == State.DataLoaded)
                      {
                      DM1 = DM(Close, 14);
                      DM2 = DM(Closes[1], 14);
                      }

                      For the conditions:
                      // Set 1
                      if (
                      // Condition group 1
                      && (DM1.ADXPlot[0] > DM1.ADXPlot[1])
                      && (DM1.DiPlus[0] > DM1.DiMinus[0])
                      && (DM1.ADXPlot[0] >= Adxl)
                      && (DM2.ADXPlot[0] >= Adx4))

                      {
                      EnterLong(Convert.ToInt32(DefaultQuantity), "");


                      So for this condition, it's suppose to compare the ADX on the chart that I have loaded the strategy to the Adxl variable. It is also suppose to compare the ADX on a unirenko chart to the variable ADX4. When I load the strategy, it doesn't appear to be checking the condition for the DM2 correctly. I suspect the error is in the state.dataloaded section. Have I done that correctly?

                      Thanks

                      Comment


                        #12
                        Hello Kal1221,

                        Thank you for the reply.

                        When you say that you think the condition is not happening correctly, what do you mean? Are you seeing an incorrect value or what is happening in your condition that's unexpected?

                        The section in DataLoaded would be the standard way to create variables for indicators. The DM doesn't specifically use an input in its code so it may be a case where that needs to be also called from OnBarUpdate if that is part of the problem.


                        I look forward to being of further assistance.
                        JesseNinjaTrader Customer Service

                        Comment


                          #13
                          Hi Jesse,

                          The values are incorrect.
                          In this case, how would I call on it with OnBarUpdate?

                          Thank you!

                          Comment


                            #14

                            Hello Kal1221,

                            One Item I just noticed after looking at this again is that you are not using any BarsInProgress condition here so the condition is happening for both the primary and the renko you added.

                            One thought here is to just surround the logic with a condition to make it execute on the series you expected, that may or may not be the solution:

                            Code:
                            if(BarsInProgress == 0)
                            {
                            For the conditions:
                            // Set 1
                            if (
                            // Condition group 1
                            && (DM1.ADXPlot[0] > DM1.ADXPlot[1])
                            && (DM1.DiPlus[0] > DM1.DiMinus[0])
                            && (DM1.ADXPlot[0] >= Adxl)
                            && (DM2.ADXPlot[0] >= Adx4))
                            
                            {
                            EnterLong(Convert.ToInt32(DefaultQuantity), "");
                            
                            }
                            Can you check if that is the reason before we continue further? This would make the condition only execute on the primary but then use the two indicators. If the value is still off you may want to try instead using a condition like the following:
                            Code:
                            if(BarsInProgress == 1)
                            {
                                DM2 = DM(14);
                            }



                            I look forward to being of further assistance.

                            JesseNinjaTrader Customer Service

                            Comment


                              #15
                              Hi Jesse,

                              That might be it.
                              Currently my code is as follows:
                              protected override void OnBarUpdate()
                              {
                              if (BarsInProgress != 0)
                              return;

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

                              // Set 1
                              if (
                              // Condition group 1
                              && (DM1.ADXPlot[0] > DM1.ADXPlot[1])
                              && (DM1.DiPlus[0] > DM1.DiMinus[0])
                              && (DM1.ADXPlot[0] >= Adxl)
                              && (DM2.ADXPlot[0] >= Adx4))

                              {
                              EnterLong(Convert.ToInt32(DefaultQuantity), "");


                              I tried changing the BarsInProgress to:


                              {
                              if (BarsInProgress == 0)
                              return;

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

                              // Set 1
                              if (
                              // Condition group 1
                              && (DM1.ADXPlot[0] > DM1.ADXPlot[1])
                              && (DM1.DiPlus[0] > DM1.DiMinus[0])
                              && (DM1.ADXPlot[0] >= Adxl)
                              && (DM2.ADXPlot[0] >= Adx4))

                              {
                              EnterLong(Convert.ToInt32(DefaultQuantity), "");

                              However, it doesn't seem to fix the issues either. How would setting up
                              if(BarsInProgress == 1) work in this case? Do I need to nest it in the condition group 1 somehow?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by shdjjskhg, Today, 08:55 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post shdjjskhg  
                              Started by Roman Hrabovskyi, Today, 07:51 AM
                              0 responses
                              7 views
                              0 likes
                              Last Post Roman Hrabovskyi  
                              Started by Scotty33, Today, 05:45 AM
                              1 response
                              15 views
                              0 likes
                              Last Post s.kinra
                              by s.kinra
                               
                              Started by aaajv, Today, 06:45 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post aaajv
                              by aaajv
                               
                              Started by MarkTee, Today, 02:53 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post MarkTee
                              by MarkTee
                               
                              Working...
                              X