Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

UniversalDefinedMethods

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

    UniversalDefinedMethods

    When I defined an enum in the indicator UniversalDefinedMethods, it errored on compile due to the NT generated code. One of my properties for the indicator was going to use this enum as its type.

    It errored in the namespace NinjaTrader.MarketAnalyzer and NinjaTrader.Strategy code areas the NT generates.

    Should I delete these two or How are you able to use the UniversalDefinedMethods ( just for internal not properties )?

    To have my own namespaces, do I need to create and compile in Visual Studio then add references to the dll's in NT?

    Is this covered in Intro to NinjaScript course?

    I am using NT 6.5.0.8

    #2
    Please see these links on enums: http://www.csharp-station.com/Tutorials/Lesson17.aspx


    Creating your own namespace is beyond the scope of what we can support.

    The NinjaScript course does not cover programming. It covers the use of the Strategy Wizard in creating simple and complex strategies.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh,
      Awesome once again, how quickly you respond with help. Feel free to forward this on as my kudo's for your diligence and responsiveness or I can send one directly to someone if you advise where to do it.

      I found that if I place the enum declaration outside the namespace bracket in UserDefinedMethods then it works treating it as <global>.
      ( see SampleUniversalMovingAverage.zip I obtained from your site )

      Its better having it in UserDefinedMethods than in an indicator file.
      At least it's in one place versus ending up with various ones strewn across several files.

      If you put it inside the namespace brackets then the NT generated code errors in the Strategy and MarketAnalyzer namespace.

      I would prefer to have these defined in a namespace ( yours or mine ), than have that namespace referenced if it is my own. Having to place it in a global aspect seems could lead to problems. Again it doesn't matter if it is the UserDefinedMethod file or some indescriminate indicator file. Just seems dangerous these aren't allocated to a specific namespace. I'm following the example from the zip file.

      Comment


        #4
        Unfortunately this is the technique we currently recommend.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        25 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        162 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        157 views
        2 likes
        Last Post CaptainJack  
        Working...
        X