MyCustomIndicator1 compiles and runs properly.
I save and close the workspace I use to test it. Not that it matters, but it is a port of a production NT7 indicator.
I open the workspace I use for MyCustomIndicator2. It compiles and runs properly, but oddly when executed (passing through it's Terminated state on a restart) I see the following output, clearly coming from the try/catch block I have on MyCustomIndicator1:
Terminated....from !!!! MyCustomIndicator1 !!!!EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object.
at NinjaTrader.NinjaScript.Indicators.MyCustomIndicat or1.OnStateChange()
Oddly, the State.Terminated block in MyCustomIndicator1 does not generate this same error when MyCustomIndicator1 is executed.
If I remove MyCustomIndicator1.cs from the indicators folder, recompile MyCustomIndicator2, the exception no longer appears in the output.
I don't know if it's related, but it if I prepend this to that exception handler print statement, it shows MyCustomIndicator1(NinjaTrader.Gui.Tools.SimpleFon t).
Is this trying to tell me that there is a SimpleFont variable in MyCustomIndicator1 that is un-initialized and somehow causing an overflow of sorts to MyCustomIndicator2?
I also notice that the statement Print("\tVerifying license... for "+this.ToString()); from the State.Defaults block of MyCustomIndicator1 appears on the output as well (and just to reiterate, that's when executing MyCustomIndicator2 and all charts and/or workspaces containing MyCustomIndicator1 are closed. Note, that the Print statement I have after the license check in MyCustomIndicator1 is not executed (which of course I wouldn't expect it to be, since that indicator is not the one being executed).
Has anyone else reported anything similar to this?
At this point I don't know if it's a defect somewhere in my code or in NT8.
Any clues on how to resolve this, would be greatly appreciated.
Comment