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 quicksandatl, 05-09-2024, 11:11 AM
          6 responses
          52 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by johnMoss, Today, 12:19 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by AlgoDreamer, Today, 10:39 AM
          4 responses
          20 views
          0 likes
          Last Post AlgoDreamer  
          Started by RamiRK86, 05-06-2024, 08:05 AM
          3 responses
          39 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by abusestew, Today, 11:57 AM
          2 responses
          12 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Working...
          X