Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix indicator name #7

Merged
merged 1 commit into from
Oct 28, 2021
Merged

fix indicator name #7

merged 1 commit into from
Oct 28, 2021

Conversation

bennycode
Copy link
Contributor

I checked the output values of your RMA implementation and they correlate with the values listed here:

From your implementation (i.e. this.smooth = 1 / this.period) you seem to have implemented Wilder's Smoothing which is not a Relative Moving Average (RMA).

@BusinessDuck
Copy link
Contributor

BusinessDuck commented Sep 2, 2021

wow, that's true
please add unit test for WEMA, for example. And rename other RMA to WEMA here

import { WEMA as WEMA1 } from 'technicalindicators';
import { WEMA as WEMA2 } from '../../src/wema';

describe.only('Relative Moving Average', () => {
    const ticks = [120, 150, 240, 540, 210, 380, 120, 870, 250, 1100, 500, 950];

    it('Cross validate', () => {
        const cross = new WEMA1({ period: 6, values: [] });
        const local = new WEMA2(6);

        ticks.forEach((tick, idx) => {
            const calcValue = cross.nextValue(tick);
            const crossValue = local.nextValue(tick);

            if (idx > 6) {
                expect(calcValue).toEqual(crossValue);
            }
        });
    });
});

@BusinessDuck
Copy link
Contributor

i able to merge it soon. Not enough time yet =(

@BusinessDuck BusinessDuck merged commit f776c4c into coin-unknown:master Oct 28, 2021
@bennycode bennycode deleted the patch-2 branch October 28, 2021 10:22
BusinessDuck added a commit that referenced this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants