Richard Frank and Eddie Hebert
4981c67c31
Handle missing historical data more elegantly
...
Updated the search for treasury data when there is none for the
test end date.
It could be that the end date is not a trading day, or we could
just be missing treasury data. In either case, we try to recover
more gracefully now, by searching as far as possible and maybe
logging a warning.
Similarly, if there is no benchmark data for the test end date,
look for the next trading day. If we really have no data,
blow up with our own explicit exception, instead of overflowing
in our search for dates in the future.
2012-12-10 13:03:25 -05:00
Eddie Hebert
67b8f63972
Limit the fields of batch transform datapanel to ints and floats.
...
Previously, keys that mapped to functions would be set as field names.
Attempting to assign the datapanel slot to a function causes an error.
This limits the extracted field names to those that map to an int
or a float.
2012-12-07 14:35:55 -05:00
Thomas Wiecki and Eddie Hebert
79a8a08812
STY: Renamed fillna to clean_nans.
2012-12-06 17:23:26 -05:00
Eddie Hebert
5a585fc3aa
Merge pull request #37 from quantopian/fix_transforms
...
Fix transforms
2012-12-06 14:00:35 -08:00
Thomas Wiecki
ecb26e9eec
BUG: Can not test for length when dropping nans.
2012-12-06 16:07:18 -05:00
Thomas Wiecki
c46e09f52a
BUG: Do not backfill but drop rows with N/A in them.
2012-12-06 15:52:50 -05:00
Thomas Wiecki
c7383f6275
STY: Removed drop_condition arguments.
2012-12-06 15:24:01 -05:00
Thomas Wiecki
ba46c6292f
ENH: DataPanel is now created more flexible over all sids and all given fields. Added unittest to test for nan-filling. Added backwards filling by default.
2012-12-06 14:43:20 -05:00
Thomas Wiecki
5f6839beea
BUG: Refactored batch_transform unittests and fixed some bugs.
2012-12-06 12:36:47 -05:00
Thomas Wiecki
c69858f8b9
ENH: Added kwarg to turn off fillna or use different fill method.
2012-12-06 12:35:46 -05:00
Thomas Wiecki
7a0a6f5231
BUG: EventWindow now always contains constant number of days.
2012-12-06 12:33:18 -05:00
Eddie Hebert
bbef0658d1
Adds non-market days due to National Days of Mourning.
...
Post-2002 Days of Mourning, Reagan and Ford
2012-12-04 15:07:05 -05:00
Eddie Hebert
a8e1647d6e
Adds Hurricane Sandy related closings to non-trading days.
...
Adds the closings on 10/29/2012 and 10/31/2012 to the
trading calendar rules.
2012-12-04 14:16:30 -05:00
Eddie Hebert
b2b7ea0063
Adds closings due to 9/11 attacks.
2012-12-04 14:08:30 -05:00
Eddie Hebert
81efe8247f
Merge pull request #35 from quantopian/makes-capital-base-more-configureable
...
Allows the capital base of an algorithm to be more easily modified.
2012-12-04 07:49:53 -08:00
Eddie Hebert
3ff3a6964e
Allows the capital base of an algorithm to be more easily modified.
...
By having run() use a capital_base member of the algorithm to
create the trading environment, the capital base should now be
configurable in the instantiation of the algorithm.
e.g.:
```
algo = LowCapitalBaseAlgorithm(capital_base=1000.0):
```
2012-12-04 10:42:58 -05:00
Thomas Wiecki
ac8ae973bc
ENH: replaced union with intersection in assert (more stringent).
2012-12-04 10:17:53 -05:00
Thomas Wiecki and Eddie Hebert
f81addb7df
ENH: batch_transform now adds arbitrary keys to datapanel.
2012-12-03 13:41:37 -05:00
Richard Frank
1b2f6739e9
Fixed floating-point error in volume share slippage model
2012-11-29 12:13:35 -05:00
Eddie Hebert
e266d926f3
Updates quarter utilities to fix offset.
...
Also, includes tests of quarter utilities.
Thanks to @richafrank.
2012-11-28 10:53:08 -05:00
Eddie Hebert
89485a0ee9
Fixes invocation of datetime method.
2012-11-27 17:46:24 -05:00
Eddie Hebert
cc0ff551ec
Adds quarter date utilities back into zipline.
...
Paving the way for a refactoring that will bring some of the
universe logic, specifically quarter universe logic into zipline.
2012-11-27 17:16:21 -05:00
Richard Frank
4d41070585
Fix for slippage time getting out of sync with algo.
...
Moved grouping by date earlier in the pipeline of generators,
prior to any date-dependent state getting involved. Grouping
pulls from the pipeline until the start of the next group,
which is in the next day. The effect of grouping after
slippage but before handle_data is that slippage and the algo
are out of sync by a transaction.
2012-11-27 13:38:50 -05:00
Richard Frank
c81d6a30d1
Fix to inject log dates from slippage methods.
2012-11-27 12:41:07 -05:00
fawce
3a181529e2
fixed whitespace problem
2012-11-22 07:21:52 -05:00
fawce
bb108e5c08
Update zipline/transforms/utils.py
...
emergency fix. the dropna was dropping the entire price dataframe from the datapanel.
2012-11-22 07:06:59 -05:00
Eddie Hebert
2c3d9a84db
Fills in missing slots in transform data panels.
...
Forward fills data, so that when using multiple stocks,
we don't have cases where one stock has data and the other doesn't.
2012-11-21 17:54:57 -05:00
Eddie Hebert
0ba6f88a84
Fixes event window length in example algo.
...
It was using the old days parameter.
2012-11-20 16:38:56 -05:00
Eddie Hebert
9f715258e6
Updates pairtrade example to use window_length.
...
Batch transforms now use window_length instead of days.
2012-11-20 16:31:18 -05:00
Eddie Hebert
36fe43efce
Merge pull request #25 from quantopian/use-data-source-for-data-frame
...
Use data source for data frame
2012-11-20 13:11:24 -08:00
Richard Frank
f4be285dd7
Removed quarter utilities unused by zipline
2012-11-20 13:46:48 -05:00
Eddie Hebert
ab6b754922
Changes EventWindow parameter of days to window length.
...
The days parameter was causing confusion when explaining the
usage of the batch_transform decorator.
2012-11-20 11:52:27 -05:00
Eddie Hebert
c9483a7e36
Merge branch 'master' into use-data-source-for-data-frame
2012-11-19 21:25:50 -05:00
Eddie Hebert
68c5709f21
Stylistic compliance with flake8 checker.
2012-11-19 21:24:51 -05:00
Eddie Hebert
5a95122f21
Converts data frame source over to using DataSource base object.
2012-11-19 17:30:16 -05:00
Eddie Hebert
f85ad50e60
Breaks the sources module into pieces.
...
Clearing the way for adding in a DataSource class within the
sources module.
2012-11-19 17:30:16 -05:00
Eddie Hebert
cf0de17b13
Merge pull request #22 from quantopian/fix_batch_transform_days
...
BUG: batch_transform was wrongly updating when days < refresh_period.
2012-11-19 12:40:26 -08:00
Eddie Hebert
4a1fbb7d03
Removes unused fuzzy_dates method.
2012-11-19 12:50:46 -05:00
Eddie Hebert
0617e53d69
Upgrades flake8 from 1.5 -> 1.6
...
Also, removes flake8 ignores, since the warnings that were
at odds with eachother now work.
2012-11-19 12:49:09 -05:00
Thomas Wiecki
7bb8dca245
STY: Reversed order of if-statement.
2012-11-19 10:55:30 -05:00
Thomas Wiecki
f2ce713b99
DOC: Added doc-string to get_data().
2012-11-19 10:23:22 -05:00
Thomas Wiecki
4c02fea6e2
BUG: batch_transform was wrongly updating when days < refresh_period.
2012-11-19 10:20:24 -05:00
Eddie Hebert and Eddie Hebert
d5697cdf0a
Fixes under-incrementation of risk report.
...
We were only incrementing the risk report by one day, and never
checking to see if that day we incremented into was a trading day
or not.
We now increment by day until we are on a trading day.
With an assist from @twiecki on:
Adapted test_risk_compare_batch_iterative to work with fixed
iterative risk class.
2012-11-15 14:13:04 -05:00
Eddie Hebert
4c3554042e
Revert "Removes created member from risk metrics."
...
This reverts commit 18587b0623 .
Reverting until we can support the removal in internal code.
2012-11-14 18:25:57 -05:00
Tobias Brandt
e0ef6586a2
DOC: Fixed escaping of special chars in math environment.
2012-11-14 11:26:02 +02:00
Tobias Brandt
b02e392b68
DOC: Fixed escaping of long words in table cells.
2012-11-14 11:25:17 +02:00
Tobias Brandt and Eddie Hebert
ff9093d226
DOC: Fixed some paragraph alignment and table formatting issues.
2012-11-13 12:20:07 -05:00
Eddie Hebert
cc715b81ae
Merge pull request #15 from quantopian/allow-data-when-installed-as-root
...
Allows data downloads when installed as root
2012-11-12 07:24:04 -08:00
Eddie Hebert
18587b0623
Removes created member from risk metrics.
...
`created` was being set, but unused.
It is one of the rare uses of the epoch_now and EPOCH,
so removing on the path of trimming down date_utils.
2012-11-09 06:58:06 -05:00
Eddie Hebert
8a0d6e72cd
Changes the location of downloaded external data files.
...
So that the zipline library can be used when installed to a
write-protected location, e.g. the global site-packages,
moving the download files to a directory in the user's path,
which should be writeable.
For now, choosing a ~/.zipline/data location.
2012-11-08 22:51:03 -05:00