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 chekrios, Today, 03:46 AM
          0 responses
          7 views
          0 likes
          Last Post chekrios  
          Started by Ffuture, Today, 03:14 AM
          0 responses
          6 views
          0 likes
          Last Post Ffuture
          by Ffuture
           
          Started by Irukandji, Today, 03:12 AM
          0 responses
          5 views
          0 likes
          Last Post Irukandji  
          Started by Irukandji, 05-06-2024, 03:06 PM
          2 responses
          21 views
          0 likes
          Last Post Irukandji  
          Started by Irukandji, 04-22-2024, 04:33 AM
          5 responses
          20 views
          0 likes
          Last Post Irukandji  
          Working...
          X