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

Strategy Analyzer Not Loading Strategy

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

    Strategy Analyzer Not Loading Strategy

    I am trying to test my unlocked strategy but it won't pull up in the strategy analyzer. The strategy is visible in drop-down to select for running the backtest but the parameters do not pull up and the description is wrong. I renamed some of the strategies and made copies by right-clicking in the editing window and doing 'save as'. Some of the copies are working and some are not. Thanks for your help!

    #2
    Hello TOOLMachine462,

    Thank you for writing in and welcome to the NinjaTrader Support Forum!

    Once you have created the copy with the Save As selection, have you compiled the new script? To do this, you'll need to right-click within the code and select Compile or press F5 on your keyboard.

    Once you have done this, does the strategy in question now appear in the Strategy Analyzer correctly?
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Yes, well I clicked the compile button in the top menu then saved it. It has no errors. Is there a limit to the number of user parameters you can have?

      Comment


        #4
        Hello TOOLMachine462,

        There is not a limit to the amount of parameters you can have in an unlocked NinjaScript strategy.

        Can you please provide the script you are trying to load in the Strategy Analyzer that is missing parameters so I may test on my end?

        To export your script do the following:
        1. Click File -> Utilities -> Export NinjaScript
        2. Enter a unique name for the file in the value for 'File name:'
        3. Select the strategy from the objects list on the left -> click the right facing arrow ">" to add the strategy to the export
        4. Click the 'Export' button -> click 'yes' to add any referenced indicators to the export -> click OK to clear the export location message


        By default your exported file will be in the following location:
        • (My) Documents/NinjaTrader 7/bin/Custom/ExportNinjaScript/<export_file_name.zip>


        Below is a link to the help guide on Exporting NinjaScripts.
        http://www.ninjatrader.com/support/h...nt7/export.htm
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          I think the @strategy.cs file is damaged, or whatever controls all the strategies. It's like it doesn't see the strategy when I select it in the drop-down. It stays on the strategy that was selected prior to the new one.
          Attached Files
          Last edited by TOOLMachine462; 04-21-2016, 09:54 AM.

          Comment


            #6
            Hello TOOLMachine462,

            When compiling one script in NinjaTrader, all scripts will be compiled at the same time. A successful compile would denote that all scripts are free of compile errors.

            Does this occur even on a default strategy, such as the SampleMACrossOver? Are you able to select the SampleMACrossOver strategy in the Strategy Analyzer?
            Zachary G.NinjaTrader Customer Service

            Comment


              #7
              Yes, most of the strategies are fine. Only my long strategies are having issues.

              Comment


                #8
                Hello TOOLMachine462,

                I was unable to import the file you have provided me in your previous post.

                Can you please provide the script you are trying to load in the Strategy Analyzer that is missing parameters so I may test on my end?

                To export your script do the following:
                Click File -> Utilities -> Export NinjaScript
                Please ensure "Export selected source files" is selected so I may look at the source code
                Enter a unique name for the file in the value for 'File name:'
                Select the strategy from the objects list on the left -> click the right facing arrow ">" to add the strategy to the export
                Click the 'Export' button -> click 'yes' to add any referenced indicators to the export -> click OK to clear the export location message

                By default your exported file will be in the following location:
                (My) Documents/NinjaTrader 7/bin/Custom/ExportNinjaScript/<export_file_name.zip>

                Below is a link to the help guide on Exporting NinjaScripts.
                Zachary G.NinjaTrader Customer Service

                Comment


                  #9
                  The exported file is not showing up in the folder to upload.

                  Comment


                    #10
                    Hello TOOLMachine462,

                    Are you seeing any errors when you try to export your strategy?

                    Do any messages appear in the Log tab of the Control Center when you try to export?
                    Zachary G.NinjaTrader Customer Service

                    Comment


                      #11
                      I was looking in wrong folder. I swear this day can't end fast enough! LOL
                      Attached Files

                      Comment


                        #12
                        Hello TOOLMachine462,

                        I see you are attempting to access information that cannot be accessed from Initialize().

                        Please take a look at this help guide link for information about Initialize(): http://ninjatrader.com/support/helpG...initialize.htm

                        Your strategy is unable to be properly initialized, which is why it's unable to be selected within the Strategy Analyzer.

                        Lines 45-76 cannot be placed in Initialize(). You will want this logic in OnBarUpdate().
                        Zachary G.NinjaTrader Customer Service

                        Comment


                          #13
                          Thank you! That worked. I must have pasted it in the wrong area.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by kevinenergy, 02-17-2023, 12:42 PM
                          117 responses
                          2,764 views
                          1 like
                          Last Post jculp
                          by jculp
                           
                          Started by Mongo, Today, 11:05 AM
                          5 responses
                          15 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by SightCareAubetter, Today, 12:55 PM
                          0 responses
                          3 views
                          0 likes
                          Last Post SightCareAubetter  
                          Started by traderqz, Today, 12:06 AM
                          8 responses
                          16 views
                          0 likes
                          Last Post traderqz  
                          Started by SightCareAubetter, Today, 12:50 PM
                          0 responses
                          1 view
                          0 likes
                          Last Post SightCareAubetter  
                          Working...
                          X