Example #1
0
 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));
 }
Example #2
0
 public void testMovingAverage()
 {
     indicator = new Average(values, 2);
     addPoint(1, 1);
     addPoint(2, 1.5);
     addPoint(3, 2.5);
     addPoint(4, 3.5);
 }
Example #3
0
 public void testAverage()
 {
     indicator = new Average(values);
     Bombs(() => O.info(indicator[0] + ""), "uninitialized");
     addPoint(1, 1);
     addPoint(2, 1.5);
     AreEqual(1.0, indicator[1]);
     addPoint(3, 2);
     addPoint(4, 2.5);
 }