Currently, I have something like the following in my Initialize event handler of my strategy to load my indicator:
Add(MyIndicator());
I have a module level variable (m_iMyIndicator) that gets initialized
in the OnStartUp event.
The Add function doesn't have a return value, so I have to get a reference to my indicator via the following in the OnStartUp event:
m_iMyIndicator = (NinjaTrader.Indicator.MyIndicator)(from a in ChartControl.Indicators where a.Name == "MyIndicator"
select a).FirstOrDefault();
This works great under normal chart operations. However, when I try to run it in the strategy analyzer, ChartControl is null.
So, my question is how to get a reference to an Added indicator from something other than the chart control? My strategy needs info from the running indicator to make decisions.
Thanks ... Ed

Comment