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

NT8 Add'l data loading in Strategy Builder V 8.0.19.1 64-bit

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

    NT8 Add'l data loading in Strategy Builder V 8.0.19.1 64-bit

    NT8 Strategy Builder created the attached strategy in previous NT8 versions which ran well and Strategy Analyzer could test it. This latest release prevents it from working providing error message that indicators "tried to load additional data. All data..." It objects to the primary data of the strategy analyzer and not the add'l data sets that are in the strategy.

    Tried adding the primary chart to the add'l data in the strategy builder but that did not work either.

    May I request this be fixed so it will work as it has for many previous NT8 versions?
    Attached Files
    Last edited by JMont1; 11-09-2019, 02:25 PM.

    #2
    Hello JMont1,

    I am not able to compile this script as it has dependencies.

    To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
    1. Click Tools -> Export -> NinjaScript...
    2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
    3. Click the 'Export' button
    4. Enter a unique name for the file in the value for 'File name:'
    5. Choose a save location -> click Save
    6. Click OK to clear the export location message
    By default your exported file will be in the following location:
    • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
    Below is a link to the help guide on Exporting NinjaScripts.



    An indicators that are being called by the strategy that have AddDataSeries() will need that same AddDataSeries() call added to the strategy.

    Do the indicators called by this strategy have AddDataSeries()?
    Have you also copied all of those AddDataSeries() calls to the strategy?

    From the help guide:
    "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.""
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello JMont1,

      I am not able to compile this script as it has dependencies.

      To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
      1. Click Tools -> Export -> NinjaScript...
      2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
      3. Click the 'Export' button
      4. Enter a unique name for the file in the value for 'File name:'
      5. Choose a save location -> click Save
      6. Click OK to clear the export location message
      By default your exported file will be in the following location:
      • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
      Below is a link to the help guide on Exporting NinjaScripts.
      http://ninjatrader.com/support/helpG...-us/export.htm


      An indicators that are being called by the strategy that have AddDataSeries() will need that same AddDataSeries() call added to the strategy.

      Do the indicators called by this strategy have AddDataSeries()?
      Have you also copied all of those AddDataSeries() calls to the strategy?

      From the help guide:
      "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.""
      https://ninjatrader.com/support/help...tToninjascript
      @NinjaTrader_ChelseaB My strategies often add in add'l data sets. This one simply had the primary data set 30 second added. But I took that out and now it should all be the chart data set default. Yet it still provides errors for tying to add data sets.
      Last edited by JMont1; 11-13-2019, 08:25 AM.

      Comment


        #4
        Hello JMont1,

        From the export you have provided I am showing this is not the case.

        I am showing in the RangeMALineD01 indicator on line 199:
        AddDataSeries(Instrument.FullName, barPeriod, barInterval);

        This is a call to AddDataSeries(). That exact same call must also be in the strategy that calls it.
        I do not see this in the z28stepNo30 strategy. Thus, an error occurs. This is what I am describing in post #2.

        Further, this is a violation of another item in the help guide in that it is using dynamic variables.
        "Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided. Trying to load bars dynamically may result in an error similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner."
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello JMont1,

          From the export you have provided I am showing this is not the case.

          I am showing in the RangeMALineD01 indicator on line 199:
          AddDataSeries(Instrument.FullName, barPeriod, barInterval);

          This is a call to AddDataSeries(). That exact same call must also be in the strategy that calls it.
          I do not see this in the z28stepNo30 strategy. Thus, an error occurs. This is what I am describing in post #2.

          Further, this is a violation of another item in the help guide in that it is using dynamic variables.
          "Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided. Trying to load bars dynamically may result in an error similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner."
          https://ninjatrader.com/support/help...tToninjascript
          NinjaTrader_ChelseaB I am still convinced there is an issue with adding secondary timeframes in NT8 Strategy Builder.
          Attached is my basic (NOT profitable,) strategy base used for testing if additional indicators will work, named aBase1.
          aBase1withTickZ only adds an additional data series of 1 tick for the m=primary DS.
          aBase1 will return trades in Strategy analyzer. aBase1withTickZ, only adding the additional TF, will not return any trades. The new TF is not being referenced by anything other than being added.
          PLEASE help me resolve this which has been limiting my SB variations that would hopefully go on to add MTF's of other instruments. Thank you.
          Attached Files

          Comment


            #6
            Hello JMont1,

            That I can see, the new exports you have provided do not call any indicators that add a 1 tick series and it appears the 1 tick series is never used.
            When adding a series with AddDataSeries are you still getting an error message on the Log tab of the Control Center?

            Are you inquiring about a new unrelated issue?


            Debug the script to understand why the strategy is not placing orders.

            If the expected trade(s) are not appearing, this would indicate that the condition to place the order is not evaluating as true and the order is not being submitted, or the order is being ignored for other reasons, or the order is being cancelled.

            To understand why the script is behaving as it is, such as placing orders or not placing orders or drawing objects when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

            In the strategy add prints (outside of any conditions) that print the date time of the bar and all values compared in every condition that places an order.
            The prints should include the time of the bar and should print all values from all variables and all hard coded values in all conditions that must evaluate as true for this action to be triggered. It is very helpful to include a text label for each value and for each comparison operator in the print to understand what is being compared in the condition sets.

            Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

            Further, enable TraceOrders which will let us know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

            I am happy to assist you with analyzing the output from the output window.

            Run or backtest the script and when the output from the output window appears save this by right-clicking the output window and selecting Save As... -> give the output file a name and save -> then attach the output text file to your reply.

            Below is a link to a forum post that demonstrates using informative prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.

            https://ninjatrader.com/support/foru...121#post791121

            Please let me know if I may further assist with analyzing the output or if you need any assistance creating a print or enabling TraceOrders.​
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              NinjaTrader_ChelseaB This is the same issue. Strategy Builder will not even start when I simply add another dataseries even though it is not being referenced.

              NT Forum recommended that adding a 1 tick DS to a bot would help for better back test and replay. So, i have been attempting to accomplish it.

              So, this is the most basic BOT. Only entering based on price above VWMA.

              Then I add primary/Tick/1 DS. And it does not even start. Shows error on bar update.

              Hope you can help.
              Attached Files

              Comment


                #8
                Hello JMont1,

                Which script do you want assistance with?

                How about your aBase1 script you posted in post #5? Is this causing an error?

                Can you provide the log showing the error with this script?

                With aBase1NTforum this appears to be enabled and placing orders..

                2022-10-10 14:00:50:516|1|4|Enabling NinjaScript strategy 'aBase1NTforum/275334101' : On starting a real-time strategy - StartBehavior=WaitUntilFlat EntryHandling=Unique entries EntriesPerDirection=2 StopTargetHandling=Per entry execution ErrorHandling=Ignore all errors ExitOnSessionClose=True / triggering 59 seconds before close SetOrderQuantityBy=Strategy ConnectionLossHandling=Keep running DisconnectDelaySeconds=10 CancelEntriesOnStrategyDisable=True CancelExitsOnStrategyDisable=False Calculate=On each tick IsUnmanaged=False MaxRestarts=7 in 7 minutes
                2022-10-10 14:00:50:535|1|4|NinjaScript strategy 'aBase1NTforum/275334101' submitting order
                2022-10-10 14:00:50:588|1|32|Order='8c1cb11cb95249318f9fe8d14 b9010cc/Sim101' Name='L2' New state='Submitted' Instrument='NQ 12-22' Action='Buy' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''

                As far as I can tell it is started..​
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  NinjaTrader_ChelseaB The error occurs when a secondary dataseries is added to a working SB system. The provided files in Visitor Messages dumbed down the post Uncategorized Groups to be very simplistic and not to giving any concern that the issue was being caused by a condition in a step, or by an iindicator.

                  The SB bot works. BUT when I simply add a secondary dataset the bot will not start.
                  Perhaps you can try it with a bot you are familiar with and see if I am correct. I used the data set/primary/tick=1. May I request you attempt to add that and see if your SB fails. Thank you.

                  Comment


                    #10
                    Hello JMont1,

                    No, I am not able to produce an error when adding a series in the Strategy Builder.

                    Below is a link to a video.


                    Can you reproduce the error with the steps in the video?

                    Provide the output from the output window from that script showing the error.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      NinjaTrader_ChelseaB Video shows a Strategy Builder cs file and that I can successfully start a SB strategy with it. Then I add a dataset of primary/tick=1 and compile. Then I attempt to run the same strategy and now it gives an error.

                      Please review and assist in solving this bug. Thank you.

                      System will not let me upload videos - please provide direction. Tried 2 video systems, Camtasia and OBS. Both file types were rejected.
                      Last edited by JMont1; 10-13-2022, 04:28 AM.

                      Comment


                        #12
                        Hello JMont1,

                        Note, I am uploading videos to google drive and providing you a link.

                        You can also use jing from techsmith to create short videos.

                        To confirm, you are using 8.0.26.1 and you have followed the exact steps shown in the video I have provided you in post Reports but you experiencing different behavior?
                        Is this correct?
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          NinjaTrader_ChelseaB I can do exactly as you did without an error. So, should I upload that to a drive?

                          The error I am having is trying to add the additional Data Set to a compiled Bot that is working fine until I add the new data set. I have a video showing that also. I show that the bot starts without a problem, although it is orange because it would have been in a trade. Then I add the tick data just as you did. And the bot will not start.

                          How can I get these videos to you since upload attachments will not accept them? The google drive you provided does not show any place I can see where i could upload. Only can review your video. Thank you for your assistance.

                          Comment


                            #14
                            Hello JMont1,

                            Google Drive is a cloud storage service like One Drive or Dropbox. You would upload to your own google account and click share to provide a link.

                            Or you can use wetransfer if you don't feel comfortable using cloud storage services.
                            WeTransfer is the simplest way to send your files around the world


                            When you say "compiled Bot", do you mean a NinjaScript Strategy in the Strategy Builder?

                            To confirm, you can reproduce with the script you posted in post Uncategorized Groups with no changes?

                            Please provide the output from that script.
                            Chelsea B.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by warreng86, 11-10-2020, 02:04 PM
                            4 responses
                            1,354 views
                            0 likes
                            Last Post mathewlo  
                            Started by Perr0Grande, Today, 08:16 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post Perr0Grande  
                            Started by elderan, Today, 08:03 PM
                            0 responses
                            5 views
                            0 likes
                            Last Post elderan
                            by elderan
                             
                            Started by algospoke, Today, 06:40 PM
                            0 responses
                            10 views
                            0 likes
                            Last Post algospoke  
                            Started by maybeimnotrader, Today, 05:46 PM
                            0 responses
                            12 views
                            0 likes
                            Last Post maybeimnotrader  
                            Working...
                            X