Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

after compile a new strategy, it doesn't appear as available!

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

    after compile a new strategy, it doesn't appear as available!

    I am compiling successfully a new strategy, it appears in the folder Strategies of the NinjaScript Editor,
    but when I want to insert it on a chart, this new compiled strategy doesn't appear in the list of available strategies!!!!
    What's happening ?

    #2
    Hello Parmenides48,

    First, compile the script again then, may I have a screenshot of the Name field in OnStateChange() of the Strategy?

    Also, may I have a screenshot of the Strategies window scrolled to where this would appear alphabetically in the list?

    Do any compile errors appear when compiling?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      hello,
      I compiled again ,with no errors, and
      I send yoyu screenshots of the Name field, Strategies window and Strategies available when I try to insert on a chart
      Attached Files

      Comment


        #4
        Hello Parmenides48,

        The namespace doesn't seem to match the folder it is in.

        May I have the script to test on my end?

        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) 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.


        Once exported, please attach the file as an attachment to your reply.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello again, I do it,
          Attached Files

          Comment


            #6
            Hello Parmenides48 ,

            The script you have provided does not match the code in the screenshot.

            'namespace NinjaTrader.NinjaScript.Strategies'

            Have you modified the code?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I don´t have modified the code.
              I just created a new folder in Strategies folder, and I put inside the new folder my script, trying to find the solution,
              but after that I removed the script from the new folder and put it in Strategies folder again, and deleting the new folder.
              But in all cases the mtsb strategy doesn't appear in the window of strategies available

              Comment


                #8
                Hello Parmenides48,

                I'm wanting to test exactly what you have provided a screenshot of so that if it works on my end there isn't any confusion about what is different.

                However, the script is not appearing because you have an error in OnStateChange.

                12/6/2018 3:58:56 PM Default Strategy 'mtsb': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.

                May I confirm you viewed the Log tab of the Control Center to look for errors?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  I have seen now the log Tab and appears that error you are showing me.
                  I have made "save as..." different names and times the original "mts" script.
                  The problem comes from here.
                  All the copies from the original mts have a problem.

                  Comment


                    #10
                    Hello Parmenides48,

                    What is the specific error you are seeing?

                    If the script is having an error early on, that would explain why it is not shown in the list. The error would need to be corrected before you could continue. The SaveAs will persist an error to a copy of the script as well, so you need to address the error first.

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

                    Comment


                      #11
                      Hello again.
                      The problem is when I change the definition of sr variable.
                      When I code:
                      public SR sr = new SR();
                      there is no problem.

                      But if I change that definition, and code this one:
                      public SR sr; // instead of define sr as an object I define that as a variable of SR type.

                      and compile, appears the error " error calling the On State Change method.......",
                      and for this reason the strategy doesn´t appear as available when I try to insert to a chart.

                      Now I am going to work on it,
                      trying to create a code for the purpose I want to.
                      Thanks for all.

                      Comment


                        #12
                        Hello Parmenides48,

                        Thank you for the additional details.

                        Yes, it sounds like this is likely just a standard error relating to the objects being used. The error being in OnStateChange tells you the location of the problem, so you would just need to isolate which object is causing the error.

                        If this is caused by changing the public SR variable, which you likely don't need by the way, this is very likely that the object is just null because you removed the = new SR() part in your description.

                        If your intention is to create a new SR object for each list entry, you very likely don't need to make a public SR property at all and just need to create the new SR object when you insert it into the list.

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

                        Comment


                          #13
                          Hi team NT. I have the same exact issue. Can't see my strategy after I compile it. Do you mind to check the code please?

                          Attached Files

                          Comment


                            #14
                            Hello Anquirk,

                            May I confirm you are able to compile with no compile errors in the NinjaScript Editor?

                            Are you also seeing the same error on the Log tab of the Control Center when opening the Strategies window?

                            To confirm you are looking for the name CustomStrategy in the list, is this correct?
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_ChelseaB View Post
                              Hello Anquirk,

                              May I confirm you are able to compile with no compile errors in the NinjaScript Editor?

                              Are you also seeing the same error on the Log tab of the Control Center when opening the Strategies window?

                              To confirm you are looking for the name CustomStrategy in the list, is this correct?
                              Correct the name is MyCustomStrategy and I can see no errors when I compile it and unable to see in my strategies window

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by AttiM, 02-14-2024, 05:20 PM
                              11 responses
                              184 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by fernandobr, Today, 09:11 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by timmbbo, Today, 08:59 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by KennyK, 05-29-2017, 02:02 AM
                              2 responses
                              1,281 views
                              0 likes
                              Last Post marcus2300  
                              Started by itrader46, Today, 09:04 AM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Working...
                              X