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
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.
Revert e99ab2e9d07573e24e6d106877ff35eab46cdab1, which was intended to
strip comments from lines fed to pip, but had the unintended side
effect of stripping egg specifiers in URLs. The easiest way to address
this is to simply not put trailing comments in requirements files, so
we'er going to solve the problem that way instead.
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.
Removes:
- Reference to ZeroMQ, since the project no longer uses it.
- Reference to requirements_sci.txt, since it has now been collapsed
into requirements.txt
Changes our filter so that instead of just checking for the current
day, we ensure that orders are before or on the current event time.
This adds a delay, (defaulting to one minute), to the order so that we
avoid filling an order exactly when it is placed.
So that we don't replace the orders variable with the list comp.
No functional change, but easier to compare the original and the
results of the list comp when debugging.
Expiration is something that way may want to have in the future,
but this current is implementation is dropping orders that
aren't meant to be expired. So removing expiration, so that all
expected orders are executed.
The .day member of datetime only gives the number of the day of the
year, which is insufficient when checking for < than.
However in this use, we may just want to check for an 'not equals'