Commit Graph
221 Commits
Author SHA1 Message Date
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
Eddie Hebert 05bb179aba Accounts for negative values when creating compounded returns.
Sets the value sent to log to a value that doesn't crash out because
of negative value.
Setting the value to 0 instead.
2012-10-19 11:18:26 -04:00
Thomas WieckiandEddie Hebert b976c1252b Provides an iterative version of risk metrics.
I wrote this a little while ago as I noticed that a lot of time is spent
computing risk statistics. This is done over the complete history over
and over again while this could be done just by using the previously
computed value (iteratively).

We didn't go forward back then because for minute trade data the
difference was not significant enough. However, now with zipline
standalone I think most people will use daily (because that's
what's available) and it makes a huge difference
(speed-up of a couple of 100%).

Unfortunately, we can't just replace the existing one with an
iterative as for the final cumulative stats the batch is still
better. So that's not as nice, but the performance increase is
big enough for me to issue this PR (zipline is actually painfully
slow with daily data).

There is a unittest that compares that both produce exactly
the same outputs.

Speed measurements (for 500 trading days, daily source):

with iterative:
real 26.617 user 12.909 sys 6.112 pcpu 71.46

prior:
real 44.176 user 31.030 sys 11.381 pcpu 96.00
2012-10-17 23:41:30 -04:00
Eddie Hebert 95ce2d90cf Removes unused constant and redirection of imports.
Removes TRANSFORM_TYPE from protocol, since it is unused.

Also, removes use of ndict as a member of protocol, since it's
import there was for the TRANSFORM_TYPE. Changed to
utils.protocol_utils instead.
2012-10-15 22:57:06 -04:00
Eddie Hebert 23076ae7f1 Allows for collapsed orders by changing the current order filter.
Changes our filter so that instead of just checking for the current
day, we ensure that orders are before or on the current event time.

This adds a delay, (defaulting to one minute), to the order so that we
avoid filling an order exactly when it is placed.
2012-10-11 13:42:53 -04:00
Eddie Hebert 5e87e174f0 Changes name of filled order variable.
So that we don't replace the orders variable with the list comp.

No functional change, but easier to compare the original and the
results of the list comp when debugging.
2012-10-10 16:19:07 -04:00
Eddie Hebert 9fef466323 Uses min function in place of taking the minimum with an if statement. 2012-10-10 16:19:06 -04:00
Eddie Hebert 69a4e542ea Filters out orders in the future.
Enforcing filling open orders that exist on or before the current event.
2012-10-10 16:19:06 -04:00
Eddie Hebert a220bc4e8f Removes expiration from orders.
Expiration is something that way may want to have in the future,
but this current is implementation is dropping orders that
aren't meant to be expired. So removing expiration, so that all
expected orders are executed.
2012-10-10 16:18:46 -04:00
Eddie Hebert 29a87ef7a2 Normalizes indentation before editing. 2012-10-10 16:11:27 -04:00
Eddie Hebert 98f063464e Adds extra constraint of year to check for day inequality.
The .day member of datetime only gives the number of the day of the
year, which is insufficient when checking for < than.

However in this use, we may just want to check for an 'not equals'
2012-10-10 16:11:16 -04:00
Eddie Hebert 0f819474e0 Normalizes indentation to 4 spaces. 2012-10-10 16:11:03 -04:00
Eddie Hebert ca78b1b9e1 Makes ordering of transaction parameters consistent.
The order of open_orders and event were inconsistent across
invocations. Standardizing on one order.
2012-10-10 16:10:52 -04:00
fawceandEddie Hebert 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
fawceandEddie Hebert d9cf193ce0 fixes to unit tests 2012-10-10 16:07:11 -04:00
fawceandEddie Hebert e3f750014e __missing__ needs to put the value into the dictionary 2012-10-10 16:06:55 -04:00
fawceandEddie Hebert 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
Eddie Hebert bbf2317c57 Saving point for adding license files. 2012-10-08 17:32:40 -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 9f8fd52b7d fixed bug where commission ignored order direction 2012-10-01 21:46:48 -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
fawce e6b3e8e7b1 adding independent commission modeling. 2012-09-28 23:02:29 -04:00
fawce 518d471a93 fixed slippage was ignoring order direction. 2012-09-17 15:31:59 -04:00
fawce 1267f66dbe removed old refs 2012-09-14 19:42:55 -04:00
fawce fe8e107c59 dropping max drawdown, adding pytz to whitelist. 2012-09-14 16:00:13 -04:00
fawce 0bb0df525a pluggable slippage. 2012-09-14 12:33:10 -04:00
fawce 57a1834c5a refactored so that slippage is implemented as pluggable classes. 2012-09-13 21:22:01 -04:00
Eddie Hebert 215a64ed6a Removes unused import of zmq. 2012-08-23 23:48:24 -04:00
scottsanderson 22523b5c12 clean up cruft and fix bugs from timeout rename 2012-08-23 13:09:31 -04:00
scottsanderson 55ffa2b391 fix bug where trading environment enters infinite loop on invalid dates 2012-08-23 10:47:35 -04:00
scottsanderson 24fddfbde0 tradingcalender, attempt #2 2012-08-22 02:50:16 -04:00
scottsanderson 1f78a07d30 refactor tradesimulation client to not use StatefulTransform unnecessarily 2012-08-21 19:55:40 -04:00
fawce 1479adf519 fixed infinite looking loop in risk reporting, thanks to groupby 2012-08-21 19:26:46 +00:00
scottsandersonandEddie Hebert 7ce3667bc2 hard coded one-day warmup 2012-08-14 17:03:49 -04:00
fawce 19f00e867b indentation bug 2012-08-12 00:53:23 -04:00
fawce 500e6a9f24 fixed #563 2012-08-12 00:48:00 -04:00
fawce 196c681d4b fixes for max drawdown 2012-08-09 21:43:26 -04:00
fawce cf6bef6ed8 purging 2012-08-08 22:58:54 -04:00
scottsanderson 74859751ff whitespace 2012-08-07 18:25:22 -04:00
scottsanderson 23a62a942a Merge branch 'new_world_order' of github.com:quantopian/zipline into new_world_order
Conflicts:
	tests/test_transforms.py
	zipline/finance/returns.py
2012-08-07 17:08:08 -04:00
scottsanderson 1d9da39fbb new-style returns 2012-08-07 16:54:55 -04:00
fawce aeb50da170 fixes for unit tests, back to 50/51 passing. 2012-08-07 14:42:43 -04:00
scottsanderson ed206de84a abstract eventwindow and trading calendar utility 2012-08-07 10:32:10 -04:00
scottsanderson 8437a28c14 generator-style perf now sends a risk report on receipt of DONE 2012-08-03 21:09:05 -04:00
scottsanderson ace5d05fab tradesim as generator v. 2.0 2012-08-03 14:07:05 -04:00
scottsanderson 56177a7c4f end to end zipline with pure generators 2012-08-02 00:49:48 -04:00
scottsanderson 14067d8323 commit for fawce 2012-08-01 21:42:55 -04:00
scottsanderson 4768bea646 more progress on tsc 2012-08-01 18:53:09 -04:00
fawce 6de01a1c6e added support for any component to relay exceptions through monitor. 2012-08-01 14:56:17 -04:00