Giter VIP home page Giter VIP logo

Comments (6)

postspectacular avatar postspectacular commented on August 25, 2024

Added and released as v0.3.0 😄

from umbrella.

postspectacular avatar postspectacular commented on August 25, 2024

Please use v0.3.1 instead...

from umbrella.

sy92th avatar sy92th commented on August 25, 2024

I use version "^0.3.1"

const chartDataMACD = Array.from(tx.iterator(stats.macd(fastPeriod, slowPeriod, signalPeriod), closeArray));
console.log('Length MACD: ' + chartDataMACD.length);
console.log('Length data: ' + closeArray.length);

result (with fast: 12, slow: 26, smooth: 9):
Length MACD: 52252
Length data: 52285 (expected: 52252 +26 -1 = 52277)

Can you check this problem? I think the MACD is being miscalculated.

from umbrella.

postspectacular avatar postspectacular commented on August 25, 2024

Hey @sy92th - did you read the docs?

https://github.com/thi-ng/umbrella/blob/master/packages/transducers-stats/src/macd.ts#L34

You didn't take into account the 2nd moving average smooth applied to difference between the fast and slow ones. That's why the total lag of the indicator is slow + smooth - 2...

52285-(26+9-2) = 52252

from umbrella.

postspectacular avatar postspectacular commented on August 25, 2024

Also see here: https://en.wikipedia.org/wiki/MACD#/media/File:MACDpicwiki.gif

from umbrella.

sy92th avatar sy92th commented on August 25, 2024

Ahh I'm wrong. So sorry

from umbrella.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.