Commit Graph

4786 Commits

Author SHA1 Message Date
Scott Sanderson 64029a9e7e TEST: Tweaks to vectorized symbol tests.
- Test against an empty list.
- Don't test empty share class lookups.
- Add another comprehension test for completeness.
2016-12-28 14:40:18 -05:00
Scott Sanderson 876b9c74c9 ENH: Add vectorized lookup_symbol.
Currently only supports one as_of date.c
2016-12-28 12:31:50 -05:00
David Michalowicz 62f1c19510 Merge pull request #1623 from quantopian/futures-scaling-factor
TST: Extra test for reading/writing ohlc ratios
2016-12-22 15:01:42 -05:00
dmichalowicz ba81f12370 TST: Extra test for reading/writing ohlc ratios 2016-12-22 14:34:46 -05:00
Andrew Daniels 29aed9ea97 TST: Populate equity_supplementary_mappings from WithAssetFinder (#1622) 2016-12-22 11:07:30 -05:00
Richard Frank 3350227f44 Merge pull request #1596 from quantopian/order_batch
Order batch
2016-12-21 20:41:35 -05:00
Richard Frank e674e4e26a MAINT: Filter out null orders 2016-12-20 19:27:29 -05:00
Richard Frank d9a1479db7 MAINT: Some cleanup while working on batch ordering 2016-12-20 19:27:28 -05:00
Richard Frank 581e827208 TST: Ensure batch_order_target_percent orders like order_target_percent 2016-12-20 19:27:28 -05:00
Richard Frank 1cb85b70f2 DOC: Updated return types in docstrings 2016-12-20 19:27:28 -05:00
Richard Frank 8ea3226a5c ENH: Renamed to batch_order and added batch_order_target_percent 2016-12-20 11:58:05 -05:00
Richard Frank 74a3247892 MAINT: Renamed order_batch parameter and added docs 2016-12-20 11:57:27 -05:00
Richard Frank 7aefa9c311 MAINT: Allow for orders with id 0 2016-12-20 11:57:26 -05:00
Richard Frank f4773053cb TST: Added test for order_batch 2016-12-20 11:57:26 -05:00
Richard Frank 3fd34127c0 MAINT: Moved common asset lookup to fixture init
Also can use class's asset_finder instead of via env
2016-12-20 11:57:26 -05:00
Richard Frank 6c04f30eca MAINT: Removed unnecessary override 2016-12-20 11:57:26 -05:00
Richard Frank 321e52481c ENH: Blotter support for ordering a batch 2016-12-20 11:57:26 -05:00
Richard Frank 86c4c27a6a MAINT: Factored out order arg calculation methods
so callers can use them to construct args for a batch of orders
2016-12-20 11:57:26 -05:00
Andrew Daniels 0848a8a486 ENH: Adds support for supplementary asset mappings (#1612)
* ENH: Adds support for supplementary asset mappings

- Adds a supplementary_mappings table to the assets.db, to hold point-
  in-time mappings of sids to arbitrary categories of values, e.g.
  alternative identifiers. This bumps ASSET_DB_VERSION.

- Adds supplementary_map and supplementary_map_by_sid to AssetFinder,
  caches of the underlying table that are fully populated on first
  access, which map the supplementary values to sids and vice versa,
  respectively.

- Adds lookup_by_supplementary_mapping method, which fronts
  supplementary_map to query for the asset last known to have held a
  value at a given dt.

- Add get_supplementary_field method, which fronts
  supplementary_map_by_sid to query for the last known value held by an
  asset at a given dt.
2016-12-16 15:20:53 -05:00
Joe Jevnik a5423083bf ENH: Allow custom chunks iterators for attach_pipeline 2016-12-15 19:58:19 -05:00
Ana Ruelas 7af53ddfcd Merge pull request #1611 from quantopian/fix-buildbreaking-docstring
DOCS: Minor (but build breaking) docstring fix
2016-12-06 14:26:48 -05:00
Ana Ruelas 983d0e9829 DOCS: Minor (but build breaking) docstring fix 2016-12-06 13:33:22 -05:00
Eddie Hebert f0692c82a4 Merge pull request #1610 from quantopian/allow-skips-across-contracts
BUG: Allow rolls to skip over contracts.
2016-12-05 22:53:36 -05:00
Eddie Hebert d3ff536de4 BUG: Allow rolls to skip over contracts.
For futures that behave like GC, use the latest roll as the back contract when
walking backwards over the window, so that when the front contract is skipped
because it never has more volume between its auto close date and the previous
auto close date, the back contract which did have volume is still used when
making comparisons to construct the chain.
2016-12-05 22:33:03 -05:00
Eddie Hebert c166bb0e37 Merge pull request #1609 from quantopian/use-custom-business-day-for-session-loop-logic
MAINT: Use session index freq for loop logic.
2016-12-05 13:59:07 -05:00
Eddie Hebert 31d31bf1d3 MAINT: Use session index freq for loop logic.
Instead of maintaining a separate index into the sessions index, use the `.freq`
member of the sessions index for decrementing to the current session and finding
the previous session.
2016-12-05 13:08:49 -05:00
Eddie Hebert 47651363c0 DOC: Update testpypi install command
When following the release guide, installing from testpypi using the
`-i` flag failed on my, and at least one other's, development machines.
The cause of the failure appears to be that pip would look for packages,
such as `LogBook` or `pandas` on `testpypi`. However many dependencies
do not have versions that meet our version criteria. (e.g. pandas does
not have a version between 0.16.0 and 0.18.0 on testpypi.)

Instead, use `--extra-index-url` so that other packages can use `pypi`
as a fallback server, instead of being limited to `testpypi`.
2016-12-01 14:40:38 -05:00
Joe Jevnik d52d6eddff BUG: fix blaze pipeline queries for asof_date 2016-12-01 14:35:59 -05:00
Eddie Hebert 3a09833b6c Merge pull request #1607 from quantopian/allow-delivery-subsets
ENH: Allow future chains to only use certain delivery months.
2016-12-01 14:06:32 -05:00
Eddie Hebert 117d228fc2 ENH: Allow future chains to only use certain delivery months.
To support contracts such as `PL` which should roll from F->J->N->V, add the
ability to pass a predicate function to the ordered contract chain contstrution
which returns `True` if the contract is allowed in the chain.
2016-12-01 13:26:07 -05:00
Eddie Hebert 9ac957f8a1 Merge pull request #1606 from quantopian/fix-volume-rolls-with-adjustments
BUG: Fix 1m history for volume rolls with adjustments.
2016-11-30 14:24:02 -05:00
Eddie Hebert c6577a6518 BUG: Fix 1m history for volume rolls with adjustments.
Convert the end minute to the its session label before calling `_active_contract`,
otherwise the volume roll finder's attempt to use the session bar reader fails
due to a non-session label Timestamp.
2016-11-30 13:13:53 -05:00
Eddie Hebert 0e3b290cc1 Merge pull request #1605 from quantopian/support-non-month-to-month-rolls
BUG: Support futures which do not roll month to month.
2016-11-30 12:47:16 -05:00
Eddie Hebert 82bc2a6d3d BUG: Support futures which do not roll month to month.
Fix multiple errors when attempting to generate rolls for futures which do not
roll month to month, e.g. the Eurodollar.

These errors were caused by logic that always incremented from contract to
contract by delivery month, with errors when the next contract was not part of
the quarterly roll chain and thus had not yet begun trading even though the
previous contract had autoclosed. Instead, filter out these contracts and only
allow contracts that have begun trading before the previous contract's autoclose.

This is in lieu of a more explicit specification of quarterly rolls.
2016-11-30 11:23:43 -05:00
Eddie Hebert 6f33bdcfd3 Merge pull request #1604 from quantopian/use-linked-list-for-contracts
MAINT: Use a doubly linked list for contract chain.
2016-11-30 06:54:28 -05:00
Eddie Hebert d147397983 MAINT: Use a doubly linked list for contract chain.
Instead of requiring the roll finder to juggle the indices into the ordered
contracts, use a doubly linked list where the nodes element is the contract
with members pointing to the previous and next contracts in the chain.

Besides improving legibility in the roll finder code, this change is on the path
to adding a predicate to exclude contracts from the chain, e.g. contracts in ED
which are not in the roll schedule.

Change test results for primary chain, since new implementaton does not stop at
contract in which has not yet started when constructing the chain.
2016-11-30 06:01:59 -05:00
Scott Sanderson 74df429057 Merge pull request #1588 from quantopian/randc-built-in-factors
ENH: Add MACD, MA, and AnnVol as built in factors
2016-11-28 16:18:58 -05:00
Scott Sanderson 37f58264cd Merge pull request #1603 from quantopian/randc-built-in-factors-twekas
Randc built in factors twekas
2016-11-28 15:30:40 -05:00
Scott Sanderson ee230c807f DOC: Docstring updates. 2016-11-28 15:29:36 -05:00
Scott Sanderson 4210a2f80f MAINT: Tweaks/cleanups in technical.py.
- Use `expect_bounded` to check inputs.
- Add tests for expected failures from `MACDSignal`.
- Use `float64` instead of `float` in a few places.  This prevents
  diverging behavior on 32-bit systems.
- Docstring edits.
2016-11-28 13:02:40 -05:00
Scott Sanderson d140d585c2 MAINT: Put exponential_weights where it's used.
`math_utils` is mostly a shim around bottleneck imports.  If we need
this somewhere else, it probably belongs in `numpy_utils`.
2016-11-28 13:02:40 -05:00
Scott Sanderson c05635333e STY: Put whitespace between operators. 2016-11-28 12:57:03 -05:00
Scott Sanderson 52958a0340 TEST: Use parameter_space for randomized tests.
- Use a RandomState with a seed so that we have repeatible results.
- Use `randint` instead of `random_integers.` `random_integers` is
  deprecated.
- Use `parameter_space` to test multiple period lengths.
2016-11-28 12:57:03 -05:00
Scott Sanderson 84e7c03147 Merge pull request #1599 from quantopian/memory-savings
Memory savings
2016-11-28 10:52:23 -05:00
Eddie Hebert 320f1f64db Merge pull request #1600 from quantopian/use-prev-session-for-volume-roll
BUG: Fix bounds errors in roll finder.
2016-11-26 21:37:21 -05:00
Andrew Daniels 1f176de497 MAINT: Improve minute writer handling of non-trading minutes (#1602)
Previously, if input to the BcolzMinuteBarWriter had the first bar on a
non-trading minute, the next trading session would be considered the
"first day" in the input. Now, we consider the previous trading session
the "first day".

The intention is to correctly associate minutes after official trading
hours on half days with session that closed early, not the following
session (a future improvement here would be to not accept minutes
outside trading hours).
2016-11-26 21:12:12 -05:00
Jonathan Kamens 5ab89ff25d BLD: Use https to download ta-lib source 2016-11-25 12:12:33 -05:00
Ana Ruelas 3363237123 ENH: Add MACDSignal, test with random input 2016-11-23 11:43:29 -05:00
Eddie Hebert 4d434acab7 BUG: Fix bounds errors in roll finder.
Fix common error condition which was triggered whenever the session at the end
of the prefetched history window was a session where the back contract was
active. When the back contract was the active contract, the next contract for
consideration was the front contract at the end of the window, which
definitionally always has an autoclose after the end of the window.
Instead, just start seeking backwards from the end of the window.

Also prevent lookahead bias in volume rolls, which was caused by the using the
volume for a session to determine whether that session had rolled. Information
that would not have been available at the beginning of the session.

This change makes the volume rolls overly conservative, and may be improved by
looking at vectors of the preceding volume and making the roll off of momentum.
2016-11-23 10:35:45 -05:00
Scott Sanderson 9f28b7cede MAINT: Hit more dataframe indexers. 2016-11-22 17:11:04 -05:00