I'm using talib-binding for node in my project to calculate RSI based on Binance's websocket candlestick feed.
I would like to sync my RSI output as much as I can with what Binance's RSI indicator shows, but interestingly for the default 14 period I get different RSI output for different sized input arrays. For example:
//Chart interval 1 min in both cases
console.log(`records length: ${this.records.length}`); // length: 14
const outReal = talib.RSI(this.records, 'Close');
console.log(outReal) // ouputs: 56
------
console.log(`records length: ${this.records.length}`); // length: 70
const outReal = talib.RSI(this.records, 'Close');
console.log(outReal) // ouputs: 21
I'm confused, with the period set to 14 (default) shouldn't RSI take in account only the last 14 candles (chart interval 1 min)?
As for synching my output with Binance's RSI. The only way I could synch the two was by truncating the input array to exactly 14 items, now the two outputs are really close but not consistent.
Thanks!