public PBBandWidth(Bars bars, int period, string description) : base(bars, description) { base.FirstValidValue = period; PBandLower PBL = PBandLower.Series(bars, period); PBandUpper PBU = PBandUpper.Series(bars, period); for (int bar = FirstValidValue; bar < bars.Count; bar++) { base[bar] = 200 * (PBU[bar] - PBL[bar]) / (PBU[bar] + PBL[bar]); } }
public PBFastOsc(Bars bars, int period, int FSmooth, string description) : base(bars, description) { base.FirstValidValue = Math.Max(FSmooth, period) * 3; PBandLower PBL = PBandLower.Series(bars, period); PBandUpper PBU = PBandUpper.Series(bars, period); DataSeries A = bars.Close - PBL; DataSeries B = PBU - PBL; DataSeries Result = EMA.Series((A / B) * 100, FSmooth, EMACalculation.Modern); for (int bar = FirstValidValue; bar < bars.Count; bar++) { base[bar] = Result[bar]; } }