Getting a wrong result calculating the RSI with Tulipy

88 Views Asked by At

Im getting the candles closed price from Coinapi. The rsi I get is always different as the one I see on Tradingview. Does anyone know why it is different ? I also tried Ta-lib but it's more difficult to use.

Thank you

import numpy as np
import requests
from requests.models import Response
import pprint

url = 'https://rest.coinapi.io/v1/ohlcv/BITSTAMP_SPOT_ETH_USD/latest?period_id=1HRS'
headers = {'X-CoinAPI-Key' : '2777104B-FCC0-4010-9B4B-78F41DADEB6F'}
r = requests.get(url, headers=headers)

r=r.json()
test2=np.array([])


for i in range(15):
    test2=np.append(test2,r[i]["price_close"])

print(test2)


jcp = np.flip(test2)
float_data = [float(x) for x in jcp]
np_float_data = np.array(float_data)


print(ti.rsi(np_float_data, period=14)) ```
1

There are 1 best solutions below

0
On

UPDATE: I stop using Tulipy and used the lib tradingview_ta and it worked great !