Commit Graph
844 Commits
Author SHA1 Message Date
Thomas WieckiandEddie 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 HebertandEddie 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 BrandtandEddie 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
Thomas WieckiandEddie Hebert 126e9fdf26 Fixed batch_transform window length not being market aware.
Added accompanying unittest.

Minor refactoring of unittests and factory.
2012-11-06 21:13:27 -05:00
Eddie Hebert 086c12ddf8 Locks down the ability to easily override the algo's portfolio.
Starting down the path of making the portfolio completely read-only
with respect to the handle_data in algo.

The portfolio should only be changed during the course of running
the algorithm by the simulator.

This doesn't do a 100% protection, i.e. an algo could use _portfolio,
or the set_attr property, but hoping this helps guides algo writing
to treat the portfolio as read-only.
2012-11-05 13:40:23 -05:00
fawceandEddie Hebert fa427afb16 added algotime get/set to algorithm 2012-10-29 18:54:55 -04:00
Thomas WieckiandEddie Hebert c0b161287d Fixed odd bug that caused the first day not to get simulated. This triggered some changes to the batchtransform unittests. 2012-10-23 17:57:27 -04:00
Thomas WieckiandEddie Hebert 42c2a6b892 Adds example algorithm scripts. 2012-10-23 17:46:02 -04:00
Eddie Hebert e77cce1dc2 Removes extra getter method for getting returns member. 2012-10-23 13:29:42 -04:00
Thomas Wiecki 7a34e37b1e Transforms now default market_aware=True. 2012-10-23 09:14:05 -04:00
Eddie Hebert bad6296d24 Merge pull request #2 from quantopian/yahoo_finance_loader
Added yahoo finance loader.
2012-10-22 09:07:25 -07:00
Eddie Hebert 7904773d00 Updates flake8 to latest.
The latest flake8 release in now 1.5, which pulls in pep8: 1.3.4a0

The upgrade pep8 has changes to what it picks up as lint.
Making code base compatible, so that new devs can install pep8
from PyPI and not have friction over the version difference.

Currently using these ignores in the config file:

```
[pep8]
ignore = E124,E125,E126
```

Ignoring these since they are difficult to squash while maintaining
an 80 char line length, and appear spurious.
Should address later.

Updates Travis config, README, and pip requirements to reflect change.
2012-10-22 11:57:16 -04:00
Thomas Wiecki ae1644fe35 Added yahoo finance loader. 2012-10-22 09:28:56 -04:00
Thomas Wiecki ddb007a6f9 Removed optimize from __init__.py file. 2012-10-22 09:04:12 -04:00
Thomas Wiecki d468d05ba4 Removes optimize directory and optimize unittests which live on a separate branch yet. Was not functional yet and should thus not be in the main branch. 2012-10-22 08:51:30 -04:00
Thomas WieckiandEddie Hebert 15ac658024 Restructured file hierarchy. Transforms now live in transforms (transform.py is now transforms/utils.py). Sources are in sources.py. VWAP is now MovingVWAP. 2012-10-19 18:10:51 -04:00
Eddie Hebert e9d4f1d9d0 Applies flake8 recommendation. Whitespace wrangling. 2012-10-19 14:14:53 -04:00
Thomas Wiecki 92f1dbef0c Fixes bug that .run() could not be called twice on an algorithm. Added unittest to check. 2012-10-19 11:47:59 -05:00
fawceandEddie Hebert 943a56322e added a __call__ method to BatchTransform to make it useable as a decorator. 2012-10-19 11:20:00 -04:00
Eddie Hebert 0ab136f1c8 Adds a loader for market data when it doesn't exist locally.
Hopefully, this helps ease ramp up time for developing against
market data, without us distributing the data.

We do a check for the data when attempting to read the msgpack
files, if they don't exist the loader makes a web request and
retrieves and serializes the data for the user.

Provides a loader for:

- curves from data.treasury.gov
- benchmarks from Yahoo! Finance

Adds dependency of requests library in dev requirements.
2012-10-19 11:19:14 -04:00