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

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 Max238, Today, 01:28 AM
        1 response
        22 views
        0 likes
        Last Post CactusMan  
        Started by giulyko00, Yesterday, 12:03 PM
        2 responses
        10 views
        0 likes
        Last Post giulyko00  
        Started by r68cervera, Today, 05:29 AM
        0 responses
        4 views
        0 likes
        Last Post r68cervera  
        Started by geddyisodin, Today, 05:20 AM
        0 responses
        6 views
        0 likes
        Last Post geddyisodin  
        Started by JonesJoker, 04-22-2024, 12:23 PM
        6 responses
        38 views
        0 likes
        Last Post JonesJoker  
        Working...
        X