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

RSI Input Values #234

Open
EatsJE opened this issue May 13, 2021 · 1 comment
Open

RSI Input Values #234

EatsJE opened this issue May 13, 2021 · 1 comment

Comments

@EatsJE
Copy link

EatsJE commented May 13, 2021

Hi! Firstly, thanks for developing an awesome package!

Its a bit of a stupid question, but I can't find the answer in any docs/issues. What are the input vales for RSI?

const rsi = require('technicalindicators').rsi;

rsi({????});

The Binance API returns 15 day price data (to calc 14d RSI) in the below format, what calculation needs to be made before passing into the rsi() function?

[
[
1499040000000, // Open time
"0.01634790", // Open
"0.80000000", // High
"0.01575800", // Low
"0.01577100", // Close
"148976.11427815", // Volume
1499644799999, // Close time
"2434.19055334", // Quote asset volume
308, // Number of trades
"1756.87402397", // Taker buy base asset volume
"28.46694368", // Taker buy quote asset volume
"17928899.62484339" // Ignore.
]
]

Thank you! :)

@rlmomin
Copy link

rlmomin commented May 18, 2021

@EatsJE The link provides an example on how to use the calculation: https://runkit.com/anandaravindan/rsi

The RSI can be calculated on any type of value, in my case I use the close price. Create an Object with keys, values and period. Values should be an array of 'close' prices or whatever you choose. The period should be the RSI period you want to evaluate. Keep in mind that RSI calculation requires n+1 values, a 14-day period requires 15 values in the array.

Pass the object into rsi.calculate(your_object). Keep in mind that your array[0] is the oldest data. I believe there is a 'reverse' parameter you can pass into the object as either true or false. This would account for your input array having the latest value at index 0.

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

No branches or pull requests

2 participants