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

How to protect your source file

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

    How to protect your source file

    Hi.

    I developed a new custom indicator and I want to give this to someone else to try but I don't want to give them the .cs file to compile. I tried giving them the bin\Custom\NinjaTrader.Custom.csproj and NinjaTrader.Custom.dll files, but that doesn't work. Which files contain the compiled versions of the custom indicators?



    Thanks.



    #2
    imported post

    Hi Richard,

    From the folder C:\Program Files\NinjaTrader 5\bin\custom\indicator

    - Remove any .cs files that you do not want to give him (leave system indicators there is fine)
    - In NT, recompile any indicator which creates the DLL with all indicators represented by the folder above
    - Make a copy of a C:\Program Files\NinjaTrader 5\bin\Custom\NinjaTrader.Custom.dll and rename it to something like Richard.dll
    - Send your friend this DLL and have him save it to the same folder

    When he starts up NT, Richard.DLL will be loaded and any custom indicators contained within this DLL will be available to him.

    Ray
    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      Also, make sure he is using the same version of NT as you.
      RayNinjaTrader Customer Service

      Comment


        #4
        Hello,

        I have "Basic Protected" an indicator where I see the .cs, .dll and .xml files in the zip-file.

        From what is described in this thread, does this mean that one could just extract the files from the archive and still have access to the indicator code?

        The reason for asking is that I would like to share an indicator on the forum, but I would like it to be fully code protected.

        Thanks,
        Laurus

        Comment


          #5
          Laurus, if you exported your code as assembly / DLL it would contain compiled code that could not be reviewed / opend in the NinjaScript editor by a user.

          However as a further level of code security CLI Secure obfuscation is built into NinjaTrader as well as option :

          BertrandNinjaTrader Customer Service

          Comment


            #6
            faulty code issues

            This clears NT from any losses coming from downloading script from teh website with bogus code presumably,but I am assuming that the script on the formal page for NT 7 has all been screened for code that runs?

            Comment


              #7
              What you cite is a part of our disclaimer for downloading code from our forums sharing section. Those submissions are not tested by NT, though we generally oversee this collection as well as part of our maintenance to ensure for example no dll's are used.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                code

                "not tested but over seen."....Im not sure i follow ,that but I appreciate the response none teh less.

                Comment


                  #9
                  laredo78676, we do maintenance there to ensure the posting policies are enforced (no dll so malicious code could be hidden for example). However the scripts you download are installed on your platform at your own risk, we do not filter / test submissions here.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by laredo78676 View Post
                    ...but I am assuming that the script on the formal page for NT 7 has all been screened for code that runs?

                    http://screencast.com/t/Sq6sVHCuNLY
                    Not quite. Some of the code there is buggy. But they certainly do screen to stop what you want to do. The rules are very specific: only unprotected code may be posted in the forum for sharing.

                    Comment


                      #11
                      I followed the instructions to protect an indicator and I got lost as I don't see the results that are described in posting #2
                      I first exported 1 indicator and all the additional indicators needed. That worked fine. See sreenshot1.

                      I got a ZIP file. But then the problem start as I see not a DLL except if I go in that ZIP file.

                      I went many times through the NT7 manual and also thru this forum but cannot find anywhere a clear set of instructions.
                      Attached Files

                      Comment


                        #12
                        Hello marcus2300,

                        It looks like the instructions in this thread are very old and don't apply toward NT7. I would suggest posting new threads for your questions rather than replying to an old post. It looks like these instructions are from 2006 and relate to NT5 so they are no longer relevant but left up as we don't delete posts.

                        You can find the NT7 export steps in the help guide here: https://ninjatrader.com/support/help...nt7/export.htm

                        To export as protected, you would select the options you have shown in the image. Is this an image of what you have exported or have you taken this image from another source?

                        A protected export will result in the output you pictured and that looks pretty standard if that was your export, are you seeing a problem or what is the reason for the post today?

                        I would also suggest using the real name instead of "Custom" specifically.


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

                        Comment


                          #13
                          Hi Jesse,

                          thanks for the answer. I probably got confused because of the fact that this thread was so old. Some of the steps changed in the meantime so I could not find them anymore.

                          I went thru all the steps like described in the latest version of NT7 help. But as I was not sure the result would be OK I posted here. I opened the CS files in the ZIP files and indeed there was nothing to see from code.

                          I will test it again and install it on another PC to see the result. If there would be problems I will come back on it.
                          Thanks for the fast reaction!

                          PS: If I would like to use obfuscation additionally from CLISECURE, what should I do then?
                          There seems to be a possibility to put a limit on the use of the protected indicator, but I don't know where should do that. If I just protect the indicator, the people who receive the protected indicator can use him forever, that is not the intention.I wish to keep control over the usage.
                          I saw that for CLISECURE you need DLL or EXE files, but I have a ZIP file?
                          Last edited by marcus2300; 11-20-2018, 04:13 AM.

                          Comment


                            #14
                            Hello marcus2300,

                            Thank you for the reply.

                            Yes, testing on another PC is a good way to check if the export was successful. For a compiled assembly like this, you will find this listed in the File -> Utilities -> Remove NinjaScript Assembly menu once installed.

                            Regarding further protection, you can use the CLISecure to further obfuscate the code from being viewed this does not control the usage. To control usage vendors can make use of the vendor licensing system in the platform otherwise this is something you would likely need to create yourself. This could be a simple password that changes after a period of time which you have to re-release as you go. You could also do more advanced systems which include a server or however you wanted to do this really.

                            The zip file will always be the output you get from NinjaTrader, it will also always contain a few DLL's and other files when exporting as compiled or protected.

                            https://ninjatrader.com/support/help...l_security.htm

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

                            Comment


                              #15
                              Is there maybe a community member who can help me with this?
                              I would like to add in an indicator script a date till which the indicator can be used. I wish to share the indicator with friends but want to keep control over it.
                              I suppose it is just a matter of a few lines to add, but I have no clue how and where.
                              Any help would be appreciated.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by junkone, Today, 11:37 AM
                              2 responses
                              14 views
                              0 likes
                              Last Post junkone
                              by junkone
                               
                              Started by frankthearm, Yesterday, 09:08 AM
                              12 responses
                              44 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by quantismo, 04-17-2024, 05:13 PM
                              5 responses
                              35 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by proptrade13, Today, 11:06 AM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by love2code2trade, 04-17-2024, 01:45 PM
                              4 responses
                              35 views
                              0 likes
                              Last Post love2code2trade  
                              Working...
                              X