I'm in the process of converting my scripts from NT7 to NT8. In NT7 I declared all my structs in the "MyCustomIndicatorMethods" file since this made is possible to use a struct in any indicator and also to pass an instance of a struct between indicators. What is the best way to this in NT8?
I have tried to create an Add On like this, but it doesn't seem to work as it did in NT7.
namespace NinjaTrader.NinjaScript.Indicators
{
//Common structs used between different indicators and strategies
public partial class Structs
{
public struct DataPoint
{
public int barNo;
public double value;
public DataPoint( int dpBarNo, double dpValue)
{
this.barNo = dpBarNo;
this.value = dpValue;
}
}
}
}

If declared in a partial class, for any value object, any class derived or inheriting, or that has access to objects in the Indicator class gets a copy of the object that was created in the partial class.
Comment