Commit Graph
809 Commits
Author SHA1 Message Date
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
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 b1ed4c6d8c Removes unused sum_true method. 2012-10-16 21:48:38 -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 16aa63ac6e Changes import to use tuple-like syntax. 2012-10-15 23:32:55 -04:00
Eddie Hebert 0608d53b16 Changes import of ndict in optimize to avoid threading through protocol. 2012-10-15 23:29:47 -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 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 b23ca3f442 Removes unused gens.merge module. 2012-10-15 15:11:11 -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 78bc364c45 Imports submodules of zipline on import of top-level module. 2012-10-12 17:03:34 -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
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 e11b35f149 added messages file... 2012-10-10 16:10:30 -04:00
fawceandEddie Hebert 96fed05fc0 support for test fixes in qexec 2012-10-10 16:09:40 -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