Giter Club home page Giter Club logo

Comments (4)

cinar avatar cinar commented on May 27, 2024 1

You got me convinced! :) I will take a look and update the calculation here.

from indicator.

cinar avatar cinar commented on May 27, 2024

Hi! So sorry for my very late response. I was on a trip, and just had a chance to take a look at this. First of all, thank you very much for taking the time to write such a descriptive bug report. Very much appreciated definitely.

I looked at your calculations document, and I noticed that on Column F, you are calculating the SMA with =SUM(D3:D16)/14 but afterwards, you are using =((F16*13)+D17)/14 for the remaining rows. I guess that is the reason for the difference in the results.

I copied your calculations document, and added the columns J and K to calculate the SMA through the =SUM()/14 method, and I was able to get results aligned with the ones calculated by the page at rows 92 to 101.

Could you take a look? I hope it didn't miss anything.

https://docs.google.com/spreadsheets/d/1e3r1mBAQNXd3yI2l-CiEls0Pfn3mRGv_jxTVJ8kNT9Q/edit?usp=sharing

from indicator.

icamys avatar icamys commented on May 27, 2024

@cinar Thanks for responding!

you are calculating the SMA with =SUM(D3:D16)/14 but afterwards, you are using =((F16*13)+D17)/14 for the remaining rows

The logic here is that on the 15th closing I calculate the average of the previous 14 values, after that, I calculate the weighted average using =((F16*13)+D17)/14.

I would be glad to take a look if you allow the document for reading :)

from indicator.

icamys avatar icamys commented on May 27, 2024

@cinar Looks like I found the answer, to why my calculations are the same as on the Binance but differ from those provided by this library.

The Binance exchange uses the TradingView plots. If we take a look at the TradingView RSI documentation we will see, that in their RSI formula they use the Rolling Moving Average:

image

which in its turn has exact the same formula that I used in my calculations (screenshot is taken from here):

image

While in this library for the RSI calculation the Simple Moving Average is used.

During my further research, I found out, that the first average gain and all subsequent should be calculated slightly differently. Here's what I found on the stockcharts.com:

image

The same is told on quantinsti.com:

image

Not an expert, but it's clear to me that the current RSI implementation differs a bit.

What do you think about it?

from indicator.

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.