public BollingerBand(Spud <double> values, int barsBack, double deviations) : base(values.manager) { this.barsBack = barsBack; this.deviations = deviations; mean = dependsOn(new Average(values, barsBack)); sd = dependsOn(new StdDeviationOfPopulation(values, barsBack)); }
public void testPopulationStandardDeviation() { indicator = new StdDeviationOfPopulation(values); Bombs(() => O.info(indicator[0] + ""), "uninitialized"); addPoint(3, 0.0); addPoint(7, 2.0); addPoint(7); AlmostEqual(Math.Sqrt(32.0 / 9.0), indicator[0], 1e-6); addPoint(19, 6.0); }