-
Notifications
You must be signed in to change notification settings - Fork 4.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
ENH: Change default commission to .001 #1946
Conversation
what about |
da40c86
to
5b3e2de
Compare
After discussion with Josh, I also updated I had to update some of the tests too. Because the issue here: https://github.com/quantopian/zipline/blob/master/tests/resources/rebuild_example_data#L105 I can't rebuild the example data, so I had to manually set the commisions in each example to the old commision values so that the results would be the same. This should be a temporary fix until we can rebuld the example data again. @dmichalowicz do you mind taking a look again? |
self.assertEqual(results.port_value.iloc[0], 10000) | ||
self.assertAlmostEqual(results.port_value.iloc[1], | ||
10000 + 780 - 392 - 1) | ||
10000 + 780 - 392 - 0, | ||
places=2) |
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 was getting this failure '10387.99899997449 != 10388 within 7 places'
without adding places=2
I'm not sure if there is a better way to do this.
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 this is fine.
self.assertEqual(results.port_value.iloc[0], 10000) | ||
self.assertAlmostEqual(results.port_value.iloc[1], | ||
10000 + 780 - 392 - 1) | ||
10000 + 780 - 392 - 0, | ||
places=2) |
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 this is fine.
# Explicitly set the commission to the "old" value until we can | ||
# rebuild example data. | ||
# github.com/quantopian/zipline/blob/master/tests/resources/ | ||
# rebuild_example_data#L105 |
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.
TLDR: What you have here is good.
It's actually still possible to rebuild the example data (with a couple minor tweaks), I did so here only about a month ago. We now get benchmark data from Google instead of Yahoo, as seen here.
However, it appears that as of only a week or two ago, Google changed the URL from which they are serving their financial data, causing pandas datareader to break. As a result, after checking out your branch I was unable to rebuild the data like I was previously (without having to either (1) make our own pandas-datareader fork, or (2) make a bunch of extra changes to the tests and test dates; neither of which I want or think we need to do).
For more info see the following:
- It seems that Google does no longer provide historical stock data? pydata/pandas-datareader#391
- https://stackoverflow.com/questions/46259528/datareader-google-finance-date-not-working/46356247#46356247
- https://stackoverflow.com/questions/46243360/google-api-changed-for-data-from-google-finance
All that being said, I think your solution of keeping the old parameters for now is best. When the pandas datareader issue is fixed though I think this may be worth revisiting.
@richafrank @freddiev4 Is this breakage something we should be worried about anywhere else?
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.
Yea, I think we need to revisit our benchmark downloading, either fixing google, adding back yahoo (via pandas-datareader if it supports it), or both.
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.
Filed #1965
@srklonaris Looks good to me |
@srklonaris Quick note before you merge, I would rebase this off of master first as it looked like it was branched off a really old commit |
5b3e2de
to
49db008
Compare
Change default commission to .001 to be consistent with the contest.