The code below is how I am currently finding the ChartControl indicator in State.Historical. Do I have to run this foreach loop everytime I access the plot values in OnBarUpdate()? What am I missing? I do want to read the indicator from the chart, so that it uses the chart settings.
else if (State == State.Historical)
{
if (ChartControl == null) return;
ChartControl.Dispatcher.InvokeAsync(new Action(() =>
{
foreach (IndicatorBase indi in ChartControl.Indicators)
{
if (indi.GetType().ToString().Equals("NinjaTrader.Nin jaScript.Indicators.Compiled3rdPartyAssembly"))
{
Print("DispatcherTest: " + indi.GetType().ToString());
HTindi = indi as NinjaTrader.NinjaScript.Indicators.Indicator;
}
}
}));
}

Comment