Thomas Wiecki and Eddie 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
0608d53b16
Changes import of ndict in optimize to avoid threading through protocol.
2012-10-15 23:29:47 -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
Eddie Hebert
891a283c39
Whitespace tweaking. PEP-8 conventions.
2012-10-03 11:53:36 -04:00
Thomas Wiecki
39c3cf88ce
Added profiling shell script.
2012-09-25 16:54:42 -04:00
Thomas Wiecki
e353900010
Added 2 year data file.
2012-09-25 16:53:57 -04:00
Thomas Wiecki
e09695819e
Cleaned up example.py code.
2012-09-25 16:10:50 -04:00
Thomas Wiecki
53de4effd3
stdout_capture was causing problems for ipython notebook.
2012-09-25 14:53:13 -04:00
Thomas Wiecki
4324f95f36
Better unittest coverage. DataFrameSource is now filtering sids. Fixed outstanding issues.
2012-09-21 11:59:46 -04:00
Thomas Wiecki
3be2f313cd
Shortened test window. Renamed functions in window transform.
2012-09-19 18:39:42 -04:00
Thomas Wiecki
2fe37fa34c
Fixed pandas depracation.
2012-09-19 18:02:09 -04:00
Thomas Wiecki
729a4d9058
Large refactoring and documentation of new algorithm base class and batch transform.
2012-09-19 17:49:39 -04:00
Thomas Wiecki
7242a4ee86
BUG: asserting for correct index type.
2012-09-18 13:56:58 -04:00
Thomas Wiecki
280f122353
WIP: Lot of refactoring and bugfixing.
2012-09-17 18:35:21 -04:00
Thomas Wiecki
5d00099243
example code now retrieves data from yahoo finance.
2012-09-17 12:15:36 -04:00
fawce
57a1834c5a
refactored so that slippage is implemented as pluggable classes.
2012-09-13 21:22:01 -04:00
Thomas Wiecki
5fcaed3644
Added logging statements.
2012-08-29 09:02:48 -04:00
Thomas Wiecki
3f801ef387
Debugging.
2012-08-23 17:38:48 -04:00
Thomas Wiecki
0b589ee39c
Fixes to the updown algorithm. First unittest passes.
2012-08-23 16:06:56 -04:00
Thomas Wiecki
7491e1f88e
Resolved internal conflict due to stashing.
2012-08-23 16:06:50 -04:00
Thomas Wiecki
ace0b25d31
Dummy.
2012-08-23 14:32:22 -04:00
Thomas Wiecki
7c0329bb76
Resolved conflicts
2012-08-23 10:54:02 -04:00
Thomas Wiecki
3884b15eb6
ENH: Changed algorithm class to provide .run() method. Testing of multiple param combos of DMA.
2012-08-12 20:24:34 -04:00
Thomas Wiecki
51f01c0f1f
ENH: Implemented new Zipline interface. Implemented Algorithm base class. Implemented example algorithm. Implemented example.py code.
2012-08-10 17:23:08 -04:00
Thomas Wiecki
1576447c76
Refactored optimize factory. Enabled optimize unittests.
2012-08-10 11:08:11 -04:00
Thomas Wiecki
6f7090ebf3
Merge pull request #69 from quantopian/prof_yappi
...
Prof yappi
2012-07-20 05:49:23 -07:00
Stephen Diehl
e5fdc542d5
Update test_optimize with devel flag.
2012-07-06 12:06:58 -04:00
fawce
5f878300a0
switched from pub/sub to push/pull for merge -> client socket. also purged source_id from the constructors of all datasources.
2012-07-03 12:11:22 -04:00
Thomas Wiecki
152e389c71
Moved over files from dt_to_pandas: prof_yappi.py and optimize/factory.py (critical change is to change daily to minute events).
2012-06-29 09:51:17 -04:00
Thomas Wiecki
da827c18b4
Fixed unittest bug (not copying config dict). Further refactoring of optimization tests and factory. Added documentation to optimization factory functions.
2012-05-30 10:15:35 -04:00
Thomas Wiecki
45409132b2
Refactored unittests. zipline creation is now happening in a function in factory.py instead of each unittest.
2012-05-29 14:37:43 -04:00
Thomas Wiecki
1c91c7287b
Moved cycle import out of function.
2012-05-28 12:02:11 -04:00
Thomas Wiecki
6523ff6c9b
Re-enabled optimize unittests. Minor fixes to create_predictable_zipline().
2012-05-28 11:11:29 -04:00
fawce
789338aa5f
fixed constructor call to provide source_id
2012-05-24 11:36:22 -04:00
fawce
93cc4bc172
fixed imports in optimize factory and tests. also added skip annotations, because jenkins will never run them successfully.
2012-05-16 12:17:13 -04:00
Thomas Wiecki
58bdad05b9
Minor fixes to adhere to refactored structure. Updated docs to be in line with rest. Skip optimization test by default as it takes a very long time.
2012-05-15 18:02:58 -04:00
Thomas Wiecki
e26638058c
Reverted path independence code in factory.py. Not sure how to fix with new path structure.
2012-05-15 17:37:27 -04:00
Thomas Wiecki
809841d690
Fixed get_id() bug per Stephen's suggestion. Changed handle_data() back to handle_frame().
2012-05-15 17:28:59 -04:00
Thomas Wiecki
f1ce833995
Moved over files from optimize and incorporated into new infrastructure. Temporarily fixed control_out bug. get_id() bug remains however.
2012-05-14 18:02:40 -04:00
Stephen Diehl
ca60d3f8e0
Refactor component tree.
2012-05-14 09:14:26 -04:00