-
Notifications
You must be signed in to change notification settings - Fork 390
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
Change default_returns_func to use Quandl API #89
Conversation
Thanks @jaycode! CC @richafrank for assigning a reviewer. |
Just noticed the Travis CI build errors. I will fix then shortly. |
|
||
px = web.get_data_quandl(symbol, start=start, end=end) | ||
rets = px[['AdjClose']] | ||
rets = rets.shift(-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just call .pct_change()
to get returns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
px = web.get_data_quandl(symbol, start=start, end=end) | ||
rets = px[['AdjClose']] | ||
rets = rets.shift(-1) | ||
rets.iloc[-1]['AdjClose'] = px.tail(1)['AdjOpen'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We treat returns from close to close.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
rets = get_symbol_returns_from_yahoo(symbol, start=start, end=end) | ||
|
||
rets = get_symbol_returns_from_quandl(symbol, start=start, end=end) | ||
rets.sort_index(inplace=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does quandl not give a sorted index?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaycode sorry for the long delay, but we're finally getting back to this. |
Hello @jaycode, this is a high-priority issue for us, so I'll be work on my own version of the PR, if that's alright with you. Thanks so much! |
I updated
default_returns_func
to use Quandl, createdget_symbol_returns_from_quandl
, and deprecatedget_symbol_returns_from_yahoo
.