-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Results of linreg does not match talib.LINEARREG() #255
Comments
Hello @drixie,
That is interesting. I do test Pandas TA
There is already a TTM squeeze indicator implemented in Pandas TA. Please see
How is your Kind Regards, |
First off, thanks for your super prompt response, and for the amazing work you have done in this module! I went down this rabbit hole because I was trying to implement LazyBear TTM Squeeze in an Algo, so I was delighted to see that you coded that option in your version of TTM Squeeze. ta.squeeze gives the same results as applying td.linreg on the channel line computed in SQZMOM_LB which is different from what I get with talib.LINEARREG and eyeballing values on TradingView I put together an easy-to-follow comparison on Colab here: https://colab.research.google.com/drive/16jPle9Dy5I8F5NugsBkKlOtRl_19FR0N?usp=sharing |
Thanks. I take accuracy issues seriously. Especially claims without evidence.
I would have led with this. 😉 This I can work with, anecdotal evidence I can not. I have some pending PRs and Issues to take care of but I will take a deeper look as soon as I get a chance.
Makes sense. I try to incorporate popular and interesting indicators from TradingView and other sources time permitting. The Pandas TA version implements both John Carter's and LazyBear's version.
I try to avoid eyeballing and at a minimum run a correlation test, if the indicator exists in TA Lib, to make sure it is inline. Testing TradingView requires manually exporting the data to run a correlation test as they have no publicly exported library and their indicators are in Pine Script as you know. Thanks again for providing some code to work with. I appreciate it. Kind Regards, |
New stable version v0.3.14b should help resolve this Issue. Please let me know otherwise. You can toggle $ pip install pandas_ta I will try and make a correlation test between TV and Pandas TA's Thanks, |
Hello @drixie, I assume by no response that the solution provided was sufficient. Thus I will be closing this issue in a few days. Kind Regards, |
@twopirllc I justed checked using the latest version (0.3.14b). There are still differences (I used BTC/USD and AAPL). Just like before, both talib.LINEARREG and Tradingview results are matching. However, ta.linreg results do not match either of the aforementioned |
Again like in my last #255 (comment) and #408 (comment), I get matching results with TA Lib and TradingView for both Have you installed the development version and used the accompanying exported TV data and indicator results from #408 (comment) and ran the code provided from either comment to corroborate the results?
Yet, I do not see any actual results or proof. 😕 If you are unwilling to do the stuff above, then at a minimum, it would be great if you could follow this comment and provide your exported data of "BTC/USD and AAPL", as csvs, from TV with their ohlcv and linreg values and attach it to this Issue so I can do yet another correlation test. Kind Regards, |
I just tried the development build again, and it works perfectly. The results match with both TA Lib and TradingView. Probably didn't work the first time because of issues with Colab. Once again, thanks for your time and energy working on this great library |
Thank you |
I am finding differences in calculation with periods beyond 1024. Everything match under that threshold. |
Which version are you running? The lastest version is on Github. Pip is for major releases.
0.2.45b0
Upgrade.
Describe the bug
I compared the results of ta.linreg() and talib.LINEARREG(). There is a significant difference. Are you doing it differently? For comparison, talib.LINEARREG() matches what is on tradingview (Pinescript linreg function). This is commonly used for the histogram of the TTM squeeze indicator
To Reproduce
df["hist_talib"] = talib.LINEARREG(df["donchian_midline"], timeperiod=20)
df["hist_pandas_ta"] = ta.linreg(df["donchian_midline"], length=20)
Expected behavior
I except the output of ta.linreg to match the output of talib.LINEARREG and pinescript linreg function
The text was updated successfully, but these errors were encountered: