Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
BusinessDuck committed Nov 3, 2024
1 parent e5ca1aa commit d047b2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/ama/ama.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit d047b2a

Please sign in to comment.