else if(State == State.Configure) { if(myEnum == enumValue1) AddDataSeries(BarsPeriodType.Minute, 1) else if (myEnum == enumValue 2) AddDataSeries(BarsPeriodType.Tick, barPeriod) else if (myEnum == enumValue 3) AddDataSeries(BarsPeriodType.Volume, barPeriod) }
This approach works fine, when the indicator is applied to a chart. However, it does not work, when I add the indicator to the market analyzer or the dynamic SuperDOM. In this case I am getting an error on calling OnStateChange(): "Object reference not set to an instance of an object."
I am aware that I could add all three DataSeries (minute bars, tick bars and volume bars) and that this would fix the problem. However, adding three DataSeries when only one is needed slows down NinjaTrader for no valid reason.
Could you suggest any other option to make that added DataSeries user-selectable?
Comment