Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

enum problems

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

    enum problems

    Hi, my indicator code goes something like this... which is a problem of course since the enum is outside the indicator... how do I put it inside the indicator?

    for example, if I leave it outside... and have another indicator with the same enum name, there will be compilation problems because of the scope.

    Code:
    public enum Enum1
    {
    A,B,C
    }
    
    // This namespace holds all indicators and is required. Do not change it.
    namespace NinjaTrader.Indicator
    {

    #2
    NT uses partial classes, which means they all compile into one main assembly.

    I don't *think* you can make the same name enum in different indicators.
    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    Comment


      #3
      ah, I thought it was just because I was a bad programmer.

      Reason I wanted to do this was because sometimes I want to take an Indicator I make and save it with another name so that I can make changes to it.

      Maybe I had just better learn how to inherit Indicators. That way I can make a new Indicator from my old one and just override what I want to change.
      Last edited by NinjaCustomer; 12-08-2008, 09:44 PM.

      Comment


        #4
        Just declare your Enum1 as "public" inside the scope of the namespace "NinjaTrader.Indicator" in any indicator file and you can access it easily from any other indicator. It might be worthwhile to consult standard MS docs on C# to understand the namespace concept.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X