We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi there. I am trying to understand how VectorBT calculates the RSI indicator. I have the following code to compare VectorBT RSI values againts talib:
import vectorbt as vbt import talib as ta import pandas as pd import yfinance as yf
symbol ='SPY' data = yf.download(symbol) data = data.dropna()
##################################
################################## rsi_1 = ta.RSI(data.Close, 3) rsi_1 = pd.Series(rsi_1, name="rsi_1")
rsi_2= vbt.RSI.run(data.Close, 3, ewm=True).rsi rsi_2 = pd.Series(rsi_2, name="rsi_2")
merged = pd.merge(rsi_1, rsi_2, on='Date', how='outer')
merged.head(50) And these are the results:
rsi_1 rsi_2
Date
1993-01-29 NaN NaN
1993-02-01 NaN NaN
1993-02-02 NaN NaN
1993-02-03 100.000000 100.000000
1993-02-04 100.000000 100.000000
1993-02-05 94.267516 89.333333
1993-02-08 94.267516 89.333333
1993-02-09 41.168289 16.962025
1993-02-10 49.672814 37.284895
1993-02-11 71.387503 76.885130
1993-02-12 35.392258 25.761511
1993-02-16 10.184007 4.813165
I am trying to dig into VectorBT code but it is hard to follow. Anyone has already looked into this before?
Thanks a lot!
The text was updated successfully, but these errors were encountered:
Duplicate of #471
Sorry, something went wrong.
No branches or pull requests
Hi there.
I am trying to understand how VectorBT calculates the RSI indicator. I have the following code to compare VectorBT RSI values againts talib:
import vectorbt as vbt
import talib as ta
import pandas as pd
import yfinance as yf
symbol ='SPY'
data = yf.download(symbol)
data = data.dropna()
##################################
RSI Check
##################################
rsi_1 = ta.RSI(data.Close, 3)
rsi_1 = pd.Series(rsi_1, name="rsi_1")
rsi_2= vbt.RSI.run(data.Close, 3, ewm=True).rsi
rsi_2 = pd.Series(rsi_2, name="rsi_2")
merged = pd.merge(rsi_1, rsi_2, on='Date', how='outer')
merged.head(50)
And these are the results:
rsi_1 rsi_2
Date
1993-01-29 NaN NaN
1993-02-01 NaN NaN
1993-02-02 NaN NaN
1993-02-03 100.000000 100.000000
1993-02-04 100.000000 100.000000
1993-02-05 94.267516 89.333333
1993-02-08 94.267516 89.333333
1993-02-09 41.168289 16.962025
1993-02-10 49.672814 37.284895
1993-02-11 71.387503 76.885130
1993-02-12 35.392258 25.761511
1993-02-16 10.184007 4.813165
I am trying to dig into VectorBT code but it is hard to follow. Anyone has already looked into this before?
Thanks a lot!
The text was updated successfully, but these errors were encountered: