public void testCalcTwice() { indicator = new EWMA(values, 1); addPoint(0, 0); values.set(0); AreEqual(0, indicator[0]); }
public RSI(Spud <double> values, int halfLife) : base(values.manager) { this.values = dependsOn(values); upChanges = new RootSpud <double>(manager); dnChanges = new RootSpud <double>(manager); upAverage = new EWMA(upChanges, halfLife); dnAverage = new EWMA(dnChanges, halfLife); }
public void testEWMA() { indicator = new EWMA(values, 1); Bombs(() => O.info(indicator[0] + ""), "uninitialized"); addPoint(0, 0); addPoint(1, 0.5); addPoint(0, 0.25); addPoint(1, 0.625); }
public void testEWMAJeff() { indicator = new EWMA(values, 3); Bombs(() => O.info(indicator[0] + ""), "uninitialized"); addPoint(1, 1); addPoint(0, 0.79370052598409979); addPoint(0, 0.62996052494743671); addPoint(0, 0.50000000000000011); }
public EWAcf(Spud <double> values, double halfLife, int lag) : base(values.manager) { variance = dependsOn(new EWMA(new Product(values, values), halfLife)); covariance = dependsOn(new EWMA(new Product(values, values.lagged(lag)), halfLife)); }