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 junkone, Yesterday, 02:19 PM
          4 responses
          54 views
          1 like
          Last Post Moody1337  
          Started by WHICKED, 04-26-2024, 12:45 PM
          3 responses
          27 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by chbruno, 04-24-2024, 04:10 PM
          5 responses
          59 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by JuanPabloQuevedo, 10-25-2020, 05:27 PM
          2 responses
          355 views
          0 likes
          Last Post nuobo
          by nuobo
           
          Started by gwenael, 04-27-2024, 09:29 AM
          2 responses
          28 views
          0 likes
          Last Post gwenael
          by gwenael
           
          Working...
          X