Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 rocketman7, Today, 01:00 AM
        0 responses
        1 view
        0 likes
        Last Post rocketman7  
        Started by wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        27 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        32 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 04-23-2024, 09:53 PM
        2 responses
        74 views
        0 likes
        Last Post wzgy0920  
        Started by Kensonprib, 04-28-2021, 10:11 AM
        5 responses
        193 views
        0 likes
        Last Post Hasadafa  
        Working...
        X