Code Monkey home page Code Monkey logo

Comments (7)

karlwancl avatar karlwancl commented on August 15, 2024 1

@maheshlnties i have to study it first before i can implement the indicator, you may also create a PR on this, it would be a great help 👍

from trady.

karlwancl avatar karlwancl commented on August 15, 2024 1

@maheshlnties thanks for the formula, i will take a look of it. It seems we need to implement WMA first, and then HMA based on WMA. I will try to implement it this weekend maybe.

from trady.

karlwancl avatar karlwancl commented on August 15, 2024 1

@maheshlnties I find there's some possible reasons for the difference when i was implementing the indicator:

  1. If input period is an odd number, what number should be used when using "period / 2" in calculation step 1, should we use the flooring integer or ceiling integer? In my implementation, i have used the flooring one.

  2. Same decision happens in step 3, if sqrt(n) is not a whole number, should the sqrt-ed number round-up or round-down? I have used the round-down approach.

I would suspect that the correct one should be some combination of the above 2 cases.

from trady.

maheshlnties avatar maheshlnties commented on August 15, 2024

I have tried implementing, but i am not getting exact values though. HMA is a derivative calculation from WMA.
Calculation:

  1. Calculate a Weighted Moving Average with period n / 2 and multiply it by 2
  2. Calculate a Weighted Moving Average for period n and subtract if from step 1
  3. Calculate a Weighted Moving Average with period sqrt(n) using the data from step 2
    HMA= WMA(2*WMA(n/2) − WMA(n)),sqrt(n))

from trady.

karlwancl avatar karlwancl commented on August 15, 2024

@maheshlnties Both the weighted moving average & hull moving average has been implemented. Please help to check if the calculated value is correct.

from trady.

maheshlnties avatar maheshlnties commented on August 15, 2024

@lppkarl Thanks a lot for your awful effort. Very much appreciated :) WMA works perfect. But HMA I verified values against other brokerage charting tools, it has some slight deviation in values. Even I encountered into same problem when i tried implementing on my own. I am not sure what are we missing here in HMA.

from trady.

maheshlnties avatar maheshlnties commented on August 15, 2024

@lppkarl Excellent!! Using ceiling integer in step 1 is giving exact values. Thanks a lot once again :)

from trady.

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.