Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Preprocessor Directives in NT

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

    Preprocessor Directives in NT

    Hi,

    Can anyone please tell me how C# preprocessor directives are executed in Ninjatrader? I have the following code:

    #if (NT7)
    one line of code;
    #else
    one line of code;
    #endif

    I am currently not using: #define NT7
    and I am wondering whether I should set it after the Using Declarations, or whether the compiler somehow knows the code is NT7 and sets the #define NT7 by default.
    Any advice would be greatly appreciated. Thank you.

    #2
    Zeos, I will have someone get back to you on Monday with an answer.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thank you Austin.

      Comment


        #4
        Zeos6,

        You do not need to define it yourself. NT will just know if the code is being ran in NT7 or NT6.5 when you use the "#if NT7" line.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thank you Josh. Your clarification is much appreciated.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          639 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          366 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          107 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          569 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          572 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X