Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Check Ninja Version in NinjaScript

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

    Check Ninja Version in NinjaScript

    I there a way to check the current version of NinjaTrader from within NinjaScript?

    I would like to be able to limit a version that an indicator can run on (i.e. only runs on version 7.XX or higher). Looking for a method or set of vars that can be used in Initialize().

    It would also be helpful to add this info in log info that gets printed out.

    #2
    We have this code in our standard indicators:
    #if NT7
    ...
    #endif

    Effective at compile time, obviously. There is no equivalent for runtime checks.

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      We have this code in our standard indicators:
      #if NT7
      ...
      #endif

      Effective at compile time, obviously. There is no equivalent for runtime checks.
      Just for your information:

      if you put some parameter between this preprocessor directive it will not work with NT 6.5

      For example:

      #if NT7
      [Description("")]
      [Category("Parameters")]
      public int SomeKindNT7RelatedParameter
      {
      get { return _something; }
      set { _something = Math.Max(1, value); }
      }
      #endif

      the NT6.5 wrapper still puts this parameter into it's code and throws errors.

      I don't know if need to address this, but just wanted to let you know.

      Comment


        #4
        Thanks, will send this up to development to take a look.
        RayNinjaTrader Customer Service

        Comment


          #5
          Expected, since the wrapper generator does not reflect on pre-processor directives.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          47 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          23 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          33 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          50 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          42 views
          0 likes
          Last Post CarlTrading  
          Working...
          X