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 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
        163 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
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X