-
Notifications
You must be signed in to change notification settings - Fork 943
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
About RSI question #69
Comments
Hi @homily, Currently That being said, I do not mind adding a TradingView version, but it is more difficult to test against as they do not have an easily testable library. If you know of a better and quicker way to test and compare vs TradingView, let me know what needs to be modified so that it matches TradingView. Differences in languages (Python and Pinescript in this case) and how they handle decimals/floats can easily cause minor differences in calculations. What is the current correlation between Regards, |
Yes, thank you very much. I've been using your library and it's very convenient. I think it is very necessary to add tradingview. After all, there are many open scripts written with pin script. If tradingview can be effectively supported, it will be greatly convenient for all users. |
Heya @homily, Thank you! Also, thanks for your patience. Yes, I do like TradingView and some of my own TV indicators are also incorporated in Pandas TA. If think the differences you may be seeing are the may be the differences in data sources; TV's data source and your data source may not be the same. Computationally, they are the same. Thanks, |
Revamped stoch added stochrsi. Both are inline with TradingView. Thanks, |
Hello, What are the default parameters to get the same RSI reading in Binance, TradingView and this library? I am pretty confused with various methods for calculation of RSI and I really appreciate and explanatory answer. Library version is '0.2.45b0'. I call them in the following manner to compare directly with Binance: bars_df['rsi7'] = ta.stochrsi(bars_df.close, length=7, rsi_length=14, k=3, d=3)
bars_df['rsi14'] = ta.rsi(bars_df.close, length=14, rsi_length=14, k=3, d=3)
bars_df['rsi24'] = ta.rsi(bars_df.close, length=24, rsi_length=14, k=3, d=3) |
Hello @Vesnog, Standard literature for RSI has a default length of 14 including most platforms as well as this library. STOCHRSI is the result of applying STOCH to RSI or in otherwords STOCHRSI = STOCH(RSI). If you believe STOCHRSI has significance then use it, if not then do not include it. Same with any other indicator. Only you can make that determination. You shouldn't have to call them that way. You are including kwargs in RSI that serve no purpose. Recall that you can use Here are some ways of calling the indicators you listed above: Standardimport pandas as pd
import pandas_ta as ta
bars_df = # ohlcv data
bars_df["stochrsi7"] = ta.stochrsi(bars_df.close, length=7)
bars_df["rsi14"] = ta.stochrsi(bars_df.close)
bars_df["rsi24"] = ta.stochrsi(bars_df.close, length=24) Pandas TA DataFrameimport pandas as pd
import pandas_ta as ta
bars_df = # ohlcv data
bars_df.ta.stochrsi(length=7, append=True)
bars_df.ta.stochrsi(append=True)
bars_df.ta.stochrsi(length=24, append=True) Pandas TA Strategyimport pandas as pd
import pandas_ta as ta
bars_df = # ohlcv data
# (1) Create the Strategy
RSIStrategies = ta.Strategy(
name="RSI and STOCHRSI",
ta=[
{"kind": "stochrsi", "length": 7},
{"kind": "rsi"},
{"kind": "rsi", "length": 24},
]
)
# (2) Run the Strategy
bars_df.ta.strategy(RSIStrategies) Hope this helps and makes sense! Kind Regards, |
hi。
when i use the RSI calc,it different with Tradingview。
the tradingview use RMA calc
url:https://www.tradingview.com/support/solutions/43000502338-relative-strength-index-rsi/
so, Maybe you can view or update the calc code. ^_^
The text was updated successfully, but these errors were encountered: