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

ENH: Change default commission to .001 #1946

Merged
merged 1 commit into from
Oct 4, 2017
Merged

Conversation

samklonaris
Copy link
Contributor

@samklonaris samklonaris commented Sep 14, 2017

Change default commission to .001 to be consistent with the contest.

@jbredeche
Copy link
Member

what about DEFAULT_MINIMUM_COST_PER_EQUITY_TRADE? do we still want a minimum of $1/trade?

@samklonaris samklonaris force-pushed the default-commissions branch 4 times, most recently from da40c86 to 5b3e2de Compare September 25, 2017 14:53
@samklonaris
Copy link
Contributor Author

After discussion with Josh, I also updated DEFAULT_MINIMUM_COST_PER_EQUITY_TRADE and DEFAULT_MINIMUM_COST_PER_FUTURE_TRADE to both be 0.0.

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

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.

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 this is fine.

@coveralls
Copy link

coveralls commented Sep 25, 2017

Coverage Status

Coverage increased (+0.008%) to 87.212% when pulling da40c86 on default-commissions into 64af3d3 on master.

@coveralls
Copy link

coveralls commented Sep 25, 2017

Coverage Status

Coverage increased (+0.008%) to 87.212% when pulling 5b3e2de on default-commissions into 64af3d3 on master.

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

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:

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?

Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Filed #1965

@dmichalowicz
Copy link
Contributor

@srklonaris Looks good to me

@dmichalowicz
Copy link
Contributor

@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

@coveralls
Copy link

coveralls commented Sep 26, 2017

Coverage Status

Coverage increased (+0.008%) to 87.212% when pulling 49db008 on default-commissions into ec94e5a on master.

@samklonaris samklonaris merged commit 31447d6 into master Oct 4, 2017
@samklonaris samklonaris deleted the default-commissions branch October 4, 2017 14:29
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

5 participants