I've been using NT7 for years and only now I run across this problem. It's related to running a strategy against a collection -- something I never needed to do before now.
I have written a library of several indicators with public properties. When I reference one of these from another indicator or from a strategy, it has worked very well for my code to follow this template:
// Variables Foobar fb; // Foobar() is an indicator that has a number of public properties I need public override void Initialize() { // do stuff } public override void OnStartUp() { fb = Foobar(parameter1, parameter2, etc); // set handle to instance of Foobar() // do other stuff } public override void OnBarUpdate() { double val = fb[0]; // get primary output value of indicator for this bar double prop1 = fb.Property1; // get a public property of Foobar() for this bar double prop2 = fb.Property2; // etc. // do other stuff }
Now THIS HAS WORKED VERY WELL, for both strategies and indicators, until....
...I try to run a strategy against a collection. Works fine against a single instrument. Against a collection, I get this error message in the output window:
Error on calling 'OnStartUp' method for indicator 'MyIndicator': Object reference not set to an instance of an object.
If I understood what is going on when running a strategy against a collection versus a single instrument, I could figure out what to do.
I may need to correct/update some stuff I've uploaded to the file sharing area too, but I don't see a way to change anything I've submitted once uploaded.
(I also need to provide corrections to some highly optimized statistical indicators I contributed that NinjaTrader has informed me will be adopted for NT8.)
Thanks.
Alex
Comment