Commit Graph

9 Commits

Author SHA1 Message Date
Eddie Hebert 351d5e8686 MAINT: Updates copyright to current year for returns module. 2013-03-19 17:14:01 -04:00
Eddie Hebert d17fb1c266 STY: Removes unused import. 2013-03-19 17:13:44 -04:00
fawce 890762bde7 MAINT: added typed errors module
- added exceptions in place of asserts for expected fields for rolling
transforms.
- removed assertions with Messages in favor of typed exceptions.
2013-03-19 11:39:23 -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
Tim 593aaa9880 Remove extra space in comment sentence. 2013-02-16 17:29:36 +00:00
Eddie Hebert f54881cd08 Changes tests from using an ndict for trades to an Event object.
When run over large amounts of data the use of ndict's gets and sets
become a large bottleneck, around 1/5th of the CPU time is spent
in ndict's __setattr__, __getattr__, etc.

By switching to an object for an event,
we reduce the penalty significantly.

Removes asserts that check for event being an ndict, as well as those
that assume a certain behavior of the __contains__ method for events.
2012-12-21 14:31:40 -05:00
Eddie Hebert ab6b754922 Changes EventWindow parameter of days to window length.
The days parameter was causing confusion when explaining the
usage of the batch_transform decorator.
2012-11-20 11:52:27 -05:00
Eddie Hebert e77cce1dc2 Removes extra getter method for getting returns member. 2012-10-23 13:29:42 -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