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

No data before date bug in volume roll finder #1893

Merged
merged 1 commit into from Jul 27, 2017

Conversation

dmichalowicz
Copy link
Contributor

@dmichalowicz dmichalowicz commented Jul 27, 2017

In the volume roll finder, we look up to a week back from the given date (called the grace period) where we look for double volume flips. It was possible that if the back contract had not started yet in the past week, an exception was thrown.

@yankees714 Mind taking a look? This is a follow up fix to #1892. In that first fix we checked existence of the contracts before calling get_value, but we also call get_value later on that needs the same check.

@dmichalowicz dmichalowicz changed the title No data before date bug No data before date bug in volume roll finder Jul 27, 2017
@coveralls
Copy link

coveralls commented Jul 27, 2017

Coverage Status

Coverage increased (+0.4%) to 87.512% when pulling 164d0b0 on no-data-fix-take-2 into c40d9da on master.

Copy link
Contributor

@yankees714 yankees714 left a comment

Choose a reason for hiding this comment

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

LGTM, just had one non-blocking suggestion

@@ -212,6 +212,8 @@ def _active_contract(self, oc, front, back, dt):
tc.minute_to_session_label(gap_end),
)
for session in sessions:
if session < back_contract.start_date:
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

What would you think of incorporating this logic when calculating sessions above? Something like making gap_start the max of the beginning of the grace period and the back contract start date?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya I like that idea, will update.

@coveralls
Copy link

coveralls commented Jul 27, 2017

Coverage Status

Coverage increased (+0.4%) to 87.511% when pulling dccf640 on no-data-fix-take-2 into c40d9da on master.

@dmichalowicz dmichalowicz merged commit ee42bd1 into master Jul 27, 2017
@dmichalowicz dmichalowicz deleted the no-data-fix-take-2 branch July 27, 2017 19:07
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