Commit Graph

1400 Commits

Author SHA1 Message Date
Jean Bredeche f11b6467ac Rename _attrs_to_check to asdict 2017-02-23 11:32:04 -05:00
Andrew Daniels ba484e5469 MAINT: Removes unnecessary capital_base arg to TradingAlgorithm (#1677)
Capital base is included in the sim params, so we should define the
value there, or use the default.

This change also unifies the default capital base as 1e5, as was
previously defined in algorithm.py.
2017-02-17 09:04:50 -05:00
dmichalowicz 6d47a36166 ENH: Eliminate potential look-ahead bias in volume rolls 2017-02-16 09:01:16 -05:00
Maya Tydykov 4075971db4 Merge pull request #1684 from quantopian/fix-earnings-estimates-1-day-bug
BUG: fix loader bug for 1 day
2017-02-15 17:20:31 -05:00
Maya Tydykov 382eef0e3d BUG: fix loader bug for 1 day 2017-02-15 16:44:45 -05:00
Andrew Daniels 296307a632 TST: Adds TestingSlippage slippage model (#1679)
Allows specifying a constant number of shares filled per tick.

Also adds the WithConstantEquityMinuteBarData fixture, relocated from
internal repo.
2017-02-09 08:56:15 -05:00
Eddie Hebert 3d47aee2ab STY: Wrap/reformat lines over 80 chars.
Newer versions of flake8 detect these versions, though current zipline version
of flake8 does not.
2017-02-08 00:47:33 -05:00
dmichalowicz dd78bfa4e8 Change to a 10.5 hour futures calendar 2017-02-06 11:41:29 -05:00
Gus Gordon b45c52b453 Bump empyrical to 0.2.2 (#1674)
* Bump empyrical to 0.2.2

* Update example data for tests
2017-02-04 16:14:33 -05:00
Eddie Hebert 512c2bfb83 TST: Remove duplicate key in fixture config.
Should be no functional change.
2017-02-02 23:10:14 -05:00
Maya Tydykov b1cae1b76a Merge pull request #1661 from quantopian/optionally-apply-deltas-adjustments
Optionally apply deltas adjustments
2017-01-31 15:40:43 -05:00
Maya Tydykov 5a9e91b567 TST: add arg to test assertion 2017-01-31 15:19:05 -05:00
Scott Sanderson 2fb90b4a25 Merge pull request #1667 from quantopian/pricing-fixture-cleanups
Pricing fixture cleanups
2017-01-31 10:32:17 -05:00
Maya Tydykov ae4511360f Merge pull request #1665 from quantopian/determine_overwrite_type_dynamically
Determine overwrite type dynamically
2017-01-31 10:06:21 -05:00
Maya Tydykov 66d1a0ce78 TST: add test cases for int and object dispatching 2017-01-31 09:43:39 -05:00
Maya Tydykov 185e7a13f8 ENH: add Int64Overwrite and dispatching for it
BUG: column value should be float

DOC: update docs
2017-01-31 09:43:37 -05:00
Maya Tydykov 750837c5f8 MAINT: determine core loader overwrite types dynamically
TST: update test to reflect adjustment mapping change
2017-01-31 09:43:34 -05:00
Scott Sanderson 0c5f88e2f6 ENH: Add direct methods for session start/end.
Rather than having to do 'start, _ = cal.open_and_close_for_session(dt)'
to get just the start, we can now do 'start = cal.session_start(dt)'.
2017-01-30 13:00:45 -05:00
Eddie Hebert 8f42fade24 ENH: Add futures support for generic asset lookup.
Attempt to lookup up the symbol in the futures table, after attempting to look
up the symbol in the equities table.
2017-01-26 21:08:30 -05:00
dmichalowicz b891fd00d5 BUG: Multipliers were not removed when closing a position 2017-01-25 17:23:09 -05:00
Jean Bredeche 0b8fee49d1 ENH: Solidify equality comparisons for SlippageModel classes 2017-01-24 11:28:32 -05:00
Eddie Hebert 873f3a7fc9 BUG: Fix end session metadata for minute bar writer.
When opening with a new `end_session`, i.e. opening for append, write the new
end session to the metadata.

Fixes an issue where the calendar on minute bar readers did not include the
recently appended day, causing reads on the last values to fail.

According, update append test to read a value, instead of checking table length.
2017-01-22 15:14:05 -05:00
David Michalowicz 60e8ea30e5 Merge pull request #1644 from quantopian/closed-means-closed
Don't allow ordering assets after their auto close date
2017-01-20 10:19:27 -05:00
dmichalowicz 6e707f97a7 BUG: can_trade was true for assets after their auto close date 2017-01-20 09:54:30 -05:00
Jean Bredeche 7c72a4fc56 BUG: fix a py3 invalid char 2017-01-19 20:43:48 -05:00
Jean Bredeche b5438ac94e ENH: add current_session property to BarData 2017-01-19 16:53:49 -05:00
Maya Tydykov 8cbad56d79 Merge pull request #1643 from quantopian/events-loader-handle-empty-raw-data
Events loader handle empty raw data
2017-01-19 13:01:43 -05:00
Maya Tydykov 51eb11fbc9 BUG: make the events loader handle empty raw data
TST: add test case for empty raw events data

BUG: update for python compatibility

MAINT: Simplify assertion for empty events case.

DOC: Add comments on indexer unpacking.

MAINT: move some config to test method
2017-01-19 12:00:49 -05:00
Jean Bredeche a9c0ce1dde ENH: Small refactoring of fill price check. 2017-01-18 09:22:05 -05:00
Eddie Hebert 261803b622 ENH: Add a method to open existing minute bar directory.
Remove need for a consumer that is editing an existing minute bars directory to
reread the values which should not change from the metadata.

Add a test to the append on new day and truncate, which would be the common
usage of this method.
2017-01-17 17:25:27 -05:00
Eddie Hebert 9f60524e14 STY: Use def statements instead of lambda assignment. (#1639)
From pep-0008:

```
Always use a def statement instead of an assignment statement that binds a
lambda expression directly to an identifier.

Yes:

def f(x): return 2*x
No:

f = lambda x: 2*x

The first form means that the name of the resulting function object is
specifically 'f' instead of the generic '<lambda>'. This is more useful for
tracebacks and string representations in general. The use of the assignment
statement eliminates the sole benefit a lambda expression can offer over an
explicit def statement (i.e. that it can be embedded inside a larger expression)
```
2017-01-06 13:39:07 -05:00
Eddie Hebert d7d2214756 ENH: Add a reader writer pair for HDF5 minute bar updates.
This format is intended for storing data for all sids of an asset type,
e.g. equities or futures for a session. bcolz is not used to avoid the overhead
of creating the directories and files for each asset (which numbers around ~8000
for active equities) can be removed since the update is meant to be read at
once, instead of supporting the random access pattern needed by the simulation.

This patch only adds the reader/writer pair, with the management of finding the
paths to delta files and the application of the updates to the bcolz write left
to internal loader code.

Also, the update reader interface is intentionally constrained to the data for
an entire session to allow for an implementation that allows for mid-session updates.
2017-01-04 12:09:10 -05:00
Scott Sanderson 54d78d002d Merge pull request #1627 from quantopian/vectorized-symbol-map
ENH: Add vectorized lookup_symbol.
2016-12-28 15:10:14 -05:00
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
Kathryn Glowinski 5025101d37 Adjustments to Component Dfs (#1620)
* ENH: SQLiteAdjustmentReader can return DF versions of tables.
2016-12-27 13:44:17 -05:00
dmichalowicz ba81f12370 TST: Extra test for reading/writing ohlc ratios 2016-12-22 14:34:46 -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 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 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
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
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
Joe Jevnik d52d6eddff BUG: fix blaze pipeline queries for asof_date 2016-12-01 14:35:59 -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