I had to create a custom class since I need to implement interfaces for comparison of my custom object. In the comparison method inside myCustomClass() I need to access CurrentBar. But then I get this error message:
[SIZE=2]Compiler Error CS0120[/SIZE][SIZE=2] An object reference is required for the nonstatic field, method, or property '[I]member[/I][/SIZE][B]'[/B]
I would prefer to put the myCustomClass witin the partial Class inside the myUserDefinedIndicatorsMethods file. (The alternative would be a nested myCustomClass inside myIndicatorClass.)
Public myCustomClass within myUserDefinedIndicatorsMethods
namespace NinjaTrader.Indicator
{
partial class Indicator
{
public class myCustomClass : IComparable< MyObject>, IEquatable< MyObject>
{
int CurrentBar2 = CurrentBar;
}
}
}
namespace NinjaTrader.Indicator
{
public class myIndicatorClass : Indicator
{
public class myCustomClass : IComparable< MyObject>, IEquatable< MyObject>
{
int CurrentBar2 = CurrentBar;
}
}
}
poseidon_sthlm

Comment