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

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...
    BertrandNinjaTrader Customer Service

    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.
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Vietanhnguyen2hotmailcom, 05-03-2024, 10:29 AM
              4 responses
              24 views
              0 likes
              Last Post Vietanhnguyen2hotmailcom  
              Started by PhillT, 04-19-2024, 02:16 PM
              4 responses
              36 views
              0 likes
              Last Post PhillT
              by PhillT
               
              Started by ageeholdings, 05-01-2024, 05:22 AM
              5 responses
              38 views
              0 likes
              Last Post ageeholdings  
              Started by reynoldsn, Yesterday, 02:34 PM
              0 responses
              14 views
              0 likes
              Last Post reynoldsn  
              Started by nightstalker, Yesterday, 02:05 PM
              0 responses
              25 views
              0 likes
              Last Post nightstalker  
              Working...
              X