Can anyone pls explain how I can define an C# enum to use as a property to select a value when I attach the indicator to the chart, yet limit the scope of the enum to be private and not public.
For example I want to define an C# enum as:
public enum enum_TradeTypes { Buy = 1, Sell= 2 }
and later select Buy or Sell from properties with I load the indicator.
My problem is, that I must define the scope as "public" and above and outside the scope of statement ...
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
Otherwise I get this compile error in section namespace NinjaTrader.MarketAnalyzer ...
"The type or namespace name 'enum_TradeTypes' could not be found (are you missing a using directive or an assembly reference?)"
However, when I do define 'enum_TradeTypes' above and outside the scope of 'namespace NinjaTrader.Indicator', it will compile and execute OK, BUT the scope of the enum is so public that it is now available for ALL indicators in Ninjatrader to use and code with.
Basically I want to define C# structures to use in indicators/strategies, available for 'property' selection BUT have a scope that is 'private' to the indicator/strategy and not 'public' to all of namespace NinjaTrader.Indicator.
Thank you
Comment