I've got an indicator that embeds other indicators for internal use. I'm using that indicator in a strategy assigned to a local variable. The indicator assigns the embedded indicators to local variables in the OnStartUp event.
The indicator works perfectly on a chart. It even works great on the Strategy Analyzer chart when I assign it to the Strategy local variable in the Initialize event.
However, when the strategy uses it to make trade decisions the indicator throws an Object reference not set to an instance of an object error when it attempts to access the indicators embedded in the indicator.
I've tried using two instances of the indicator (one for the graph and one for trade decisions) and tried putting the trade decision instance in both Initialize and OnStartUp but it still throws causes the indicator to throw the Obj ref error.
Any ideas how to fix this?
Thanks!
Comment