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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          157 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          91 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          143 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          131 views
          1 like
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          107 views
          0 likes
          Last Post CarlTrading  
          Working...
          X