I would the user to add multiple data series in a chart using the ninja script properties. When I have the user add the data series via
I getting error mesage: "OnBarUpdte method on bar 0: you are accessing an index with a value that is invalid since it is out of range.
Not sure what I am doing wrong.
else if (State == State.Configure)
{
AddDataSeries(symbol2, BarType2, Period);
}
[NinjaScriptProperty]
[Display(Name = "Symbol2:", Description = "Enter instrument symbol", Order = 70, GroupName = "13-1 Instrument Analytics")]
public string symbol2
{ get; set; }
[NinjaScriptProperty]
[TypeConverter(typeof(NinjaTrader.Gui.Tools.BarsPer iodTypeSelector))]
[Display(Name = "Chart Type", Description = "Select Time Frame Type", Order = 71, GroupName = "13-1 Instrument Analytics")]
public BarsPeriodType BarType2
{ get; set; }
[NinjaScriptProperty]
[Display(Name = "Period", Description = "Select Time Frame Type", Order = 72, GroupName = "13-1 Instrument Analytics")]
public int Period
{ get; set; }

Comment