Commit Graph

35 Commits

Author SHA1 Message Date
Jonathan Kamens 16e75a31d4 TST: Fix check() test utility function to detect all list differences
The check() function in zipline.utils.test_utils was only comparing
lists up to the length of the shortest list. This fix uses
izip_longest instead of izip so it compares up to the length of the
longest list, which among other things means that it will now
correctly report when one list is empty and the other is not.
2013-04-30 21:13:18 -04:00
fawce 9062b9636a MAINT: refactoring for orders api
- moved Order and Blotter to zipline.finance.blotter
- moved order method from AlgoSimulator to Blotter
- eliminated the set_order method in algorithm
- moved blotter to the algorithm
2013-04-26 19:45:59 -04:00
Richard Frank e8f6b43f2b TST: When comparing dicts, ensure they have the same keys.
dict 'b' might have more keys.
2013-04-15 16:57:44 -04:00
Eddie Hebert 35f57ada3e ENH: Send transactions and orders as standalone events.
- Add transaction and order types
- Move TransactionSimulator from trading.py to tradesimulation.py
  (only used by other members of the tradesimulation module)
- Make Transaction an independent event, like dividend
- Add Blotter class.
- Flatten the transaction events to be independent of trade bar events
- Make orders into events that reach performance (need to add
handling)
- Issue IDs to orders and tracking each transaction's order id.
- Make volume share slippage fill orders independently, rather than
  aggregating them into a single transaction.
- Perf tracker holds orders, serializes them with transactions.
- Order state defined and maintained by order class.
- Minutely emission of orders based on last_modified date.
2013-04-14 18:59:57 -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
Richard Frank f4be285dd7 Removed quarter utilities unused by zipline 2012-11-20 13:46:48 -05: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 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
fawce c45c44b5c8 fixes per code review 2012-09-12 13:29:05 -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 d90c531679 Removes core.monitor module.
The Monitor class that it provided was an artifact of a version
that depended on ZeroMQ as a communication layer instead of the
current generator bassed model.

Also, removes tests that were exercising the Monitor.
2012-09-05 15:24:30 -04:00
Eddie Hebert 72e64776b9 Applies PEP-8 recommendations to test_utils.
Whitespace wrangling.
2012-08-25 04:10:38 -04:00
Jonathan Kamens ad980e6485 Close test log handler at end of test to fix file descriptor leak 2012-08-21 22:29:51 -04:00
Jonathan Kamens 88e0afc7a0 Require zipline tests to end with a DONE packet 2012-08-21 16:16:34 -04:00
fawce c911dca4d2 added a kwarg to run in blocking 2012-08-16 13:01:22 -04:00
fawce 7f41a9435e new tests and support for logging primitives (bugfix) 2012-08-14 22:46:58 -04:00
fawce 7e86652a75 removed bson dep 2012-08-08 22:33:32 -04:00
fawce 9f98178a47 Merge branch 'new_world_order' of github.com:quantopian/zipline into new_world_order 2012-08-08 21:40:41 -04:00
fawce aec76868f9 exception handling 2012-08-08 21:40:33 -04:00
scottsanderson c64175e2e5 added tests for exception messages in datasources and transforms 2012-08-08 18:44:45 -04:00
fawce 427cfd53ec working on logging 2012-08-08 14:00:36 -04:00
fawce d2d9ef1359 removed a few debug calls 2012-08-07 17:55:27 -04:00
fawce e8f17083f7 merge 2012-08-07 17:49:56 -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 dd1056bf30 generator backed component, and a starter test for a source. 2012-08-01 23:41:44 -04:00
fawce 318065125f refactored component to use a generator 2012-08-01 21:43:15 -04:00
fawce 9deaefe6e6 fixes for tests 2012-07-30 13:52:38 -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 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 d950973f0d added a proc join to ensure we block on the simulation fully exiting all processes. 2012-07-24 17:43:49 -04:00
fawce ad10f2aa85 fixed up tests to abandon thread simulator. 2012-07-24 16:43:02 -04:00