Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

jaycode
Copy link
Contributor

@jaycode jaycode commented Mar 26, 2018

I updated default_returns_func to use Quandl, created get_symbol_returns_from_quandl, and deprecated get_symbol_returns_from_yahoo.

@jaycode jaycode mentioned this pull request Mar 26, 2018
@twiecki
Copy link
Contributor

twiecki commented Mar 26, 2018

Thanks @jaycode!

CC @richafrank for assigning a reviewer.

@jaycode
Copy link
Contributor Author

jaycode commented Mar 26, 2018

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)
Copy link
Contributor

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.

Copy link
Contributor

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']
Copy link
Contributor

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.

Copy link
Contributor

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)
Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Curiously, it is returned in reverse chronological order.

screen shot 2018-05-17 at 2 44 17 pm

@twiecki
Copy link
Contributor

twiecki commented May 17, 2018

@jaycode sorry for the long delay, but we're finally getting back to this.

@eigenfoo
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants