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: Add history for continuous futures. #1539

Merged
merged 1 commit into from Oct 17, 2016

Conversation

Projects
None yet
2 participants
@ehebert
Member

ehebert commented Oct 14, 2016

Enable unadjusted history for continuous futures.

The history array is filled by the values for the underlying contracts,
where the contract used changes based on rolls.

e.g., if a 1d history window was over the range
2016-01-20 -> 2016-02-29 with contracts with a suffix of F16 that
rolls at the beginning of the session on 2016-01-26, G16 on
2016-02-26, and H16 on 2016-03-26. The 2016-01-20 ->
2016-01-25 portion would use the values for F16', the2016-01-26-> 2016-02-25portion would useG16and the2016-02-26-> 2016-02-29portion would useH16`.

Using the same contracts as above, a 1m history window over the range
(using a timezone of US/Eastern) 2016-01-25 4:00PM -> 2016-01-25 7:00PM would fill the 4:00PM -> 6:00PM portion with data for F16
and the 6:01PM -> 7:00PM portion with data for G16, since the
beginning of the 2016-01-26 session is 2016-01-25 6:01PM.

Supports 1d and 1m.

Also adds the sid field to history to assist in showing the active
contract at each dt in the window.

@ehebert

This comment has been minimized.

Member

ehebert commented Oct 14, 2016

Has some duplication with the continuous readers which can be factored out.
Also, should tune up how the window type switches to int or float based on being sid or volume, or not.

However, this gets to a place where we can build on top of this to add continuous futures adjustments.
So would defer refactoring to clean up those points I mentioned, until after getting adjustments to work.

@ehebert ehebert force-pushed the continuous-future-history branch 4 times, most recently from e7f0436 to d42a38d Oct 15, 2016

@coveralls

This comment has been minimized.

coveralls commented Oct 17, 2016

Coverage Status

Coverage decreased (-0.02%) to 86.842% when pulling d42a38d on continuous-future-history into 4386895 on master.

ENH: Add history for continuous futures.
Enable unadjusted history for continuous futures.

The history array is filled by the values for the underlying contracts,
where the contract used changes based on rolls.

e.g., if a `1d` history window was over the range
`2016-01-20` -> `2016-02-29` with contracts with a suffix of `F16` that
rolls at the beginning of the session on `2016-01-26`, `G16` on
`2016-02-26`, and `H16` on `2016-03-26`. The `2016-01-20` ->
`2016-01-25` portion would use the values for `F16', the `2016-01-26` ->
`2016-02-25` portion would use `G16` and the `2016-02-26` ->
`2016-02-29` portion would use `H16`.

Using the same contracts as above, a `1m` history window over the range
(using a timezone of US/Eastern) `2016-01-25 4:00PM` -> `2016-01-25
7:00PM` would fill the `4:00PM` -> `6:00PM` portion with data for `F16`
and the `6:01PM` -> `7:00PM` portion with data for `G16`, since the
beginning of the `2016-01-26` session is `2016-01-25 6:01PM`.

Supports `1d` and `1m`.

Also adds the `sid` field to `history` to assist in showing the active
contract at each dt in the window.

@ehebert ehebert force-pushed the continuous-future-history branch from d42a38d to 73b03de Oct 17, 2016

@coveralls

This comment has been minimized.

coveralls commented Oct 17, 2016

Coverage Status

Coverage increased (+0.03%) to 86.886% when pulling 73b03de on continuous-future-history into 4386895 on master.

@ehebert ehebert merged commit 5eb9073 into master Oct 17, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ehebert ehebert deleted the continuous-future-history branch Oct 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment