Commit Graph

39 Commits

Author SHA1 Message Date
Eddie Hebert 58af62f18d REL: Update copyright on all files touched since end of 2012.
s/Copyright 2012/Copyright 2013/
2013-04-05 14:28:15 -04:00
fawce 2c7355a0dc Refactoring of TradingEnvironment to isolate the global state: index symbol and exchange timezone. Parameters that define the simulation (start, end, and capital base) were put in a new class, SimulationParameters.
Global state for the financial simulation environment is accessed through the
zipline.finance.trading module, which now contains a module variable:
environment.

Parameters are passed into an algorithm as a keyword argument, sim_params.
SimulationParameters creates a trading day index for the test period that
can be used to find trading days, calculate distance between trading days,
and other common operations. The sim params index is just selected from the
global state.

================

Details:

    - adding delorean to the requirements.
    - made index symbol a parameter for loading the benchmark data. changed
    messagepack storage to be symbol specific.
    - ported risk, performance, algorithm, transforms, batch transforms
    and associated tests to use simulation parameters and global environment
    - factory and sim factory use global state and sim params
    - factory method parameter names now reflect the class expected
2013-02-18 10:24:32 -05:00
Tobias Brandt cf4d7ca353 Fixed unittest2 import error on Python 2.7
Changed all unittest2 imports to unittest
2012-11-12 10:49:14 -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
Eddie Hebert 657f93165d Removes unused test class member and corresponding import.
Leased sockets is from an older architecture.
2012-10-25 07:17:35 -04: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 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
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
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 1caefbff43 tests are passing for independent commission model 2012-09-28 23:12:41 -04:00
fawce 57a1834c5a refactored so that slippage is implemented as pluggable classes. 2012-09-13 21:22:01 -04:00
fawce c45c44b5c8 fixes per code review 2012-09-12 13:29:05 -04:00
fawce 50de0f5e39 support of qexec refactoring 2012-09-12 00:30:37 -04:00
fawce 1f55e8a033 added exception handling tests back. updates to support integration. 2012-09-10 23:06:13 -04:00
fawce b046518c45 tests passing with new lines.py. Still some zmq references left. 2012-09-08 22:44:22 -04:00
Eddie Hebert 61ef8f4341 Removes unused imports. 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 57f1c6056c unit test for heartbeating 2012-08-20 18:24:17 -04:00
scottsanderson 69ac68af2e heartbeating for handle_data 2012-08-19 02:22:16 -04:00
fawce e5b7c69a68 simplified to be more flexible 2012-08-08 21:48:16 -04:00
scottsanderson c64175e2e5 added tests for exception messages in datasources and transforms 2012-08-08 18:44:45 -04:00
fawce 0267bc5073 removed traces 2012-08-08 15:32:54 -04:00
scottsanderson 0d34de3b46 fix tracebacks 2012-08-08 15:23:20 -04:00
scottsanderson d2809946bf updated exception test tracebacks 2012-08-08 09:20:35 -04:00
fawce aeb50da170 fixes for unit tests, back to 50/51 passing. 2012-08-07 14:42:43 -04:00
fawce 804bcb4e0c exceptions tests passing 2012-08-07 13:16:42 -04:00
fawce 3f4d772e4c first draft of lines returning new SimulatedTrading object. 2012-08-07 11:15:14 -04:00
fawce 6de01a1c6e added support for any component to relay exceptions through monitor. 2012-08-01 14:56:17 -04:00
fawce 08cce15ef9 added name and message to exception message 2012-07-31 16:02:28 -04:00
fawce 9deaefe6e6 fixes for tests 2012-07-30 13:52:38 -04:00
fawce 0cb7618b98 exception paths are now relative to zipline_repo. if the path is outside of zipline_repo, it is truncated to just the filename. 2012-07-29 20:30:10 -04:00
fawce 80f2acc674 test fixes 2012-07-27 23:33:43 -04:00
fawce 83da8d2310 fixed logging for tests 2012-07-26 18:45:42 -04:00
fawce abf9c8efa5 exception handling code revised. gevent, pypy, and threadsim vestiges removed.
devel flag removed.
2012-07-26 16:22:13 -04:00
fawce dd8c84b0db added stack trace to exception message, wrapped it in BT UPDATE FRAME 2012-07-25 14:40:14 -04:00
fawce 52b597f089 intersticial commit for scott to pick 2012-07-25 12:28:21 -04:00
fawce c02d15016a added timeouts for component when waiting to hear from the monitor. proof of concept exception relay for algorithm's initialize method. 2012-07-24 23:43:40 -04:00
fawce ad10f2aa85 fixed up tests to abandon thread simulator. 2012-07-24 16:43:02 -04:00