Commit Graph

125 Commits

Author SHA1 Message Date
fawce f3cfc9623d ENH: new order management methods:
- get_open_orders
- get_order
- cancel
2013-04-26 19:46:00 -04:00
Eddie Hebert 89ea97ec52 MAINT: Use a distinct object for minute/day data instead of ndict.
Continue removing ndict usage, instead use a BarData object.
2013-04-26 15:26:01 -04:00
Eddie Hebert 9099d301f3 ENH: Stream benchmark returns as events.
Instead of creating a list of benchmarks in the risk module,
stream benchmarks through the system as events, starting from the
algorithm generator.

Works towards more easily setting arbritrary pricing data as
a a benchmark, as well as working towards live minutely benchmarks.
2013-04-15 11:43:13 -04:00
Richard Frank 2dbafd5162 BUG: Zero out the microsecond attribute of datetimes
wherever we zero out the second attribute.  Otherwise, we can be
off by some microseconds from midnight, etc.
2013-04-15 10:44: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 dba86153d2 ENH: added a CUSTOM datasource type for custom data.
- perf modified to let non-performance related events flow through.
- changes to support streaming non-trading data through batch transforms
and for mixing in sids with just custom data.
- allowing CUSTOM events to flow through to transforms.
- Added logic to maintain pre-specified sid filter.
2013-03-19 11:39:23 -04:00
Richard Frank ebdb5429aa MAINT: Moved DailyReturn to protocol module to break circular references
and removed code that solved that same problem with conditional imports.
2013-03-01 16:05:39 -05:00
Eddie Hebert 88070a0f12 Fixes dictionary-style lookup on Position and Portfolio.
Typo on method name, /__getattr__/__getitem__
2013-01-27 22:49:20 -05:00
Eddie Hebert 2352c1e576 Adds dictionary style access to Portfolio object. 2013-01-27 21:21:01 -05:00
Eddie Hebert 480ca65f56 Adds dictionary style access to Position object. 2013-01-27 21:19:59 -05:00
Eddie Hebert a49bd4af4b Adds a contains method to SIDData to support in statement. 2013-01-23 17:17:35 -05:00
Eddie Hebert 87f99331e8 Uses an object for sid data to be passed to handle data.
Moving another datatype off of ndict, to make it easier to inspect
objects in memory when debugging.
2013-01-23 13:41:57 -05:00
Eddie Hebert a3235bb1a5 Recycles objects for positions.
Instead of creating a new ndict for each position on every event,
we change the values in the object that held the previous position.

The creation of new objects on each event was incurring too much
overhead.

Changes the position type returned by performance module.

For improved speed, changes from ndict to a simple Python object,
since the cost of setting ndict values is too expensive for the
number of times that positions are returned.

Also, changes the containing type of the positions to be dictionary
with the __missing__ overloaded, instead of the ndict that had that
behavior, to reduce the penalty of using ndicts.
2013-01-16 10:30:38 -05:00
Eddie Hebert 48dba943db Uses a Portfolio object instead of an ndict.
Gains some performance by using a 'regular' object instead of
an ndict.

Also, directly sets up the values that we return, instead of going in
between with __core_dict and then removing values.

In it's entirety performanc.as_portfolio is the current
highest bottleneck, working on reducing time spent in that function.
2013-01-16 10:30:38 -05:00
Eddie Hebert 799a357d98 Changes test factory to use Event instead of ndict.
As more sources are moving off of ndict,
changing the factory to use Event, so that when testing we are
exercising use of Event.
2013-01-06 17:13:07 -05:00
Eddie Hebert d1784b26c3 Adds an init to protocol.Event to enable setting of initial values.
So that an Event can use an initial dict to set all values,
instead of needing to set initial values one by one.

i.e. enables:

```
foo = Event({'bar': 1, 'baz': 2})
```

in favor of:

```
foo = Event()
foo.bar = 1
foo.baz = 2
```
2013-01-02 14:58:12 -05:00
Eddie Hebert 8f6ff20e6a Adds a __repr__ method for Event. 2012-12-21 17:07:56 -05: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 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 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 9500163ed8 Adds Apache 2.0 license header to source files. 2012-10-08 17:32:41 -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 57a1834c5a refactored so that slippage is implemented as pluggable classes. 2012-09-13 21:22:01 -04:00
fawce 81718011df cut most of protocol, cut most of log_utils. 2012-09-08 23:20:38 -04:00
fawce 7f41a9435e new tests and support for logging primitives (bugfix) 2012-08-14 22:46:58 -04:00
scottsanderson b5054293da change protocol to match new datasources 2012-08-14 12:24:57 -04:00
scottsanderson 4bfbaa8c26 minor protocol change 2012-08-10 01:18:55 -04:00
scottsanderson 7bb4e754b0 added logs 2012-08-09 16:21:49 -04:00
fawce aec76868f9 exception handling 2012-08-08 21:40:33 -04:00
fawce 35e0433a6e added LOG as valid prefix. 2012-08-08 00:46:19 -04:00
fawce aeb50da170 fixes for unit tests, back to 50/51 passing. 2012-08-07 14:42:43 -04:00
fawce 08cce15ef9 added name and message to exception message 2012-07-31 16:02:28 -04:00
fawce 3e577c56c5 really really really think this should build on jenkins 2012-07-30 18:43:10 -04:00
fawce f1f2fadf81 patched regex to work on jenkins 2012-07-30 18:23:17 -04:00
fawce 7d4bfb023e keying the shorted stack trace path on zipline, rather than zipline_repo 2012-07-30 18:02:12 -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 c72f18f77f Merge branch 'byebye_threadsim' of github.com:quantopian/zipline into byebye_threadsim 2012-07-27 17:15:05 -04:00
fawce f79a2fadfc cancellation tweaks. 2012-07-27 17:06:45 -04:00
scottsanderson f0cb4eaaed movingaverage implemented as transform 2012-07-27 17:06:07 -04:00
scottsanderson 4ff943eb34 added generator-style transforms 2012-07-27 15:04:41 -04:00
fawce aea81e530e minor fix 2012-07-26 19:56:48 -04:00
scottsanderson 8674b46892 Merge branch 'byebye_threadsim' of github.com:quantopian/zipline into byebye_threadsim 2012-07-26 18:49:38 -04:00
scottsanderson 97e4ba050a generator ds and feed, various generator utils 2012-07-26 18:48:51 -04:00
fawce 40980f7de8 added time to exception report 2012-07-26 18:45:54 -04:00
scottsanderson 96d32fbc86 mongo datasource as generator 2012-07-25 20:01:00 -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 fb2b0c3be5 responses to sdiehl code review 2012-07-18 17:20:31 -04:00
fawce 6415f59398 changing protocol remove e/p dictionary 2012-07-17 17:43:02 -04:00
fawce 1262dcdef1 logging converted to share socket with performance 2012-07-17 11:04:32 -04:00
fawce cd998d622c fixed logging bugs, added a DONE signal for logging. 2012-07-17 11:04:32 -04:00