I'm trying to develop a indicator that can access some indicator values that are based on a PNF dataseries but using it in a minute chart.
protected override void Initialize() { Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Bar, "Alert")); Overlay = false; // AddPointAndFigure("$EURUSD", pType, baseperiod, box, reversal, PointAndFigurePriceType.Close, MarketDataType.Last); AddPointAndFigure("$EURUSD", pType, baseperiod, box, reversal, PointAndFigurePriceType.Close, MarketDataType.Last); } protected override void OnBarUpdate() { Alert.Set(0); if (CurrentBar < 2) return; if ( d9ParticleOscillator_V2(BarsInProgress [1],d9period,0).RawTrend[0]>0 ) { Alert.Set(1); BackColorAll = Color.PaleGreen; } if ( d9ParticleOscillator_V2(BarsInProgress [1],d9period,0).RawTrend[0]<0 ) { Alert.Set(-1); BackColorAll = Color.Coral; } }
24-11-2014 11:00:43 Default Error on calling 'OnBarUpdate' method for indicator 'Signal1' on bar 2: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
Could you help me?
Thank You
Comment