Commit Graph

2399 Commits

Author SHA1 Message Date
Thomas Wiecki 37032eee62 DOC Initial setup of mkdocs. 2015-02-13 13:36:38 +01:00
Scott Sanderson 357f1a88a4 BUG: Remove Pokemon exception handling.
This was masking real errors that were occurring during registration of
cell magic.
2015-02-13 10:11:27 +01:00
Eddie Hebert 7059ba1e6a PERF: Avoid using attribute access in inner event processing.
Reduce overhead of the attribute access of grabbing the process_event
and process_trade from both the algorithm object and the perf_tracekr or
blotter, by assigning those functions to a variable once per snapshot.
2015-02-12 16:14:09 -05:00
Thomas Wiecki 439f404bed MAINT Increase default volume from 1000 to 1e9
For more discussion see https://github.com/quantopian/zipline/pull/485.

Basically, 1000 is just a number that was supposed to be high enough if no volume was available. It turns out that number is actually very low so now we are increasing it so that volume restrictions should no matter. 1e9 of shares ought to be enough for anybody ;).

Thanks to @jlowin for pointing that out.
2015-02-12 16:42:52 +01:00
Thomas Wiecki 3f5fd447d0 DOC Add new options for order_percent to release-notes. 2015-02-12 14:19:52 +01:00
Jeremiah Lowin dd37a49f2f ENH Allow order_percent to work with various market values
Currently, `order_percent()` and `order_target_percent()` both operate as a percentage of `self.portfolio.portfolio_value`. This PR lets them operate as percentages of other important MVs.

(also adds `context.get_market_value()`, which enables this functionality)

For example:
```python
order_percent('AAPL', 0.5)

order_percent('AAPL', 0.5, percent_of='cash')

order_target_percent('MSFT', 0.1, percent_of='shorts')

tech_stocks = ('AAPL', 'MSFT', 'GOOGL')
tech_filter = lambda p: p.sid in tech_stocks
for stock in tech_stocks:
    order_target_percent(stock, 1/3, percent_of_fn=tech_filter)
```
2015-02-12 14:15:20 +01:00
Dale Jung 38e8d5214d PERF: History Perf Enhancements
Limited use of `pandas` data structures in both `HistoryContainer` and
`RollingPanel`. Where possible, methods were amended to return raw
`ndarrays` with the indexing logic done separately. This allows us to
cut down the number of times pandas objects are created both as returns
and intermediate values. The separation of indexing from data access
allowed us to minimize the times we’d make use of pandas indexes.

This required that that certain methods like `NDFrame.ffill` be replaced
with versions that work with `ndarrays`. Some of this was done via
straight numpy methods and others by access pandas internal
machinery. Outside of allowing us to use faster ndarrays, many of these
function provided speedups over their pandas counterparts as we didn’t
require the extra features like handling multiple dtypes. i.e. np.isnan
is faster than pd.isnull, but only works with certain dtypes.
2015-02-11 06:25:53 -05:00
Dale Jung 33cef17396 PERF: make next_window_start faster 2015-02-10 16:34:32 -05:00
Thomas Wiecki a7188187e6 DEV Add preemptive check that benchmark return exists. 2015-02-10 14:54:52 +01:00
Thomas Wiecki 999f21e5ae BLD Add new scrutinize code quality badge. 2015-02-10 10:18:56 +01:00
fawce 20c520d337 Merge pull request #492 from quantopian/dnt_list2
MAINT: added cutpoint for overriding SecurityList implementation.
2015-02-09 13:33:25 -05:00
fawce 233bf3080d security list type is a class level property now 2015-02-09 13:32:01 -05:00
fawce 67da7ca7a3 import statement cleanup 2015-02-09 12:54:50 -05:00
fawce e3b21835f3 name changed to protect the innocent 2015-02-09 12:27:30 -05:00
fawce 1c2560a1fa added cutpoint for overriding SecurityList implementation. 2015-02-09 12:23:46 -05:00
fawce ffe5a7a171 Merge pull request #478 from quantopian/dnt_list
ENH: no order guard, security lists
2015-02-05 15:15:34 -05:00
fawce 412baa3c3f fixed catastrophic bug in load_from_directory
and added a new test case
was not iterating over lookup date directory names, and
therefore mising all by one list of stocks.
discovered because of differing sort orders between
my local machine, other devs, and travis ci.
2015-02-05 13:57:41 -05:00
fawce 08a0d1b604 python 3.3 compatible iterators 2015-02-05 13:57:40 -05:00
fawce 2f7983fa35 adding data files to the egg for pip distribution. 2015-02-05 13:57:40 -05:00
fawce 1ab082102a first edition of leveraged etf list 2015-02-05 13:57:28 -05:00
fawce 536ace94b8 new security list class
and tests
2015-02-05 13:57:27 -05:00
fawce 909b412e9b modified do not order guard to take an iteratble or a container
container allows for dynamic restrictions, necessary for a
point in time implementation of the restricted list.
2015-02-05 13:56:46 -05:00
fawce 52f78fcbc7 restricted list trading control added. 2015-02-05 13:56:45 -05:00
Eddie Hebert 4255016747 PERF: Add a wrapper around Series to speed up perf tracker bottleneck.
Alleviates bottleneck caused re-indexing into a pd.Series during a tight
loop, by keeping track of the index value into the underlying `.values`
in a lookup table.

Based on suggestion from @dalejung
2015-02-03 12:57:32 -05:00
Thomas Wiecki c734f23102 BUG: kwargs.pop() requires default argument. 2015-02-03 12:20:45 +01:00
Thomas Wiecki 9bdc2c8734 BUG: Support algo_filename being None. Fixes #480. 2015-02-03 11:36:00 +01:00
Thomas Wiecki 65c038d0da Revert "MAINT Update pandas to 0.15.2."
This reverts commit b121759c68.
2015-01-28 10:39:41 +01:00
fawce 575abf747f Merge pull request #471 from quantopian/add_risk_to_datapanel
ENH: risk measures in datapanel
2015-01-27 13:13:31 -05:00
fawce 9ccb2c571f added cumulative risk measures to the
datapanel produced from perf frames.
2015-01-22 22:31:40 -05:00
Thomas Wiecki a5eefc7f8c TST: Add nose-timer to travis. 2015-01-21 18:25:14 +01:00
Thomas Wiecki b121759c68 MAINT Update pandas to 0.15.2. 2015-01-18 00:11:40 +01:00
fawce ec055b62bc Merge pull request #464 from quantopian/expand_perf_packet
adding net leverage, long/short exposure, long/short position count
2015-01-08 17:33:22 -05:00
fawce 893e8bec09 added notes for new perf fields. 2015-01-08 13:31:48 -05:00
fawce 6c3e1e1ba4 added tests for performance pack fields 2015-01-07 21:47:13 -05:00
fawce 7ed5461f8f de-linting 2015-01-07 21:47:01 -05:00
fawce 7668858c17 adding net leverage, long/short exposure, long/short position count
to performance packets.
2015-01-06 22:33:28 -05:00
Thomas Wiecki 6a41faf474 MAINT: Make beta calculation robust to missing values.
Risk calculations are robust to nans, except for
beta which calls numpy with the complete list of
algorithm_returns. If nans are present the result
of covar will be nan.

This is fixed by filtering out nans in
algorithm_returns.
2015-01-02 16:00:37 +01:00
Jeremiah Lowin 82c94b1dc4 DOC: Fix typo in midnight 2015-01-01 13:54:04 +01:00
Thomas Wiecki f474ee7eed BUG: Various functions were missing from the API. 2014-12-31 09:43:35 +01:00
John Ricklefs 994f7ceee5 BUG: 'inf' is in Numpy, not Pandas. 2014-12-29 21:23:34 -05:00
John Ricklefs 96cbec3f54 BUG: Fix division-by-zero error if net_liquidation was 0.
Converted _net_liquidation_value to a property to
streamline it a bit, too.
2014-12-29 14:52:31 -05:00
llllllllll 38e4d10c65 BUG: Fixes a bug that caused NDaysBeforeLastTradingDayOfMonth to not
fire on the last day of december.
2014-12-26 18:20:30 -05:00
Jonathan Kamens a3d7483488 MAINT: Upgrade to requests 2.5.1 2014-12-26 10:02:28 -05:00
Thomas Wiecki d0eba3d1ca DOC: Fix typo in TradingAlgorithm doc string. 2014-12-26 13:13:53 +01:00
Thomas Wiecki 8f3671bf24 DOC: Fix typo in TradingAlgorithm doc string. 2014-12-26 13:12:52 +01:00
fawce e1ce6ff34e Merge pull request #452 from quantopian/leverage
ENH: Adding Leverage to performance tracking
2014-12-24 11:20:04 -05:00
Nicholas Pezolano afd95b72e1 CAL: Add world cup closing day to bmf calendar. Closes #390. 2014-12-24 09:16:21 +01:00
fawce 3d4d3d0c2b adding gross leverage to the perf packet. 2014-12-19 11:31:59 -05:00
Thomas Wiecki 71effa5e98 MAINT: Replace old ema_talib example with new one. 2014-12-19 14:04:27 +01:00
Mete Atamel 9d8bb3dfa9 DEV: Add quantopian_dual_ema_talib.py
This file is identical to dual_ema_talib.py but it's in Quantopian syntax for easy copy/paste to Quantopian.
2014-12-19 14:04:27 +01:00