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

[TIP] for people getting wrong values #257

Open
marcusmota opened this issue Aug 17, 2022 · 0 comments
Open

[TIP] for people getting wrong values #257

marcusmota opened this issue Aug 17, 2022 · 0 comments

Comments

@marcusmota
Copy link

marcusmota commented Aug 17, 2022

Hi guys I noticed a lot of people are complaining about having wrong values.

my RSI has the correct values, keep in mind the indicator values and the candle close values have different array lengths

let's say you have

const arrClose = [1,2,3,4,5];
const rsi = [...someValues];

keep in mind rsi.length !== arrClose.length so if you add a loop to iterate through arrClose and use the index to access the rsi[i] you will get the wrong value for your RSI, you need to kind of adjust your "i" to access the correct value, something like

const diff = arrClose.length - rsi.length; //usually is 14 but you need to check on the code
for (let i=0;i<arrClose.length;i++) {
   const rsiValue = rsi[i-diff] //rather than rsi[i];
   //do whatever you need
}

Good luck!

@marcusmota marcusmota changed the title for people getting wrong values [TIP] for people getting wrong values Aug 17, 2022
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

1 participant