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

Importing cs files

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

    Importing cs files

    I'm helping someone convert strategies written in NinjaScript to EasyLanguage. I have the cs files, which were evidently exported from NT, but I do not see a way to get them back into my NT platform.

    Thanks.

    Tom

    #2
    Hello Tom,

    Thank you for your note.

    You will have to manually import the .CS files into NinjaTrader.

    To do this copy the .CS files and then paste them into the following directory: My Documents\NinjaTrader 7\bin\Custom\Strategy
    If they are Indicators it will need to be the following directory: My Documents\NinjaTrader 7\bin\Custom\Indicator

    Once complete, go to Tools > Edit NinjaScript > Indicator > select any indicator > OK > once the NinjaScript Editor window opens press F5 on your keyboard to compile your NinjaScript files.

    Please let me know if you receive any errors after compiling the NinjaScript files.

    Comment


      #3
      Worked great. Thanks.

      Comment


        #4
        .cs file use ??

        goodnight,
        I try to import a file of .cs with your instructions and I see after F5, 2 errors appears
        What should I do?

        Comment


          #5
          Hello GILAZ,

          Thank you for your post.

          Please follow the instructions below to see where the errors are coming from after compiling the indicator. This will allow you to debug the indicator/strategy or remove it from your PC. If you are wondering why you receive an error when compiling only one indicator, it is because NinjaTrader always compiles all indicators and strategies - not just one. This is done to give you the highest runtime performance possible.
          • Open NinjaTrader
          • From the Control Center select the Tools menu--> select the Edit NinjaScript menu item--> select Indicator
          • Select any indicator and double click on it (we need only to open and compile one script to see all compile errors for all files).
          • A new window will appear and you will need to right click in the window and select Compile to compile the indicators.
          • At the bottom of the window a new section will appear where you can find the error locations.
          • From there you have the option to comment out offending code sections, remove the complete indicator or debug it to be able to compile again.

          If you are unsure as to what the error is indicating, please send me a screenshot of the error with the name and description fields clearly readable.

          To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CRTL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

          We have also collected more comprehensive steps for resolving NinjaScript programming errors in this tip on our forums - http://www.ninjatrader.com/support/f...ead.php?t=4678

          Comment


            #6
            Error Message :" protected override void GomOnTermination() "
            What I can do now ?

            Comment


              #7
              GILAZ, would you mind emailing us with the files you tried importing at support at ninjatrader dot com so we could check into further?
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Errors after trying to compile a .cs file

                I tried compiling a .cs file described below but I ended up with errors.
                Thanks
                PanamaJack
                Attached Files

                Comment


                  #9
                  Hi PanamaJack,

                  You may have a reference missing to the NinjaTrader.Vendor.dll file.

                  May I have a screenshot of the References window? (right-click the NinjaScript Editor -> select References)

                  To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

                  For detailed instructions please visit the following link
                  http://take-a-screenshot.org/
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Errors after trying to upload a .cs file

                    Came up blank
                    Attached Files

                    Comment


                      #11
                      Errors importing .cs file

                      I am still having the same issues error messages when I try to load Ninja Script and when I try and compile. Attached a trace document from today 6-12-2014

                      Thanks,
                      PanamaJack
                      Attached Files

                      Comment


                        #12
                        HI PanamaJack,

                        All of the system references are missing from this screenshot.

                        My recommendation is that you remove your configuration file and restart NinjaTrader to recreate it and then add back the NinjaTrader.Vendor.dll file.

                        You will need to recreate any connections, and re-set any settings you had previously.

                        To do this:
                        • First save your license key to a text file (Help -> License Key...)
                        • Shutdown NinjaTrader
                        • Delete the file (My) Documents\NinjaTrader 7\config.xml
                        • Restart NinjaTrader
                        • Enter your license key
                        • Click Tools -> Edit NinjaScript -> Indicator -> ADL -> OK
                        • Right-click the NinjaScript editor -> select References...
                        • Click the Add button -> select NinjaTrader.Vendor.dll -> click Open -> click OK
                        • Right-click the NinjaScript editor -> select Compile


                        Let me know if this does not resolve the errors.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Errors on .cs compile

                          Followed the directions but I still have the errors.
                          Thanks,
                          PanamaJack
                          Attached Files

                          Comment


                            #14
                            Hi PanamaJack,

                            These errors look to be specific to the FractalsSRLines and MASLopeMultiV3.42Assy indicators.

                            Meaning good job, you were able to correct the system references.

                            So the list of indicators on the right such as anaButterworthFilter1, anaGaussianFilter1, etc... these all seem to be indicators that the MASlopMulti calls.

                            If you have the original importable packages for the MASLopeMultiV3, my recommendation is to delete any files with this name in the following folder and then compile once they are deleted and use the original importable package to import them again.

                            (My) Documents\NinjaTrader 7\bin\Custom

                            Delete any file with the name MASlopMultiV3.


                            The FractalsSRLines.cs file needs an additional system reference to work that is not added by default. You can delete the FractalsSRLines.cs file and then re-import it, or you can try and add the reference.

                            The reference needed is System.Design.dll and should be in the folder:
                            C:\Windows\Microsoft.NET\Framework64\v2.0.507 27\

                            If you want to delete it and re-import the FractalsSRLines.cs file is in:
                            (My) Documents\NinjaTrader 7\bin\Custom\Indicator
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Errors importing .cs file

                              If you have the original importable packages for the MASLopeMultiV3, my recommendation is to delete any files with this name in the following folder and then compile once they are deleted and use the original importable package to import them again.
                              I made it to the compile step and had more errors.
                              Thanks for the help,
                              PanamaJack
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Mizzouman1, Today, 07:35 AM
                              4 responses
                              18 views
                              0 likes
                              Last Post Mizzouman1  
                              Started by philmg, Today, 01:17 PM
                              1 response
                              4 views
                              0 likes
                              Last Post NinjaTrader_ChristopherJ  
                              Started by cre8able, Today, 01:01 PM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by manitshah915, Today, 12:59 PM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by ursavent, Today, 12:54 PM
                              1 response
                              4 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Working...
                              X