Commit Graph

153 Commits

Author SHA1 Message Date
Eddie Hebert 799a357d98 Changes test factory to use Event instead of ndict.
As more sources are moving off of ndict,
changing the factory to use Event, so that when testing we are
exercising use of Event.
2013-01-06 17:13:07 -05:00
Thomas Wiecki 775c564ea1 ENH: Added DataPanelSource. 2012-12-13 12:55:05 -05:00
Eddie Hebert bbc8050c81 Merge pull request #42 from quantopian/iso8061_to_8601
Remove unused ISO 8601 stuff from Zipline
2012-12-12 16:47:55 -08:00
Richard Frank 095f2dd65b Date bookkeeping fixes in perf and risk
Issues appeared when we were close to the end of our
historical data.

Yielding DONE event with both perf and risk messages now
2012-12-12 15:23:26 -05:00
Jonathan Kamens 831034eb3b Remove unused ISO 8601 stuff from Zipline 2012-12-11 13:54:59 -05:00
Richard Frank 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 5a585fc3aa Merge pull request #37 from quantopian/fix_transforms
Fix transforms
2012-12-06 14:00:35 -08:00
Thomas Wiecki 5f6839beea BUG: Refactored batch_transform unittests and fixed some bugs. 2012-12-06 12:36:47 -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 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
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 f4be285dd7 Removed quarter utilities unused by zipline 2012-11-20 13:46:48 -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 Wiecki 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
Thomas Wiecki ae1644fe35 Added yahoo finance loader. 2012-10-22 09:28:56 -04:00
Thomas Wiecki 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 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
Eddie Hebert ae41a94c8f flake8 cleanup to protocol_utils 2012-10-16 16:35:23 -04:00
Eddie Hebert 9545c2672f Removes unused trading day rules in date_utils.
This logic is now captured in trading calendar.
2012-10-16 16:31:13 -04:00
Eddie Hebert 3395d3ad3b Removes unused date_to_datetime in zipline. 2012-10-16 15:20:22 -04:00
Eddie Hebert 1843447552 Removes unused utcdatetime class from date_utils. 2012-10-16 15:18:01 -04:00
Eddie Hebert 077fc38806 Removes unused d_tuple from date_utils. 2012-10-16 15:16:36 -04:00
fawce c008a957df added a __contains__ method that looks for a special property _ndict_contains__ (must be a function)
when present, the in operator behavior will be determined by the return of the special property.
2012-10-16 12:59:22 -04:00
Eddie Hebert 3456a583d0 Adds missing license header to protocol_utils module. 2012-10-15 16:53:44 -04:00
Eddie Hebert d80099db80 Removes log_utils module.
The log_utils module is not needed to run zipline core.
2012-10-15 16:24:00 -04:00
Eddie Hebert 56b23c46ef Removes unused timeout module. 2012-10-15 15:29:00 -04:00
Eddie Hebert 44d614591d Removes non-zipline specific delayed_signals module.
The delayed_signals module isn't actually necessary for the
running of zipline, so removing to reduce the surface area.
2012-10-15 14:16:50 -04:00
Eddie Hebert 25ce71651f Removes unused namelookup function.
Cutting out function whose only use was an unused constant.
2012-10-15 14:02:26 -04:00
Eddie Hebert 557f93f1e6 Removes unused FrameExceptionFactory. 2012-10-15 13:43:25 -04:00
Eddie Hebert 5eb4b171a9 Removes unused module. 2012-10-12 15:15:32 -04:00
Eddie Hebert 35b0bb9b26 Removes unused log_path method. 2012-10-12 15:15:07 -04:00
Eddie Hebert 0c96915404 Removes requirement of existence /var/log/zipline.log
Instead log to test.log in working directory when running tests.

Also, removes config file for logging module, that is no longer
used since we are now using LogBook.
2012-10-12 11:27:42 -04:00
fawce 815c9f2cf6 providing default behavior for positions dictionary. non-existent positions are
returned as zero size/value positions.
2012-10-10 16:08:14 -04:00
fawce d9cf193ce0 fixes to unit tests 2012-10-10 16:07:11 -04:00
fawce 16b0d71506 refactoring of algorithm to make it work for both batch style run method, and generator style consumption. removed the portfolio property from the data parameter. added set_slippage and set_commission methods to algorithm. removed timeout tracking. 2012-10-10 16:06:32 -04:00
fawce d2e639c2da quarterly conversions 2012-10-10 16:05:02 -04:00
Eddie Hebert d98190daf7 Removes unused kwarg btrid to create_txn. 2012-10-09 14:16:48 -04:00
Eddie Hebert 9500163ed8 Adds Apache 2.0 license header to source files. 2012-10-08 17:32:41 -04:00
fawce 8bd6b675b2 fixed weird indentation bug 2012-10-08 12:06:22 -04:00
Eddie Hebert 15604134c7 Removes unused random source method.
Method was unused and used an unimported module.
2012-10-05 12:14:39 -04:00
Eddie Hebert 77af1ca632 Applies PEP-8 and pyflakes style to tests and zipline.
Mostly whitespace, line width and other spacing changes.
Also, removes use of deprecated has_key in favor of `in`

Going forward new patches should pass running `flake8` before
submission.
2012-10-05 12:14:09 -04:00
fawce 7a8697f0e5 updated based on PR feedback. 2012-09-30 22:12:00 -04:00
fawce 1caefbff43 tests are passing for independent commission model 2012-09-28 23:12:41 -04:00
Thomas Wiecki 4324f95f36 Better unittest coverage. DataFrameSource is now filtering sids. Fixed outstanding issues. 2012-09-21 11:59:46 -04:00
Thomas Wiecki 3be2f313cd Shortened test window. Renamed functions in window transform. 2012-09-19 18:39:42 -04:00
Thomas Wiecki 2fe37fa34c Fixed pandas depracation. 2012-09-19 18:02:09 -04:00