protected override void OnBarUpdate() { avg = DYNAverage[0]; stdDevValue = SDBB[0]; PriceLine.Set(DYNPrice[0]); SignalLine.Set(DYNSignal[0]); Average.Set(avg); Upper.Set(avg + stdDevNumber * stdDevValue); Lower.Set(avg - stdDevNumber * stdDevValue); }
protected override void OnBarUpdate() { double RSI_value = RSI(this.RSIPeriod, 1)[0]; this._RSI_List.Set(RSI_value); double PRICE_value = SMA(this._RSI_List, this.PricePeriod)[0]; PriceLine.Set(PRICE_value); double SIGNAL_value = SMA(this._RSI_List, this.SignalPeriod)[0]; SignalLine.Set(SIGNAL_value); double AVG_value = SMA(this._RSI_List, this.BandPeriod)[0]; Average.Set(AVG_value); MidLine.Set(50); double stdDevValue = StdDev(this._RSI_List, this.BandPeriod)[0]; Upper.Set(AVG_value + this.StdDevNumber * stdDevValue); Lower.Set(AVG_value - this.StdDevNumber * stdDevValue); PlotColors[0][0] = this.Main; PlotColors[1][0] = this.Signal; PlotColors[2][0] = this.BBAverage; PlotColors[3][0] = this.BBUpper; PlotColors[4][0] = this.BBLower; if (AVG_value > 50) { PlotColors[5][0] = this.MidPositive; } else { PlotColors[5][0] = this.MidNegative; } Plots[0].PenStyle = this.Dash0Style; Plots[0].Pen.Width = this.Plot0Width; Plots[1].PenStyle = this.Dash1Style; Plots[1].Pen.Width = this.Plot1Width; Plots[2].PenStyle = this.Dash2Style; Plots[2].Pen.Width = this.Plot2Width; Plots[3].PenStyle = this.Dash3Style; Plots[3].Pen.Width = this.Plot3Width; Plots[4].PenStyle = this.Dash3Style; Plots[4].Pen.Width = this.Plot3Width; Plots[5].PenStyle = this.Dash3Style; Plots[5].Pen.Width = this.Plot3Width; }