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

    #16
    Hello marcus2300,

    Thank you for the post.

    If you simply want a limit of time from the export/compile you could hard code those values very easily. Keep in mind that if the users PC clock is changed back, it would allow the script to work. It would be unlikely for a user to set the clock back though as that would likely only be helpful in historical data as a time change to the past would prevent live data from working correctly.

    Code:
    protected override void OnBarUpdate()
    {
          if(DateTime.Now > new DateTime(2018, 12, 30, 7, 0, 0, 0)) return;
    This would just prevent the indicator from doing anything, users can still apply it and see it listed. The code would just not be run. This would likely also need some kind of message to let the user know it is beyond the date so they doing just email you thinking it is not working for another reason.


    Code:
    if(DateTime.Now > new DateTime(2018, 12, 30, 7, 0, 0, 0)) 
    {
          DrawTextFixed("error", "Your trial has expired", TextPosition.TopRight);
          return;
    }

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

    Comment


      #17
      Thanks! That was really fast!

      Comment


        #18
        "Keep in mind that if the users PC clock is changed back, it would allow the script to work."

        I fixed that problem by saving the date and overwriting it each time with the date of every next access. If the next date is smaller then the last saved one, the indicator does not work anymore. So switching back the clock would be useless. But as you told, turning back the clock will make realtime trading impossible.

        Comment


          #19
          There seems to be a huge problem with the protection of the source code using CLISECURE.
          • I copied the standard indicator EMA in a new script called "Testindicator".
          • I exported the indicator with the selection "export compiled assembly of selected source files"
          • I imported the indicator successfully on an other PC with NT7.
          The indicator works fine and is not visible in the list of indicators if you select "Edit script indicator"
          But if you go to "pc/documents/Ninja Trader 7/ bin/ custom" you can see "Testindicator.cs".
          You can open this script and you see the complete script with all the source code!

          Is there really a problem, or did I make a mistake somewhere?


          Comment


            #20
            Hello marcus2300,

            Thank you for your post.

            The .cs file that is exported with the assembly is not the code that is in the assembly. It is actually just internal references for performance reasons. The actual code of the object is still protected and not exposed.

            Please let me know if I may be of further assistance.

            Comment


              #21
              OK, thanks. I will test it tomorrow with my own developped indicators source code and see what happens.

              Comment


                #22
                Everything works fine but there still was a problem. To use the CLISECURE protected files you need to install two files on both the computers, and these files are not installed by Ninjatrader (maybe they can fix that for the futur). So they are missing and the CLISECURE protected files will not work.

                You need:
                1. ExcelExportAdvanced
                2. Microsoft.Office.Interop.Excel

                The easiest way to get them is download the free test of a program on:


                If you install that indicator the two missing programs will be installed and everything will work. The downloaded program is FREE and can be downloaded without giving your email or creditcard info.

                I hope this info will save a lot of headache to other people.
                Last edited by marcus2300; 11-29-2018, 04:27 AM.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by lightsun47, Today, 03:51 PM
                0 responses
                2 views
                0 likes
                Last Post lightsun47  
                Started by 00nevest, Today, 02:27 PM
                1 response
                8 views
                0 likes
                Last Post 00nevest  
                Started by futtrader, 04-21-2024, 01:50 AM
                4 responses
                41 views
                0 likes
                Last Post futtrader  
                Started by Option Whisperer, Today, 09:55 AM
                1 response
                13 views
                0 likes
                Last Post bltdavid  
                Started by port119, Today, 02:43 PM
                0 responses
                8 views
                0 likes
                Last Post port119
                by port119
                 
                Working...
                X