-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
API change rationale? #3
Comments
I was a little conflicted -- the old way allocated only as much space as was needed to store the results from TA-Lib, which should be fast and exact. On the other hand, the new way makes it easy to integrate TA-Lib with d = {}
d['MACD'] = talib.MACD(...)
d['EMA'] = talib.EMA(...)
d['RSI'] = talib.RSI(...)
columns = d.keys()
data = np.column_stack([d[key] for key in columns])
df = pandas.DataFrame(data, columns=columns) If you've got API suggestions, I'm all for it. I could even generate both API's easily enough if there is interest... |
Also, I forgot the mention: To get the "lookback" value that was previously returned, you can just find the index of the first non-nan value. rsi = talib.RSI(...)
lookback = np.where(~np.isnan(rsi))[0][0] |
Thanks. In hindsight, I was too quick too submit the question and think you From: John Benediktsson To: wilki2021 bob.wilkinson@sbcglobal.net I was a little conflicted -- the old way allocated only as much space as was d = {}
d['MACD'] = talib.MACD(...)
d['EMA'] = talib.EMA(...)
d['RSI'] = talib.RSI(...)
columns = d.keys()
data = np.column_stack([d[key] for key in columns])
df = pandas.DataFrame(data, columns=columns) If you've got API suggestions, I'm all for it. I could even generate both API's Reply to this email directly or view it on GitHub: |
So not necessarily an issue, but curious why you made the recent API change to eliminate the index that talib returns by default. Is there a way to get that value - it seems like it may be useful in certain contexts.
The text was updated successfully, but these errors were encountered: