diff --git a/tests/ama/ama.spec.ts b/tests/ama/ama.spec.ts index b63568e..7325c99 100644 --- a/tests/ama/ama.spec.ts +++ b/tests/ama/ama.spec.ts @@ -3,14 +3,14 @@ import { data } from './data'; describe('Adaptive Moving Average', () => { const ama = new AMA(15, 2, 30); - const EPSILON = 0.01; + const EPSILON = 0.001; it('Excel validate', () => { data.forEach((tick, idx) => { const amaValue = ama.nextValue(tick.c); const expected = Number(tick.ama); - if (amaValue) { + if (amaValue && expected) { expect(Math.abs(amaValue - expected)).toBeLessThan(EPSILON); }