Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compile errors while working on multiple items

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

    Compile errors while working on multiple items

    I just started coding in NT but am hitting an annoying issue:

    If I have multiple strategies or indicators in progress (i.e. they will not compile due to errors) it actually blocks me from compiling one that will compile??

    Further, I closed one I was working on to get some sample code to figure it out, but when I went to 'import' the sample code, the import itself was blocked with an error saying I had NinjaScript files with errors, and these had to be fixed before I could import (the very code I want to see to see what I am doing wrong so I can fix the error it is complaining about).

    Is there a setting somewhere to make this stop?

    There should not be this interdependency that all your current files must compile before the one you are working on can compile, or before you can import more code?

    Thanks

    #2
    SIFTrader, this is expected as all NinjaScript files (indicators and strategies) will be compiled into one single assembly file for fastest runtime execution. Thus each individual script has be 'error free' to compile all files or import new ones. If you don't want to debug finish a script, just select the complete code and comment it out so the compiler ignores it...

    Comment


      #3
      If you don't want to comment out the offending section or more importantly, you don't know where the problem lies, just cut the indicator from the Indicators folder and paste into another folder. Select any indicator and compile to fix your problem. When needing to work on your indicator simply copy it back to the Ninja Indicators folder.
      eDanny
      NinjaTrader Ecosystem Vendor - Integrity Traders

      Comment


        #4
        Originally posted by NinjaTrader_Bertrand View Post
        SIFTrader, this is expected as all NinjaScript files (indicators and strategies) will be compiled into one single assembly file for fastest runtime execution. Thus each individual script has be 'error free' to compile all files or import new ones. If you don't want to debug finish a script, just select the complete code and comment it out so the compiler ignores it...
        Thanks for clarifying this.

        However, doesn't this also mean that all of my indicators and strategies would be loaded every time I run NT...even though I might only be running a few of them?

        Or do you mean it is compiled into one file, and only the relevant logic is lifted and loaded as needed into RAM?

        I've worked in C++ for a long, long time and never heard of bundling all code into one file like this. Each CPP file would compile into a seperate file and there is no 'crosslinking' of compile errors between unrelated files, so appreciate the clarification regarding RAM loading.

        Thanks

        Comment


          #5
          Originally posted by eDanny View Post
          If you don't want to comment out the offending section or more importantly, you don't know where the problem lies, just cut the indicator from the Indicators folder and paste into another folder. Select any indicator and compile to fix your problem. When needing to work on your indicator simply copy it back to the Ninja Indicators folder.
          Thanks for the tip, the moving files is good to know as I have a lot to move over from TS and will thus have a lot of files in development.

          It seems a nice feature request would be the option to flag a file as "ignorable" and then NT could automove it out for you and move it back, rather than having to hand copy back and forth.

          Thanks again.

          Comment


            #6
            Originally posted by SIFTrader View Post
            Thanks for clarifying this.

            However, doesn't this also mean that all of my indicators and strategies would be loaded every time I run NT...even though I might only be running a few of them?

            never mind, I found some info on the architecture and I see that you are building one dll rather than independent objects for each strat or indicator as I expected, and hence the enforced compile issue.

            It does appear that C# preserves the standard C++ style preprocessor directives, so my solution to including or not including things dynamically would be to use that for now.

            i.e.
            #define BUILD

            #if BUILD
            ///All Code
            #endif

            would then give you one line at the top to comment out (or undefine) and that would control its inclusion at build time without having to move files back and forth.

            Thanks

            Comment


              #7
              Thanks for sharing this tip and yes all is compiled in one assembly file for maximum performance.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              578 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              553 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X