I'm trying to add several plots to an indicator in a loop:
protected override void Initialize() {
...
for (int i=0; i<list.Count; i++) {
Add(new Plot(getColor(i), PlotStyle.Line, "plot"+i));
Add(new Plot(getColor(i), PlotStyle.Line, "plot"+(i+1)));
}
Print("Total Number of plots: " + Plots.Length + ", Values: "+Values.Length);
}
But if I try to access these I get an array index out of bounds error after the first two:
protected override void OnBarUpdate() {
...
for (int i=0; i<list.Count; i++) {
Values[i].Set(...);
Values[i+1].Set(...);
}
}
Cody

Comment