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

Compiling NinjaScript Files - How does it work?

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

    Compiling NinjaScript Files - How does it work?

    I received the following email below from a user:

    If I am working on more than one strategy at a time, the errors from one
    strategy(a) show up in the other one (strategy(b)) when I try to compile it,
    even if I have closed Strategy(a). The only way I can get a clean compile
    on strategy(b), is to open Strategy(a) and fix any errors there.Then
    Strategy(b) compiles just fine.Also, when this occurs, the compiler errors
    sometimes reference another strategy that I'm not even working on.
    When compiling, NinjaTrader compiles all strategies and indicators into one DLL. It does NOT compile each individual strategy or indicator into a separate DLLs. Although it seems as if you are compiling an individual NinjaScript object, the compile process will fail if there are other NinjaScript files that have errors in it. The errors are listed at the bottom of the NinjaScript editor and when double clicked, it willl load the problem NinjaScript file into the Editor.

    What does this mean? Make sure that if you are working on multiple NinjaScript files, that they are compilable.
    RayNinjaTrader Customer Service

    #2
    Hi Ray,

    I'm curious about something. A simple doubt from a non-advanced programmer:

    After NinjaTrader has compiled my strategies into a NinjaTrader.Custom.Dll, I imagine it keeps it in memory; so, once in memory: would it still Ninjatrader be able to work if that file was temporarily erased from its folder ? or NinjaTrader needs constantly reading that file?

    The motivation of this doubt has to do with security measures implementation.

    Thanks in advance and best regards

    Comment


      #3
      Hello pstrusi,

      That is correct. Once compiled, NinjaTrader will continue to use that compiled source.

      If you remove any files, add any files, or change a script and save it, these changes will not take affect until everything is recompiled.

      If the compilation fails due to missing dependencies, references, or errors, no changes will take affect.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hi Chelsea, thank you very much for your answer, I hoped it was like that. Just one more confirmation:

        whenever I compile, everything goes into NinjaTrader.Custom.Dll , right? or is there any other file that keeps info?

        Thanks in advance

        Comment


          #5
          Hello pstrusi,

          As far as I know you are correct, everything gets compiled into the NinjaTrader.Custom.dll file.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hi guys,

            Just wanted to confirm. If I have a strategy running on one instrument, that dll is in memory. If I make a change to the strategy and recompile, then enable the strategy for another instrument, the new code will be running for the latest instrument and the old code will be running for the original instrument. Is that correct? Is it the "Enable" checkbox after a compile that instantiates a new instance of the latest dll?

            Regards
            Robbersdog

            Comment


              #7
              I'll let Support answer the technical aspects of your question.

              But let me say this:

              Don't do that.
              You'd simply be asking for trouble.
              Don't compile anything while you have running strategies.

              When running strategies, esp in live accounts w/real money,
              your machine is now a "production" machine and should no
              longer be used as a "development" machine.

              Otherwise, your current path means you'll be attacked by
              nasty gremlins, and you won't know why something really
              strange just happened.

              My point is:
              I highly recommend that you keep all your "production" and
              "development" activities separate by using separate machines.

              Just my 2˘.

              Comment


                #8
                Hello robbersdog,

                That would be correct. It would generally be suggested to reload all instances at that point to make sure any results/comparisons you use are valid to match the code.

                The items which would not be reloaded on compile would be .dll references, so if the mentioned item was a imported dll you need to restart the platform if that dll file physically changed in some way.

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

                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by sidlercom80, 10-28-2023, 08:49 AM
                169 responses
                2,268 views
                0 likes
                Last Post QuantKey_Bruce  
                Started by Irukandji, Yesterday, 02:53 AM
                2 responses
                17 views
                0 likes
                Last Post Irukandji  
                Started by adeelshahzad, Today, 03:54 AM
                0 responses
                3 views
                0 likes
                Last Post adeelshahzad  
                Started by CortexZenUSA, Today, 12:53 AM
                0 responses
                3 views
                0 likes
                Last Post CortexZenUSA  
                Started by CortexZenUSA, Today, 12:46 AM
                0 responses
                1 view
                0 likes
                Last Post CortexZenUSA  
                Working...
                X