Skip to content

Commit d047b2a

Browse files
committed
fix test
1 parent e5ca1aa commit d047b2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/ama/ama.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { data } from './data';
33

44
describe('Adaptive Moving Average', () => {
55
const ama = new AMA(15, 2, 30);
6-
const EPSILON = 0.01;
6+
const EPSILON = 0.001;
77

88
it('Excel validate', () => {
99
data.forEach((tick, idx) => {
1010
const amaValue = ama.nextValue(tick.c);
1111
const expected = Number(tick.ama);
1212

13-
if (amaValue) {
13+
if (amaValue && expected) {
1414
expect(Math.abs(amaValue - expected)).toBeLessThan(EPSILON);
1515
}
1616

0 commit comments

Comments
 (0)