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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          169 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          324 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          250 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          353 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          180 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X