Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Static classes and interfaces with NT 8

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

    Static classes and interfaces with NT 8

    with NT 7 I had a static methods that was available to many others indicators.
    I have read somewhere that with NT 8 we have to put these static classes into the AddOns folder. If I do that I do not compile.

    I have put my static class as well as interfaces in the NinjaTrader.NinjaScript.Indicators namespace.

    Is that what I have to do... ? It compiles this way.

    Thanks

    #2
    Yes, assigning the correct Indicators namespace should do the trick and should then be accessible. There is a section on the code breaking changes that covers over this if you have not seen that:



    "Partial Classes (Porting methods and properties from UserDefinedMethods.cs)"
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hi blar58,

      I just wanted to add in that you need to put these in the Addons folder so that NinjaTrader does not try and add auto-generated code to the script file.

      Also, yes, the code you add to this file will need to be in the same namespace as the script that will use it.
      So if the script is an indicator that you want to use this class add this to the NinjaTrader.NinjaScript.Indicator namespace.
      If you want the class available to both indicators and strategies, add it to both the NinjaTrader.NinjaScript.Indicators namespace and the NinjaTrader.NinjaScript.Strategies namespace.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Thank you for helping me out guys

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, Today, 06:46 AM
        0 responses
        8 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, Yesterday, 05:21 PM
        0 responses
        14 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        15 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        82 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        48 views
        0 likes
        Last Post PaulMohn  
        Working...
        X