Files
catalyst/releases.html
T
Victor Grau Serrat 054c1b83db DOC: Catalyst Install
2017-10-19 23:34:26 -06:00

1886 lines
136 KiB
HTML

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Release Notes &mdash; Catalyst 0.3 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="Catalyst 0.3 documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Catalyst
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="install.html">Install</a><ul>
<li class="toctree-l2"><a class="reference internal" href="install.html#installing-with-pip">Installing with <code class="docutils literal"><span class="pre">pip</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="install.html#gnu-linux">GNU/Linux</a></li>
<li class="toctree-l3"><a class="reference internal" href="install.html#osx">OSX</a><ul>
<li class="toctree-l4"><a class="reference internal" href="install.html#osx-virtualenv-matplotlib">OSX + virtualenv + matplotlib</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="install.html#windows">Windows</a></li>
<li class="toctree-l3"><a class="reference internal" href="install.html#amazon-linux-ami">Amazon Linux AMI</a></li>
<li class="toctree-l3"><a class="reference internal" href="install.html#troubleshooting-pip-install">Troubleshooting <code class="docutils literal"><span class="pre">pip</span></code> Install</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="install.html#installing-with-conda">Installing with <code class="docutils literal"><span class="pre">conda</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="install.html#troubleshooting-conda-install">Troubleshooting <code class="docutils literal"><span class="pre">conda</span></code> Install</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="install.html#getting-help">Getting Help</a></li>
</ul>
</li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Catalyst</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Release Notes</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/releases.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="release-notes">
<h1>Release Notes<a class="headerlink" href="#release-notes" title="Permalink to this headline"></a></h1>
<div class="section" id="development">
<h2>Development<a class="headerlink" href="#development" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">1.1.1</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">TBD</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This release is still under active development. All changes listed are
subject to change at any time.</p>
</div>
<div class="section" id="highlights">
<h3>Highlights<a class="headerlink" href="#highlights" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="enhancements">
<h3>Enhancements<a class="headerlink" href="#enhancements" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="experimental-features">
<h3>Experimental Features<a class="headerlink" href="#experimental-features" title="Permalink to this headline"></a></h3>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Experimental features are subject to change.</p>
</div>
<p>None</p>
</div>
<div class="section" id="bug-fixes">
<h3>Bug Fixes<a class="headerlink" href="#bug-fixes" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="performance">
<h3>Performance<a class="headerlink" href="#performance" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="maintenance-and-refactorings">
<h3>Maintenance and Refactorings<a class="headerlink" href="#maintenance-and-refactorings" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="build">
<h3>Build<a class="headerlink" href="#build" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="documentation">
<h3>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="miscellaneous">
<h3>Miscellaneous<a class="headerlink" href="#miscellaneous" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
</div>
<div class="section" id="release-1-1-0">
<h2>Release 1.1.0<a class="headerlink" href="#release-1-1-0" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">1.1.0</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">March 10, 2017</td>
</tr>
</tbody>
</table>
<p>This release is meant to provide zipline support for pandas 0.18, as well as several bug fixes, API changes, and many
performance changes.</p>
<div class="section" id="id1">
<h3>Enhancements<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Makes the minute bar read catch NoDataOnDate exceptions if dates are not in the calendar.
Before, the minute bar reader was forward filling, but now it returns nan for OHLC and 0 for V. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1488">#1488</a>)</li>
<li>Adds <code class="docutils literal"><span class="pre">truncate</span></code> method to <code class="xref py py-class docutils literal"><span class="pre">BcolzMinuteBarWriter</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1499">#1499</a>)</li>
<li>Bumps up to pandas 0.18.1 and numpy 1.11.1 (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1339">#1339</a>)</li>
<li>Adds an earnings estimates quarter loader for Pipeline (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1396">#1396</a>)</li>
<li>Creates a restricted list manager that takes in information about restricted sids
and stores in memory upon instantiation (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1487">#1487</a>)</li>
<li>Adds <code class="docutils literal"><span class="pre">last_available{session,</span> <span class="pre">minute}</span></code> args to <code class="docutils literal"><span class="pre">DataPortal</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1528">#1528</a>)</li>
<li>Adds <code class="docutils literal"><span class="pre">SpecificAssets</span></code> filter (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1530">#1530</a>)</li>
<li>Adds the ability for an algorithm to request the current contract for a future chain (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1529">#1529</a>)</li>
<li>Adds <code class="docutils literal"><span class="pre">chain</span></code> field to current and supporting methods
in <code class="xref py py-class docutils literal"><span class="pre">DataPortal</span></code> and <code class="xref py py-class docutils literal"><span class="pre">OrderedContracts</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1538">#1538</a>)</li>
<li>Adds history for continuous futures (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1539">#1539</a>)</li>
<li>Adds adjusted history for continuous future (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1548">#1548</a>)</li>
<li>Adds roll style which takes the volume of a future contract into account,
specifically for continuous futures (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1556">#1556</a>)</li>
<li>Adds better error message when calling Zipline API functions outside of a running simulation (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1593">#1593</a>)</li>
<li>Adds
<code class="xref py py-meth docutils literal"><span class="pre">MACDSignal()</span></code>,
<code class="xref py py-meth docutils literal"><span class="pre">MovingAverageConvergenceDivergenceSignal()</span></code>, and
<code class="xref py py-meth docutils literal"><span class="pre">AnnualizedVolatility()</span></code> as built-in factors.
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1588">#1588</a>)</li>
<li>Allows running pipelines with custom date chunks in <code class="docutils literal"><span class="pre">attach_pipeline</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1617">#1617</a>)</li>
<li>Adds <code class="docutils literal"><span class="pre">order_batch</span></code> to the trade blotter (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1596">#1596</a>)</li>
<li>Adds vectorized lookup_symbol (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1627">#1627</a>)</li>
<li>Solidifies equality comparisons for SlippageModel classes (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1657">#1657</a>)</li>
<li>Adds a factor for winsorized results (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1696">#1696</a>)</li>
</ul>
</div>
<div class="section" id="id2">
<h3>Bug Fixes<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Changes str to string_types to avoid errors when type checking unicode and not str type. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1315">#1315</a>)</li>
<li>Algorithms default to quantopian-quandl bundle when no data source is specified (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1479">#1479</a>) (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1374">#1374</a>)</li>
<li>Catches all missing data exceptions when computing dividend ratios (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1507">#1507</a>)</li>
<li>Creates adjustments based on ordered assets instead of a set. Before, adjustments were created for estimates
based on where assets happened to fall in a set rather than using ordered assets (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1547">#1547</a>)</li>
<li>Fixes blaze pipeline queries for when users query for the <code class="docutils literal"><span class="pre">asof_date</span></code> column (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1608">#1608</a>)</li>
<li>Datetimes should be converted in utc. DataFrames being returned were creating US/Eastern timestamps out of the ints,
potentially changing the date returned to be the date before (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1635">#1635</a>)</li>
<li>Fixes default inputs for <code class="xref py py-class docutils literal"><span class="pre">IchimokuKinkoHyo</span></code> factor (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1638">#1638</a>)</li>
</ul>
</div>
<div class="section" id="id3">
<h3>Performance<a class="headerlink" href="#id3" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Removes invocations of <code class="docutils literal"><span class="pre">get_calendar('NYSE')</span></code> which cuts down zipline import time
and makes the CLI more responsive and use less memory. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1471">#1471</a>)</li>
<li>Refcounts and releases pipeline terms when they are no longer needed (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1484">#1484</a>)</li>
<li>Saves up to 75% of calls to minute_to_session_label (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1492">#1492</a>)</li>
<li>Speeds up counting of number of minutes across contiguous session (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1497">#1497</a>)</li>
<li>Removes/defers calls to get_loc on large indices (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1504">#1504</a>) (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1503">#1503</a>)</li>
<li>Replaces <code class="docutils literal"><span class="pre">get_loc</span></code> calls in <code class="docutils literal"><span class="pre">calc_dividend_ratios</span></code> with <code class="docutils literal"><span class="pre">get_indexer</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1510">#1510</a>)</li>
<li>Speeds up minute to session sampling (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1549">#1549</a>)</li>
<li>Adds some micro optimizations in <code class="docutils literal"><span class="pre">data.current</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1561">#1561</a>)</li>
<li>Adds optimization for initial workspace for pipelines (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1521">#1521</a>)</li>
<li>More memory savings (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1599">#1599</a>)</li>
</ul>
</div>
<div class="section" id="id4">
<h3>Maintenance and Refactorings<a class="headerlink" href="#id4" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Updates leveraged ETF list (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/747">#747</a>) (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1434">#1434</a>)</li>
<li>Adds additional fields to <code class="docutils literal"><span class="pre">__getitem__</span></code> for Order class (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1483">#1483</a>)</li>
<li>Adds <code class="docutils literal"><span class="pre">BarReader</span></code> base class for minute and session readers (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1486">#1486</a>)</li>
<li>Removes <code class="docutils literal"><span class="pre">future_chain</span></code> API method, to be replaced by <code class="docutils literal"><span class="pre">data.current_chain</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1502">#1502</a>)</li>
<li>Puts zipline back on blaze master (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1505">#1505</a>)</li>
<li>Adds Tini and sets version range for numpy, pandas, and scipy in Dockerfile (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1514">#1514</a>)</li>
<li>Deprecates <code class="docutils literal"><span class="pre">set_do_not_order_list</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1487">#1487</a>)</li>
<li>Uses <code class="docutils literal"><span class="pre">Timedelta</span></code> instead of <code class="docutils literal"><span class="pre">DateOffset</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1487">#1487</a>)</li>
<li>Update and pin more dev requirements (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1642">#1642</a>)</li>
</ul>
</div>
<div class="section" id="id5">
<h3>Build<a class="headerlink" href="#id5" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Adds binary dependency on numpy for empyrical</li>
<li>Removes old numpy/pandas versions from Travis (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1339">#1339</a>)</li>
<li>Updates appveyor.yml for new numpy and pandas (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1339">#1339</a>)</li>
<li>Downgrades to scipy 0.17 (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1339">#1339</a>)</li>
<li>Bumps empyrical to 0.2.2</li>
</ul>
</div>
<div class="section" id="id6">
<h3>Documentation<a class="headerlink" href="#id6" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Updated example notebook for latest zipline cell magic</li>
<li>Adds ANACONDA_TOKEN directions (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1589">#1589</a>)</li>
</ul>
</div>
<div class="section" id="id7">
<h3>Miscellaneous<a class="headerlink" href="#id7" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Changed the short-opt for <code class="docutils literal"><span class="pre">--before</span></code> in the <code class="docutils literal"><span class="pre">zipline</span> <span class="pre">clean</span></code>
entrypoint. The new argument is <code class="docutils literal"><span class="pre">-e</span></code>. The old argument, <code class="docutils literal"><span class="pre">-b</span></code>, conflicted
with the <code class="docutils literal"><span class="pre">--bundle</span></code> short-opt (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1625">#1625</a>).</li>
</ul>
</div>
</div>
<div class="section" id="release-1-0-2">
<h2>Release 1.0.2<a class="headerlink" href="#release-1-0-2" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">1.0.2</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">September 8, 2016</td>
</tr>
</tbody>
</table>
<div class="section" id="id8">
<h3>Enhancements<a class="headerlink" href="#id8" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Adds forward fill checkpoint tables for the blaze core loader. This allow the
loader to more efficiently forward fill the data by capping the lower date it
must search for when querying data. The checkpoints should have novel deltas
applied (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1276">#1276</a>).</li>
<li>Updated VagrantFile to include all dev requirements and use a newer image
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1310">#1310</a>).</li>
<li>Allow correlations and regressions to be computed between two 2D factors by
doing computations asset-wise (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1307">#1307</a>).</li>
<li>Filters have been made window_safe by default. Now they can be passed in as
arguments to other Filters, Factors and Classifiers (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1338">#1338</a>).</li>
<li>Added an optional <code class="docutils literal"><span class="pre">groupby</span></code> parameter to
<code class="xref py py-meth docutils literal"><span class="pre">rank()</span></code>,
<code class="xref py py-meth docutils literal"><span class="pre">top()</span></code>, and
<code class="xref py py-meth docutils literal"><span class="pre">bottom()</span></code>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1349">#1349</a>).</li>
<li>Added new pipeline filters, <code class="xref py py-class docutils literal"><span class="pre">All</span></code> and
<code class="xref py py-class docutils literal"><span class="pre">Any</span></code>, which takes another filter and
returns True if an asset produced a True for any/all days in the previous
<code class="docutils literal"><span class="pre">window_length</span></code> days (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1358">#1358</a>).</li>
<li>Added new pipeline filter <code class="xref py py-class docutils literal"><span class="pre">AtLeastN</span></code>,
which takes another filter and an int N and returns True if an asset
produced a True on N or more days in the previous <code class="docutils literal"><span class="pre">window_length</span></code>
days (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1367">#1367</a>).</li>
<li>Use external library empyrical for risk calculations. Empyrical unifies risk
metric calculations between pyfolio and zipline. Empyrical adds custom
annualization options for returns of custom frequencies. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/855">#855</a>)</li>
<li>Add Aroon factor. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1258">#1258</a>)</li>
<li>Add fast stochastic oscillator factor. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1255">#1255</a>)</li>
<li>Add a Dockerfile. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1254">#1254</a>)</li>
<li>New trading calendar which supports sessions which span across midnights, e.g.
24 hour 6:01PM-6:00PM sessions for futures trading.
<cite>zipline.utils.tradingcalendar</cite> is now deprecated. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1138">#1138</a>) (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1312">#1312</a>)</li>
<li>Allow slicing a single column out of a Factor/Filter/Classifier. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1267">#1267</a>)</li>
<li>Provide Ichimoku Cloud factor (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1263">#1263</a>)</li>
<li>Allow default parameters on Pipeline terms. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1263">#1263</a>)</li>
<li>Provide rate of change percentage factor. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1324">#1324</a>)</li>
<li>Provide linear weighted moving average factor. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1325">#1325</a>)</li>
<li>Add <code class="docutils literal"><span class="pre">NotNullFilter</span></code>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1345">#1345</a>)</li>
<li>Allow capital changes to be defined by a target value. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1337">#1337</a>)</li>
<li>Add <code class="docutils literal"><span class="pre">TrueRange</span></code> factor. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1348">#1348</a>)</li>
<li>Add point in time lookups to <code class="docutils literal"><span class="pre">assets.db</span></code>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1361">#1361</a>)</li>
<li>Make <code class="docutils literal"><span class="pre">can_trade</span></code> aware of the asset&#8217;s exchange . (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1346">#1346</a>)</li>
<li>Add <code class="docutils literal"><span class="pre">downsample</span></code> method to all computable terms. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1394">#1394</a>)</li>
<li>Add <cite>QuantopianUSFuturesCalendar</cite>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1414">#1414</a>)</li>
<li>Enable publishing of old <code class="docutils literal"><span class="pre">assets.db</span></code> versions. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1430">#1430</a>)</li>
<li>Enable <code class="docutils literal"><span class="pre">schedule_function</span></code> for Futures trading calendar. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1442">#1442</a>)</li>
<li>Disallow regressions of length 1. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1466">#1466</a>)</li>
</ul>
</div>
<div class="section" id="experimental">
<h3>Experimental<a class="headerlink" href="#experimental" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Add support for comingled Future and Equity history windows, and enable other
Future data access via data portal. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1435">#1435</a>) (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1432">#1432</a>)</li>
</ul>
</div>
<div class="section" id="id9">
<h3>Bug Fixes<a class="headerlink" href="#id9" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Changes <code class="xref py py-class docutils literal"><span class="pre">AverageDollarVolume</span></code> built-in
factor to treat missing close or volume values as 0. Previously, NaNs were
simply discarded before averaging, giving the remaining values too much
weight (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1309">#1309</a>).</li>
<li>Remove risk-free rate from sharpe ratio calculation. The ratio is now the
average of risk adjusted returns over violatility of adjusted
returns. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/853">#853</a>)</li>
<li>Sortino ratio will return calculation instead of np.nan when required returns
are equal to zero. The ratio now returns the average of risk adjusted returns
over downside risk. Fixed mislabeled API by converting <cite>mar</cite> to
<cite>downside_risk</cite>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/747">#747</a>)</li>
<li>Downside risk now returns the square root of the mean of downside
difference squares. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/747">#747</a>)</li>
<li>Information ratio updated to return mean of risk adjusted returns over
standard deviation of risk adjusted returns. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1322">#1322</a>)</li>
<li>Alpha and sharpe ratio are now annualized. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1322">#1322</a>)</li>
<li>Fix units during reading and writing of daily bar <code class="docutils literal"><span class="pre">first_trading_day</span></code>
attribute. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1245">#1245</a>)</li>
<li>Optional dispatch modules, when missing, no longer cause a <cite>NameError</cite>.
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1246">#1246</a>)</li>
<li>Treat <code class="docutils literal"><span class="pre">schedule_function</span></code> argument as a time rule when a time rule, but no
date rule is supplied. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1221">#1221</a>)</li>
<li>Protect against boundary conditions at beginning and end trading day in
schedule function. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1226">#1226</a>)</li>
<li>Apply adjustments to previous day when using history with a frequency of <cite>1d</cite>.
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1256">#1256</a>)</li>
<li>Fail fast on invalid pipeline columns, instead of attempting to access the nonexistent column.
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1280">#1280</a>)</li>
<li>Fix <code class="docutils literal"><span class="pre">AverageDollarVolume</span></code> NaN handling. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1309">#1309</a>)</li>
</ul>
</div>
<div class="section" id="id10">
<h3>Performance<a class="headerlink" href="#id10" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Performance improvements to blaze core loader. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1227">#1227</a>)</li>
<li>Allow concurrent blaze queries. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1323">#1323</a>)</li>
<li>Prevent missing leading bcolz minute data from doing repeated unnecessary lookups. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1451">#1451</a>)</li>
<li>Cache future chain lookups. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1455">#1455</a>)</li>
</ul>
</div>
<div class="section" id="id11">
<h3>Maintenance and Refactorings<a class="headerlink" href="#id11" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Removed remaining mentions of <code class="docutils literal"><span class="pre">add_history</span></code>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1287">#1287</a>)</li>
</ul>
</div>
<div class="section" id="id12">
<h3>Documentation<a class="headerlink" href="#id12" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="testing">
<h3>Testing<a class="headerlink" href="#testing" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Add test fixture which sources daily pricing data from minute pricing data
fixtures. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1243">#1243</a>)</li>
</ul>
</div>
<div class="section" id="data-format-changes">
<h3>Data Format Changes<a class="headerlink" href="#data-format-changes" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">BcolzDailyBarReader</span></code> and <code class="docutils literal"><span class="pre">BcolzDailyBarWriter</span></code> use trading calendar instance,
instead of trading days serialized to <code class="docutils literal"><span class="pre">JSON</span></code>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1330">#1330</a>)</li>
<li>Change format of <code class="docutils literal"><span class="pre">assets.db</span></code> to support point in time lookups. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1361">#1361</a>)</li>
<li>Change <code class="docutils literal"><span class="pre">BcolzMinuteBarReader``and</span> <span class="pre">``BcolzMinuteBarWriter</span></code> to support varying tick sizes. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1428">#1428</a>)</li>
</ul>
</div>
</div>
<div class="section" id="release-1-0-1">
<h2>Release 1.0.1<a class="headerlink" href="#release-1-0-1" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">1.0.1</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">May 27, 2016</td>
</tr>
</tbody>
</table>
<p>This is a minor bug-fix release from 1.0.0 and includes a small number of bug
fixes and documentation improvements.</p>
<div class="section" id="id13">
<h3>Enhancements<a class="headerlink" href="#id13" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Added support for user-defined commission models. See the
<code class="xref py py-class docutils literal"><span class="pre">zipline.finance.commission.CommissionModel</span></code> class for more details on
implementing a commision model. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1213">#1213</a>)</li>
<li>Added support for non-float columns to Blaze-backed Pipeline
datasets (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1201">#1201</a>).</li>
<li>Added <code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.slice.Slice</span></code>, a new pipeline term designed to
extract a single column from another term. Slices can be created by indexing
into a term, keyed by asset. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1267">#1267</a>)</li>
</ul>
</div>
<div class="section" id="id14">
<h3>Bug Fixes<a class="headerlink" href="#id14" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">Fixed a bug where Pipeline loaders were not properly initialized by
<code class="xref py py-func docutils literal"><span class="pre">zipline.run_algorithm()</span></code>. This also affected invocations of <code class="docutils literal"><span class="pre">zipline</span>
<span class="pre">run</span></code> from the CLI.</p>
</li>
<li><p class="first">Fixed a bug that caused the <code class="docutils literal"><span class="pre">%%zipline</span></code> IPython cell magic to fail
(<a class="reference external" href="https://github.com/enigmampc/catalyst/commit/533233fae43c7ff74abfb0044f046978817cb4e4">533233fae43c7ff74abfb0044f046978817cb4e4</a>).</p>
</li>
<li><p class="first">Fixed a bug in the <code class="xref py py-class docutils literal"><span class="pre">PerTrade</span></code> commission
model where commissions were incorrectly applied to each partial-fill of an
order rather than on the order itself, resulting in algorithms being charged
too much in commissions when placing large orders.</p>
<p><code class="xref py py-class docutils literal"><span class="pre">PerTrade</span></code> now correctly applies
commissions on a per-order basis (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1213">#1213</a>).</p>
</li>
<li><p class="first">Attribute accesses on <code class="xref py py-class docutils literal"><span class="pre">CustomFactors</span></code>
defining multiple outputs will now correctly return an output slice when the
output is also the name of a <code class="xref py py-class docutils literal"><span class="pre">Factor</span></code> method
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1214">#1214</a>).</p>
</li>
<li><p class="first">Replaced deprecated usage of <code class="docutils literal"><span class="pre">pandas.io.data</span></code> with <code class="docutils literal"><span class="pre">pandas_datareader</span></code>
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1218">#1218</a>).</p>
</li>
<li><p class="first">Fixed an issue where <code class="docutils literal"><span class="pre">.pyi</span></code> stub files for <code class="xref py py-mod docutils literal"><span class="pre">zipline.api</span></code> were
accidentally excluded from the PyPI source distribution. Conda users should
be unaffected (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1230">#1230</a>).</p>
</li>
</ul>
</div>
<div class="section" id="id15">
<h3>Documentation<a class="headerlink" href="#id15" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Added a new example, <code class="xref py py-mod docutils literal"><span class="pre">zipline.examples.momentum_pipeline</span></code>, which
exercises the Pipeline API (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1230">#1230</a>).</li>
</ul>
</div>
</div>
<div class="section" id="release-1-0-0">
<h2>Release 1.0.0<a class="headerlink" href="#release-1-0-0" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">1.0.0</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">May 19, 2016</td>
</tr>
</tbody>
</table>
<div class="section" id="id16">
<h3>Highlights<a class="headerlink" href="#id16" title="Permalink to this headline"></a></h3>
<div class="section" id="zipline-1-0-rewrite-1105">
<h4>Zipline 1.0 Rewrite (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1105">#1105</a>)<a class="headerlink" href="#zipline-1-0-rewrite-1105" title="Permalink to this headline"></a></h4>
<p>We have rewritten a lot of Zipline and its basic concepts in order to improve
runtime performance. At the same time, we&#8217;ve introduced several new APIs.</p>
<p>At a high level, earlier versions of Zipline simulations pulled from a
multiplexed stream of data sources, which were merged via heapq. This stream was
fed to the main simulation loop, driving the clock forward. This strong
dependency on reading all the data made it difficult to optimize simulation
performance because there was no connection between the amount of data we
fetched and the amount of data actually used by the algorithm.</p>
<p>Now, we only fetch data when the algorithm needs it. A new class,
<code class="xref py py-class docutils literal"><span class="pre">DataPortal</span></code>, dispatches data requests to
various data sources and returns the requested values. This makes the runtime of
a simulation scale much more closely with the complexity of the algorithm,
rather than with the number of assets provided by the data sources.</p>
<p>Instead of the data stream driving the clock, now simulations iterate through a
pre-calculated set of day or minute timestamps. The timestamps are emitted by
<code class="xref py py-class docutils literal"><span class="pre">MinuteSimulationClock</span></code> and
<code class="xref py py-class docutils literal"><span class="pre">DailySimulationClock</span></code>, and consumed by the main
loop in <code class="xref py py-meth docutils literal"><span class="pre">transform()</span></code>.</p>
<p>We&#8217;ve retired the <code class="docutils literal"><span class="pre">data[sid(N)]</span></code> and <code class="docutils literal"><span class="pre">history</span></code> APIs, replacing them with
several methods on the <code class="xref py py-class docutils literal"><span class="pre">BarData</span></code> object:
<code class="xref py py-meth docutils literal"><span class="pre">current()</span></code>,
<code class="xref py py-meth docutils literal"><span class="pre">history()</span></code>,
<code class="xref py py-meth docutils literal"><span class="pre">can_trade()</span></code>, and
<code class="xref py py-meth docutils literal"><span class="pre">is_stale()</span></code>. Old APIs will continue to work for
now, but will issue deprecation warnings.</p>
<p>You can now pass in an adjustments source to the
<code class="xref py py-class docutils literal"><span class="pre">DataPortal</span></code>, and we will apply adjustments to
the pricing data when looking backwards at data. Prices and volumes for
execution and presented to the algorithm in data.current are the as-traded value
of the asset.</p>
</div>
<div class="section" id="new-entry-points-1173-and-1178">
<h4>New Entry Points (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1173">#1173</a> and <a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1178">#1178</a>)<a class="headerlink" href="#new-entry-points-1173-and-1178" title="Permalink to this headline"></a></h4>
<p>In order to make it easier to use zipline we have updated the entry points for
a backtest. The three supported ways to run a backtest are now:</p>
<ol class="arabic simple">
<li><code class="xref py py-func docutils literal"><span class="pre">zipline.run_algo()</span></code></li>
<li><code class="docutils literal"><span class="pre">$</span> <span class="pre">zipline</span> <span class="pre">run</span></code></li>
<li><code class="docutils literal"><span class="pre">%zipline</span></code> (IPython magic)</li>
</ol>
</div>
<div class="section" id="data-bundles-1173-and-1178">
<h4>Data Bundles (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1173">#1173</a> and <a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1178">#1178</a>)<a class="headerlink" href="#data-bundles-1173-and-1178" title="Permalink to this headline"></a></h4>
<p>1.0.0 introduces data bundles. Data bundles are groups of data that should be
preloaded and used to run backtests later. This allows users to not need to to
specify which tickers they are interested in each time they run an
algorithm. This also allows us to cache the data between runs.</p>
<p>By default, the <code class="docutils literal"><span class="pre">quantopian-quandl</span></code> bundle will be used which pulls data from
Quantopian&#8217;s mirror of the quandl <a class="reference external" href="https://www.quandl.com/data/WIKI">WIKI dataset</a>. New bundles may be registered with
<code class="xref py py-func docutils literal"><span class="pre">zipline.data.bundles.register()</span></code> like:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="nd">@zipline.data.bundles.register</span><span class="p">(</span><span class="s">&#39;my-new-bundle&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">my_new_bundle_ingest</span><span class="p">(</span><span class="n">environ</span><span class="p">,</span>
<span class="n">asset_db_writer</span><span class="p">,</span>
<span class="n">minute_bar_writer</span><span class="p">,</span>
<span class="n">daily_bar_writer</span><span class="p">,</span>
<span class="n">adjustment_writer</span><span class="p">,</span>
<span class="n">calendar</span><span class="p">,</span>
<span class="n">cache</span><span class="p">,</span>
<span class="n">show_progress</span><span class="p">):</span>
<span class="o">...</span>
</pre></div>
</div>
<p>This function should retrieve the data it needs and then use the writers that
have been passed to write that data to disc in a location that zipline can find
later.</p>
<p>This data can be used in backtests by passing the name as the <code class="docutils literal"><span class="pre">-b</span> <span class="pre">/</span> <span class="pre">--bundle</span></code>
argument to <code class="docutils literal"><span class="pre">$</span> <span class="pre">zipline</span> <span class="pre">run</span></code> or as the <code class="docutils literal"><span class="pre">bundle</span></code> argument to
<code class="xref py py-func docutils literal"><span class="pre">zipline.run_algorithm()</span></code>.</p>
<p>For more information see <a class="reference internal" href="bundles.html#data-bundles"><span>Data Bundles</span></a> for more information.</p>
</div>
<div class="section" id="string-support-in-pipeline-1174">
<h4>String Support in Pipeline (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1174">#1174</a>)<a class="headerlink" href="#string-support-in-pipeline-1174" title="Permalink to this headline"></a></h4>
<p>Added support for string data in Pipeline.
<code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.data.Column</span></code> now accepts <code class="docutils literal"><span class="pre">object</span></code> as a dtype, which
signifies that loaders for that column should emit windowed iterators over the
experimental new <code class="xref py py-class docutils literal"><span class="pre">LabelArray</span></code> class.</p>
<p>Several new <code class="xref py py-class docutils literal"><span class="pre">Classifier</span></code> methods have also been added
for constructing <code class="xref py py-class docutils literal"><span class="pre">Filter</span></code> instances based on string
operations. The new methods are:</p>
<blockquote>
<div><ul class="simple">
<li><code class="xref py py-meth docutils literal"><span class="pre">element_of()</span></code></li>
<li><code class="xref py py-meth docutils literal"><span class="pre">startswith()</span></code></li>
<li><code class="xref py py-meth docutils literal"><span class="pre">endswith()</span></code></li>
<li><code class="xref py py-meth docutils literal"><span class="pre">has_substring()</span></code></li>
<li><code class="xref py py-meth docutils literal"><span class="pre">matches()</span></code></li>
</ul>
<p><code class="docutils literal"><span class="pre">element_of</span></code> is defined for all classifiers. The remaining methods are
only defined for string-dtype classifiers.</p>
</div></blockquote>
</div>
</div>
<div class="section" id="id17">
<h3>Enhancements<a class="headerlink" href="#id17" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">Made the data loading classes have more consistent interfaces. This includes
the equity bar writers, adjustment writer, and asset db writer. The new
interface is that the resource to be written to is passed at construction time
and the data to write is provided later to the <cite>write</cite> method as
dataframes or some iterator of dataframes. This model allows us to pass these
writer objects around as a resource for other classes and functions to
consume (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1109">#1109</a> and <a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1149">#1149</a>).</p>
</li>
<li><p class="first">Added masking to <code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.CustomFactor</span></code>.
Custom factors can now be passed a Filter upon instantiation. This tells the
factor to only compute over stocks for which the filter returns True, rather
than always computing over the entire universe of stocks. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1095">#1095</a>)</p>
</li>
<li><p class="first">Added <code class="xref py py-class docutils literal"><span class="pre">zipline.utils.cache.ExpiringCache</span></code>.
A cache which wraps entries in a <code class="xref py py-class docutils literal"><span class="pre">zipline.utils.cache.CachedObject</span></code>,
which manages expiration of entries based on the <cite>dt</cite> supplied to the <cite>get</cite>
method. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1130">#1130</a>)</p>
</li>
<li><p class="first">Implemented <code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.factors.RecarrayField</span></code>, a new pipeline
term designed to be the output type of a CustomFactor with multiple outputs.
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1119">#1119</a>)</p>
</li>
<li><p class="first">Added optional <cite>outputs</cite> parameter to <code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.CustomFactor</span></code>.
Custom factors are now capable of computing and returning multiple outputs,
each of which are themselves a Factor. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1119">#1119</a>)</p>
</li>
<li><p class="first">Added support for string-dtype pipeline columns. Loaders for thse columns
should produce instances of <code class="xref py py-class docutils literal"><span class="pre">zipline.lib.labelarray.LabelArray</span></code> when
traversed. <code class="xref py py-meth docutils literal"><span class="pre">latest()</span></code> on string
columns produces a string-dtype
<code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.Classifier</span></code>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1174">#1174</a>)</p>
</li>
<li><p class="first">Added several methods for converting Classifiers into Filters.</p>
<p>The new methods are:
- <code class="xref py py-meth docutils literal"><span class="pre">element_of()</span></code>
- <code class="xref py py-meth docutils literal"><span class="pre">startswith()</span></code>
- <code class="xref py py-meth docutils literal"><span class="pre">endswith()</span></code>
- <code class="xref py py-meth docutils literal"><span class="pre">has_substring()</span></code>
- <code class="xref py py-meth docutils literal"><span class="pre">matches()</span></code></p>
<p><code class="docutils literal"><span class="pre">element_of</span></code> is defined for all classifiers. The remaining methods are
only defined for strings. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1174">#1174</a>)</p>
</li>
<li><p class="first">Added <code class="xref py py-class docutils literal"><span class="pre">BollingerBands</span></code> factor. This factor
implements the Bollinger Bands technical indicator:
<a class="reference external" href="https://en.wikipedia.org/wiki/Bollinger_Bands">https://en.wikipedia.org/wiki/Bollinger_Bands</a> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1199">#1199</a>).</p>
</li>
<li><p class="first">Fetcher has been moved from Quantopian internal code into Zipline
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1105">#1105</a>).</p>
</li>
<li><p class="first">Added new built-in factors,
<code class="xref py py-class docutils literal"><span class="pre">RollingPearsonOfReturns</span></code>,
<code class="xref py py-class docutils literal"><span class="pre">RollingSpearmanOfReturns</span></code> and
<code class="xref py py-class docutils literal"><span class="pre">RollingLinearRegressionOfReturns</span></code>
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1154">#1154</a>)</p>
</li>
</ul>
</div>
<div class="section" id="id18">
<h3>Experimental Features<a class="headerlink" href="#id18" title="Permalink to this headline"></a></h3>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Experimental features are subject to change.</p>
</div>
<ul class="simple">
<li>Added a new <code class="xref py py-class docutils literal"><span class="pre">zipline.lib.labelarray.LabelArray</span></code> class for efficiently
representing and computing on string data with numpy. This class is
conceptually similar to <a class="reference external" href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Categorical.html#pandas.Categorical" title="(in pandas v0.20.3)"><code class="xref py py-class docutils literal"><span class="pre">pandas.Categorical</span></code></a>, in that it represents
string arrays as arrays of indices into a (smaller) array of unique string
values. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1174">#1174</a>)</li>
</ul>
</div>
<div class="section" id="id19">
<h3>Bug Fixes<a class="headerlink" href="#id19" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="id20">
<h3>Performance<a class="headerlink" href="#id20" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="id21">
<h3>Maintenance and Refactorings<a class="headerlink" href="#id21" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="id22">
<h3>Build<a class="headerlink" href="#id22" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="id23">
<h3>Documentation<a class="headerlink" href="#id23" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Updated documentation for the API methods (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1188">#1188</a>).</li>
<li>Updated release process to mention that docs should be built with python 3
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1188">#1188</a>).</li>
</ul>
</div>
<div class="section" id="id24">
<h3>Miscellaneous<a class="headerlink" href="#id24" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Zipline now provides a <a class="reference external" href="https://www.python.org/dev/peps/pep-0484/#stub-files">stub file</a> for the
<code class="docutils literal"><span class="pre">zipline.api</span></code> module. This module is normally dynamically created so the
stub file provides some static information for utilities that can consume it,
for example PyCharm (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1208">#1208</a>).</li>
</ul>
</div>
</div>
<div class="section" id="release-0-9-0">
<h2>Release 0.9.0<a class="headerlink" href="#release-0-9-0" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">0.9.0</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">March 29, 2016</td>
</tr>
</tbody>
</table>
<div class="section" id="id25">
<h3>Highlights<a class="headerlink" href="#id25" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Added classifiers and normalization methods to pipeline, along with new
datasets and factors.</li>
<li>Added support for Windows with continuous integration on AppVeyor.</li>
</ul>
</div>
<div class="section" id="id26">
<h3>Enhancements<a class="headerlink" href="#id26" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Added new datasets
<code class="xref py py-class docutils literal"><span class="pre">CashBuybackAuthorizations</span></code>
and <code class="xref py py-class docutils literal"><span class="pre">ShareBuybackAuthorizations</span></code>
for use in the Pipeline API. These datasets provide an abstract interface for
adding cash and share buyback authorizations data, respectively, to a new
algorithm. pandas-based reference implementations for these datasets can be
found in <code class="xref py py-mod docutils literal"><span class="pre">zipline.pipeline.loaders.buyback_auth</span></code>, and experimental
blaze-based implementations can be found in
<code class="xref py py-mod docutils literal"><span class="pre">zipline.pipeline.loaders.blaze.buyback_auth</span></code>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1022">#1022</a>).</li>
<li>Added new datasets
<code class="xref py py-class docutils literal"><span class="pre">DividendsByExDate</span></code>,
<code class="xref py py-class docutils literal"><span class="pre">DividendsByPayDate</span></code>, and
<code class="xref py py-class docutils literal"><span class="pre">DividendsByAnnouncementDate</span></code>
for use in the Pipeline API. These datasets provide an abstract interface for
adding dividends data organized by ex date, pay date, and announcement date,
respectively, to a new algorithm. pandas-based reference implementations for
these datasets can be found in <code class="xref py py-mod docutils literal"><span class="pre">zipline.pipeline.loaders.dividends</span></code>, and
experimental blaze-based implementations can be found in
<code class="xref py py-mod docutils literal"><span class="pre">zipline.pipeline.loaders.blaze.dividends</span></code>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1093">#1093</a>).</li>
<li>Added new built-in factors,
<code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.factors.BusinessDaysSinceCashBuybackAuth</span></code> and
<code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.factors.BusinessDaysSinceShareBuybackAuth</span></code>. These
factors use the new <code class="docutils literal"><span class="pre">CashBuybackAuthorizations</span></code> and
<code class="docutils literal"><span class="pre">ShareBuybackAuthorizations</span></code> datasets, respectively. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1022">#1022</a>).</li>
<li>Added new built-in factors,
<code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.factors.BusinessDaysSinceDividendAnnouncement</span></code>,
<code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.factors.BusinessDaysUntilNextExDate</span></code>, and
<code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.factors.BusinessDaysSincePreviousExDate</span></code>. These
factors use the new <code class="docutils literal"><span class="pre">DividendsByAnnouncementDate`</span> <span class="pre">and</span> <span class="pre">``DividendsByExDate</span></code>
datasets, respectively. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1093">#1093</a>).</li>
<li>Implemented <code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.Classifier</span></code>, a new core pipeline API
term representing grouping keys. Classifiers are primarily used by passing
them as the <code class="docutils literal"><span class="pre">groupby</span></code> parameter to factor normalization methods.
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1046">#1046</a>)</li>
<li>Added factor normalization methods:
<code class="xref py py-meth docutils literal"><span class="pre">zipline.pipeline.Factor.demean()</span></code> and
<code class="xref py py-meth docutils literal"><span class="pre">zipline.pipeline.Factor.zscore()</span></code>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1046">#1046</a>)</li>
<li>Added <code class="xref py py-meth docutils literal"><span class="pre">zipline.pipeline.Factor.quantiles()</span></code>, a method for computing a
Classifier from a Factor by partitioning into equally-sized buckets. Also
added helpers for common quantile sizes
(<code class="xref py py-meth docutils literal"><span class="pre">zipline.pipeline.Factor.quartiles()</span></code>,
<code class="xref py py-meth docutils literal"><span class="pre">zipline.pipeline.Factor.quartiles()</span></code>, and
<code class="xref py py-meth docutils literal"><span class="pre">zipline.pipeline.Factor.deciles()</span></code>) (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1075">#1075</a>).</li>
</ul>
</div>
<div class="section" id="id27">
<h3>Experimental Features<a class="headerlink" href="#id27" title="Permalink to this headline"></a></h3>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Experimental features are subject to change.</p>
</div>
<p>None</p>
</div>
<div class="section" id="id28">
<h3>Bug Fixes<a class="headerlink" href="#id28" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Fixed a bug where merging two numerical expressions failed given too many
inputs. This caused running a pipeline to fail when combining more than ten
factors or filters. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1072">#1072</a>)</li>
</ul>
</div>
<div class="section" id="id29">
<h3>Performance<a class="headerlink" href="#id29" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="id30">
<h3>Maintenance and Refactorings<a class="headerlink" href="#id30" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="id31">
<h3>Build<a class="headerlink" href="#id31" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Added AppVeyor for continuous integration on Windows. Added conda build of
zipline and its dependencies to AppVeyor and Travis builds, which upload
their results to anaconda.org labeled with &#8220;ci&#8221;. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/981">#981</a>)</li>
</ul>
</div>
<div class="section" id="id32">
<h3>Documentation<a class="headerlink" href="#id32" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="id33">
<h3>Miscellaneous<a class="headerlink" href="#id33" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Adds <code class="xref py py-class docutils literal"><span class="pre">ZiplineTestCase</span></code> which provides hooks
to consume test fixtures. Fixtures are things like:
<code class="xref py py-class docutils literal"><span class="pre">WithAssetFinder</span></code> which will make
<code class="docutils literal"><span class="pre">self.asset_finder</span></code> available to your test with some mock data
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/1042">#1042</a>).</li>
</ul>
</div>
</div>
<div class="section" id="release-0-8-4">
<h2>Release 0.8.4<a class="headerlink" href="#release-0-8-4" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">0.8.4</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">February 24, 2016</td>
</tr>
</tbody>
</table>
<div class="section" id="id34">
<h3>Highlights<a class="headerlink" href="#id34" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Added a new <code class="xref py py-class docutils literal"><span class="pre">EarningsCalendar</span></code> dataset
for use in the Pipeline API. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/905">#905</a>).</li>
<li><code class="xref py py-class docutils literal"><span class="pre">AssetFinder</span></code> speedups (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/830">#830</a> and
<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/817">#817</a>).</li>
<li>Improved support for non-float dtypes in Pipeline. Most notably, we now
support <code class="docutils literal"><span class="pre">datetime64</span></code> and <code class="docutils literal"><span class="pre">int64</span></code> dtypes for <code class="docutils literal"><span class="pre">Factor</span></code>, and
<code class="docutils literal"><span class="pre">BoundColumn.latest</span></code> now returns a proper <code class="docutils literal"><span class="pre">Filter</span></code> object when the column
is of dtype <code class="docutils literal"><span class="pre">bool</span></code>.</li>
<li>Zipline now supports <code class="docutils literal"><span class="pre">numpy</span></code> 1.10, <code class="docutils literal"><span class="pre">pandas</span></code> 0.17, and <code class="docutils literal"><span class="pre">scipy</span></code> 0.16
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/969">#969</a>).</li>
<li>Batch transforms have been deprecated and will be removed in a future release.
Using <code class="docutils literal"><span class="pre">history</span></code> is recommended as an alternative.</li>
</ul>
</div>
<div class="section" id="id35">
<h3>Enhancements<a class="headerlink" href="#id35" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Adds a way for users to provide a context manager to use when executing the
scheduled functions (including <code class="docutils literal"><span class="pre">handle_data</span></code>). This context manager will be
passed the <code class="xref py py-class docutils literal"><span class="pre">BarData</span></code> object for the bar and will
be used for the duration of all of the functions scheduled to run. This can be
passed to <code class="xref py py-class docutils literal"><span class="pre">TradingAlgorithm</span></code> by the keyword argument
<code class="docutils literal"><span class="pre">create_event_context</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/828">#828</a>).</li>
<li>Added support for <code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.factors.Factor</span></code> instances with
<code class="docutils literal"><span class="pre">datetime64[ns]</span></code> dtypes. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/905">#905</a>)</li>
<li>Added a new <code class="xref py py-class docutils literal"><span class="pre">EarningsCalendar</span></code> dataset
for use in the Pipeline API. This dataset provides an abstract interface for
adding earnings announcement data to a new algorithm. A pandas-based
reference implementation for this dataset can be found in
<code class="xref py py-mod docutils literal"><span class="pre">zipline.pipeline.loaders.earnings</span></code>, and an experimental blaze-based
implementation can be found in
<code class="xref py py-mod docutils literal"><span class="pre">zipline.pipeline.loaders.blaze.earnings</span></code>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/905">#905</a>).</li>
<li>Added new built-in factors,
<code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.factors.BusinessDaysUntilNextEarnings</span></code> and
<code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.factors.BusinessDaysSincePreviousEarnings</span></code>. These
factors use the new <code class="docutils literal"><span class="pre">EarningsCalendar</span></code> dataset. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/905">#905</a>).</li>
<li>Added <code class="xref py py-meth docutils literal"><span class="pre">isnan()</span></code>,
<code class="xref py py-meth docutils literal"><span class="pre">notnan()</span></code> and
<code class="xref py py-meth docutils literal"><span class="pre">isfinite()</span></code> methods to
<code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.factors.Factor</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/861">#861</a>).</li>
<li>Added <code class="xref py py-class docutils literal"><span class="pre">zipline.pipeline.factors.Returns</span></code>, a built-in factor which
calculates the percent change in close price over the given
window_length. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/884">#884</a>).</li>
<li>Added a new built-in factor:
<code class="xref py py-class docutils literal"><span class="pre">AverageDollarVolume</span></code>. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/927">#927</a>).</li>
<li>Added <code class="xref py py-class docutils literal"><span class="pre">ExponentialWeightedMovingAverage</span></code> and
<code class="xref py py-class docutils literal"><span class="pre">ExponentialWeightedMovingStdDev</span></code>
factors. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/910">#910</a>).</li>
<li>Allow <code class="xref py py-class docutils literal"><span class="pre">DataSet</span></code> classes to be subclassed where
subclasses inherit all of the columns from the parent. These columns will be
new sentinels so you can register them a custom loader (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/924">#924</a>).</li>
<li>Added <code class="xref py py-func docutils literal"><span class="pre">coerce()</span></code> to coerce inputs from one
type into another before passing them to the function (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/948">#948</a>).</li>
<li>Added <code class="xref py py-func docutils literal"><span class="pre">optionally()</span></code> to wrap other
preprocessor functions to explicitly allow <code class="docutils literal"><span class="pre">None</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/947">#947</a>).</li>
<li>Added <code class="xref py py-func docutils literal"><span class="pre">ensure_timezone()</span></code> to allow string
arguments to get converted into <a class="reference external" href="http://docs.python.org/dev/library/datetime.html#datetime.tzinfo" title="(in Python v3.7)"><code class="xref py py-class docutils literal"><span class="pre">datetime.tzinfo</span></code></a> objects. This also
allows <code class="docutils literal"><span class="pre">tzinfo</span></code> objects to be passed directly (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/947">#947</a>).</li>
<li>Added two optional arguments, <code class="docutils literal"><span class="pre">data_query_time</span></code> and <code class="docutils literal"><span class="pre">data_query_tz</span></code> to
<code class="xref py py-class docutils literal"><span class="pre">BlazeLoader</span></code> and
<code class="xref py py-class docutils literal"><span class="pre">BlazeEarningsCalendarLoader</span></code>.
These arguments allow the user to specify some cutoff time for data when
loading from the resource. For example, if I want to simulate executing my
<code class="docutils literal"><span class="pre">before_trading_start</span></code> function at <code class="docutils literal"><span class="pre">8:45</span> <span class="pre">US/Eastern</span></code> then I could pass
<code class="docutils literal"><span class="pre">datetime.time(8,</span> <span class="pre">45)</span></code> and <code class="docutils literal"><span class="pre">'US/Eastern'</span></code> to the loader. This means that
data that is timestamped on or after <code class="docutils literal"><span class="pre">8:45</span></code> will not seen on that day in the
simulation. The data will be made available on the next day (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/947">#947</a>).</li>
<li><code class="docutils literal"><span class="pre">BoundColumn.latest</span></code> now returns a
<code class="xref py py-class docutils literal"><span class="pre">Filter</span></code> for columns of dtype
<code class="docutils literal"><span class="pre">bool</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/962">#962</a>).</li>
<li>Added support for <code class="xref py py-class docutils literal"><span class="pre">Factor</span></code> instances with
<code class="docutils literal"><span class="pre">int64</span></code> dtype. <code class="xref py py-class docutils literal"><span class="pre">Column</span></code> now requires
a <code class="docutils literal"><span class="pre">missing_value</span></code> when dtype is integral. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/962">#962</a>)</li>
<li>It is also now possible to specify custom <code class="docutils literal"><span class="pre">missing_value</span></code> values for
<code class="docutils literal"><span class="pre">float</span></code>, <code class="docutils literal"><span class="pre">datetime</span></code>, and <code class="docutils literal"><span class="pre">bool</span></code> Pipeline terms. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/962">#962</a>)</li>
<li>Added auto-close support for equities. Any positions held in an equity that
reaches its <code class="docutils literal"><span class="pre">auto_close_date</span></code> will be liquidated for cash according to the
equity&#8217;s last sale price. Furthermore, any open orders for that equity will
be canceled. Both futures and equities are now auto-closed on the morning of
their <code class="docutils literal"><span class="pre">auto_close_date</span></code>, immediately prior to <code class="docutils literal"><span class="pre">before_trading_start</span></code>.
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/982">#982</a>)</li>
</ul>
</div>
<div class="section" id="id36">
<h3>Experimental Features<a class="headerlink" href="#id36" title="Permalink to this headline"></a></h3>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Experimental features are subject to change.</p>
</div>
<ul class="simple">
<li>Added support for parameterized <code class="docutils literal"><span class="pre">Factor</span></code> subclasses. Factors may specify
<code class="docutils literal"><span class="pre">params</span></code> as a class-level attribute containing a tuple of parameter names.
These values are then accepted by the constructor and forwarded by name to
the factor&#8217;s <code class="docutils literal"><span class="pre">compute</span></code> function. This API is experimental, and may change
in future releases.</li>
</ul>
</div>
<div class="section" id="id37">
<h3>Bug Fixes<a class="headerlink" href="#id37" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Fixes an issue that would cause the daily/minutely method caching to change
the <code class="docutils literal"><span class="pre">len</span></code> of a <code class="xref py py-class docutils literal"><span class="pre">SIDData</span></code> object. This would cause
us to think that the object was not empty even when it was (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/826">#826</a>).</li>
<li>Fixes an error raised in calculating beta when benchmark data were sparse.
Instead <code class="xref py py-data docutils literal"><span class="pre">numpy.nan</span></code> is returned (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/859">#859</a>).</li>
<li>Fixed an issue pickling <code class="xref py py-func docutils literal"><span class="pre">sentinel()</span></code> objects
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/872">#872</a>).</li>
<li>Fixed spurious warnings on first download of treasury data (:issue <cite>922</cite>).</li>
<li>Corrected the error messages for <code class="xref py py-func docutils literal"><span class="pre">set_commission()</span></code> and
<code class="xref py py-func docutils literal"><span class="pre">set_slippage()</span></code> when used outside of the <code class="docutils literal"><span class="pre">initialize</span></code>
function. These errors called the functions <code class="docutils literal"><span class="pre">override_*</span></code> instead of
<code class="docutils literal"><span class="pre">set_*</span></code>. This also renamed the exception types raised from
<code class="docutils literal"><span class="pre">OverrideSlippagePostInit</span></code> and <code class="docutils literal"><span class="pre">OverrideCommissionPostInit</span></code> to
<code class="xref py py-class docutils literal"><span class="pre">SetSlippagePostInit</span></code> and
<code class="xref py py-class docutils literal"><span class="pre">SetCommissionPostInit</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/923">#923</a>).</li>
<li>Fixed an issue in the CLI that would cause assets to be added twice.
This would map the same symbol to two different sids (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/942">#942</a>).</li>
<li>Fixed an issue where the
<code class="xref py py-class docutils literal"><span class="pre">PerformancePeriod</span></code> incorrectly
reported the total_positions_value when creating a
<code class="xref py py-class docutils literal"><span class="pre">Account</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/950">#950</a>).</li>
<li>Fixed issues around KeyErrors coming from history and BarData on 32-bit
python, where Assets did not compare properly with int64s (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/959">#959</a>).</li>
<li>Fixed a bug where boolean operators were not properly implemented on
<code class="xref py py-class docutils literal"><span class="pre">Filter</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/991">#991</a>).</li>
<li>Installation of zipline no longer downgrades numpy to 1.9.2 silently and
unconditionally (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/969">#969</a>).</li>
</ul>
</div>
<div class="section" id="id38">
<h3>Performance<a class="headerlink" href="#id38" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Speeds up <code class="xref py py-meth docutils literal"><span class="pre">lookup_symbol()</span></code> by adding
an extension, <code class="xref py py-class docutils literal"><span class="pre">AssetFinderCachedEquities</span></code>, that
loads equities into dictionaries and then directs
<code class="xref py py-meth docutils literal"><span class="pre">lookup_symbol()</span></code> to these dictionaries
to find matching equities (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/830">#830</a>).</li>
<li>Improved performance of
<code class="xref py py-meth docutils literal"><span class="pre">lookup_symbol()</span></code> by performing
batched queries. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/817">#817</a>).</li>
</ul>
</div>
<div class="section" id="id39">
<h3>Maintenance and Refactorings<a class="headerlink" href="#id39" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Asset databases now contain version information to ensure compatibility
with current Zipline version (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/815">#815</a>).</li>
<li>Upgrade <code class="docutils literal"><span class="pre">requests</span></code> version to 2.9.1 (<a class="reference external" href="https://github.com/enigmampc/catalyst/commit/2ee40db">2ee40db</a>)</li>
<li>Upgrade <code class="docutils literal"><span class="pre">logbook</span></code> version to 0.12.5 (<a class="reference external" href="https://github.com/enigmampc/catalyst/commit/11465d9">11465d9</a>).</li>
<li>Upgrade <code class="docutils literal"><span class="pre">Cython</span></code> version to 0.23.4 (<a class="reference external" href="https://github.com/enigmampc/catalyst/commit/5f49fa2">5f49fa2</a>).</li>
</ul>
</div>
<div class="section" id="id40">
<h3>Build<a class="headerlink" href="#id40" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Makes zipline install requirements more flexible (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/825">#825</a>).</li>
<li>Use <code class="docutils literal"><span class="pre">versioneer</span></code> to manage the project <code class="docutils literal"><span class="pre">__version__</span></code> and setup.py version
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/829">#829</a>).</li>
<li>Fixed coveralls integration on travis build (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/840">#840</a>).</li>
<li>Fixed conda build, which now uses git source as its source and reads
requirements using setup.py, instead of copying them and letting them get out
of sync (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/937">#937</a>).</li>
<li>Require <code class="docutils literal"><span class="pre">setuptools</span></code> &gt; 18.0 (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/951">#951</a>).</li>
</ul>
</div>
<div class="section" id="id41">
<h3>Documentation<a class="headerlink" href="#id41" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Document the release process for developers (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/835">#835</a>).</li>
<li>Added reference docs for the Pipeline API. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/864">#864</a>).</li>
<li>Added reference docs for Asset Metadata APIs. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/864">#864</a>).</li>
<li>Generated documentation now includes links to source code for many classes
and functions. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/864">#864</a>).</li>
<li>Added platform-specific documentation describing how to find binary
dependencies. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/883">#883</a>).</li>
</ul>
</div>
<div class="section" id="id42">
<h3>Miscellaneous<a class="headerlink" href="#id42" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Added a <code class="xref py py-meth docutils literal"><span class="pre">show_graph()</span></code> method to render
a Pipeline as an image (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/836">#836</a>).</li>
<li>Adds <code class="xref py py-func docutils literal"><span class="pre">subtest()</span></code> decorator for creating subtests
without <code class="xref py py-func docutils literal"><span class="pre">nose_parameterized.expand()</span></code> which bloats the test output
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/833">#833</a>).</li>
<li>Limits timer report in test output to 15 longest tests (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/838">#838</a>).</li>
<li>Treasury and benchmark downloads will now wait up to an hour to download
again if data returned from a remote source does not extend to the date
expected. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/841">#841</a>).</li>
<li>Added a tool to downgrade the assets db to previous versions (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/941">#941</a>).</li>
</ul>
</div>
</div>
<div class="section" id="release-0-8-3">
<h2>Release 0.8.3<a class="headerlink" href="#release-0-8-3" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">0.8.3</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">November 6, 2015</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">We advanced the version to <code class="docutils literal"><span class="pre">0.8.3</span></code> to fix a source distribution issue with
pypi. There are no code changes in this version.</p>
</div>
</div>
<div class="section" id="release-0-8-0">
<h2>Release 0.8.0<a class="headerlink" href="#release-0-8-0" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">0.8.0</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">November 6, 2015</td>
</tr>
</tbody>
</table>
<div class="section" id="id43">
<h3>Highlights<a class="headerlink" href="#id43" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>New documentation system with a new website at
<a class="reference external" href="http://www.zipline.io">zipline.io</a></li>
<li>Major performance enhancements.</li>
<li>Dynamic history.</li>
<li>New user defined method: <code class="docutils literal"><span class="pre">before_trading_start</span></code>.</li>
<li>New api function: <code class="xref py py-func docutils literal"><span class="pre">schedule_function()</span></code>.</li>
<li>New api function: <code class="xref py py-func docutils literal"><span class="pre">get_environment()</span></code>.</li>
<li>New api function: <code class="xref py py-func docutils literal"><span class="pre">set_max_leverage()</span></code>.</li>
<li>New api function: <code class="xref py py-func docutils literal"><span class="pre">set_do_not_order_list()</span></code>.</li>
<li>Pipeline API.</li>
<li>Support for trading futures.</li>
</ul>
</div>
<div class="section" id="id44">
<h3>Enhancements<a class="headerlink" href="#id44" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">Account object: Adds an account object to context to track information about
the trading account.
Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">context</span><span class="o">.</span><span class="n">account</span><span class="o">.</span><span class="n">settled_cash</span>
</pre></div>
</div>
<p>Returns the settled cash value that is stored on the account object.
This value is updated accordingly as the algorithm is run (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/396">#396</a>).</p>
</li>
<li><p class="first"><code class="xref py py-class docutils literal"><span class="pre">HistoryContainer</span></code> can now grow
dynamically. Calls to <code class="xref py py-func docutils literal"><span class="pre">history()</span></code> will now be able to increase
the size or change the shape of the history container to be able to service the
call. <code class="xref py py-func docutils literal"><span class="pre">add_history()</span></code> now acts as a preformance hint to
pre-allocate sufficient space in the container. This change is backwards
compatible with <code class="docutils literal"><span class="pre">history</span></code>, all existing algorithms should continue to work as
intended (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/412">#412</a>).</p>
</li>
<li><p class="first">Simple transforms ported from quantopian and use history.
<code class="xref py py-class docutils literal"><span class="pre">SIDData</span></code> now has methods for:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">stddev</span></code></li>
<li><code class="docutils literal"><span class="pre">mavg</span></code></li>
<li><code class="docutils literal"><span class="pre">vwap</span></code></li>
<li><code class="docutils literal"><span class="pre">returns</span></code></li>
</ul>
<p>These methods, except for <code class="docutils literal"><span class="pre">returns</span></code>, accept a number of days. If
you are running with minute data, then this will calculate the
number of minutes in those days, accounting for early closes and the
current time and apply the transform over the set of minutes.
<code class="docutils literal"><span class="pre">returns</span></code> takes no parameters and will return the daily returns of
the given asset.
Example:</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="n">data</span><span class="p">[</span><span class="n">security</span><span class="p">]</span><span class="o">.</span><span class="n">stddev</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
</pre></div>
</div>
<p>(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/429">#429</a>).</p>
</li>
<li><p class="first">New fields in Performance Period.
Performance Period has new fields accessible in return value of
<code class="docutils literal"><span class="pre">to_dict</span></code>:
- gross leverage
- net leverage
- short exposure
- long exposure
- shorts count
- longs count
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/464">#464</a>).</p>
</li>
<li><p class="first">Allow <code class="xref py py-func docutils literal"><span class="pre">order_percent()</span></code> to work with various market values
(by Jeremiah Lowin).</p>
<p>Currently, <code class="xref py py-func docutils literal"><span class="pre">order_percent()</span></code> and
<code class="xref py py-func docutils literal"><span class="pre">order_target_percent()</span></code> both operate as a percentage of
<code class="docutils literal"><span class="pre">self.portfolio.portfolio_value</span></code>. This PR lets them operate as percentages
of other important MVs.
Also adds <code class="docutils literal"><span class="pre">context.get_market_value()</span></code>, which enables this
functionality.
For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># this is how it works today (and this still works)</span>
<span class="c"># put 50% of my portfolio in AAPL</span>
<span class="n">order_percent</span><span class="p">(</span><span class="s">&#39;AAPL&#39;</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">)</span>
<span class="c"># note that if this were a fully invested portfolio, it would become 150% levered.</span>
<span class="c"># take half of my available cash and buy AAPL</span>
<span class="n">order_percent</span><span class="p">(</span><span class="s">&#39;AAPL&#39;</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="n">percent_of</span><span class="o">=</span><span class="s">&#39;cash&#39;</span><span class="p">)</span>
<span class="c"># rebalance my short position, as a percentage of my current short</span>
<span class="n">book_target_percent</span><span class="p">(</span><span class="s">&#39;MSFT&#39;</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="n">percent_of</span><span class="o">=</span><span class="s">&#39;shorts&#39;</span><span class="p">)</span>
<span class="c"># rebalance within a custom group of stocks</span>
<span class="n">tech_stocks</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;AAPL&#39;</span><span class="p">,</span> <span class="s">&#39;MSFT&#39;</span><span class="p">,</span> <span class="s">&#39;GOOGL&#39;</span><span class="p">)</span>
<span class="n">tech_filter</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="o">.</span><span class="n">sid</span> <span class="ow">in</span> <span class="n">tech_stocks</span>
<span class="k">for</span> <span class="n">stock</span> <span class="ow">in</span> <span class="n">tech_stocks</span><span class="p">:</span>
<span class="n">order_target_percent</span><span class="p">(</span><span class="n">stock</span><span class="p">,</span> <span class="mi">1</span><span class="o">/</span><span class="mi">3</span><span class="p">,</span> <span class="n">percent_of_fn</span><span class="o">=</span><span class="n">tech_filter</span><span class="p">)</span>
</pre></div>
</div>
<p>(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/477">#477</a>).</p>
</li>
<li><p class="first">Command line option to for printing algo to stdout (by Andrea D&#8217;Amore)
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/545">#545</a>).</p>
</li>
<li><p class="first">New user defined function <code class="docutils literal"><span class="pre">before_trading_start</span></code>. This function can be
overridden by the user to be called once before the market opens every
day (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/389">#389</a>).</p>
</li>
<li><p class="first">New api function <code class="xref py py-func docutils literal"><span class="pre">schedule_function()</span></code>. This function allows
the user to schedule a function to be called based on more complicated rules
about the date and time. For example, call the function 15 minutes before
market close respecting early closes (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/411">#411</a>).</p>
</li>
<li><p class="first">New api function <code class="xref py py-func docutils literal"><span class="pre">set_do_not_order_list()</span></code>. This function accepts a list
of assets and adds a trading guard that prevents the algorithm from
trading them. Adds a list point in time list of leveraged ETFs that people may
want to mark as &#8216;do not trade&#8217; (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/478">#478</a>).</p>
</li>
<li><p class="first">Adds a class for representing securities. <code class="xref py py-func docutils literal"><span class="pre">order()</span></code> and other
order functions now require an instance of <code class="docutils literal"><span class="pre">Security</span></code>
instead of an int or string (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/520">#520</a>).</p>
</li>
<li><p class="first">Generalize the <code class="docutils literal"><span class="pre">Security</span></code> class to <code class="xref py py-class docutils literal"><span class="pre">Asset</span></code>. This is
in preperation of adding support for other asset types (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/535">#535</a>).</p>
</li>
<li><p class="first">New api function <code class="xref py py-func docutils literal"><span class="pre">get_environment()</span></code>. This function by
default returns the string <code class="docutils literal"><span class="pre">'zipline'</span></code>. This is used so that algorithms can
have different behavior on Quantopian and local zipline (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/384">#384</a>).</p>
</li>
<li><p class="first">Extends <code class="xref py py-func docutils literal"><span class="pre">get_environment()</span></code> to expose more of the environment
to the algorithm. The function now accepts an argument that is the field to
return. By default, this is <code class="docutils literal"><span class="pre">'platform'</span></code> which returns the old value of
<code class="docutils literal"><span class="pre">'zipline'</span></code> but the following new fields can be requested:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">''arena'</span></code>: Is this live trading or backtesting?</li>
<li><code class="docutils literal"><span class="pre">'data_frequency'</span></code>: Is this minute mode or daily mode?</li>
<li><code class="docutils literal"><span class="pre">'start'</span></code>: Simulation start date.</li>
<li><code class="docutils literal"><span class="pre">'end'</span></code>: Simulation end date.</li>
<li><code class="docutils literal"><span class="pre">'capital_base'</span></code>: The starting capital for the simulation.</li>
<li><code class="docutils literal"><span class="pre">'platform'</span></code>: The platform that the algorithm is running on.</li>
<li><code class="docutils literal"><span class="pre">'*'</span></code>: A dictionary containing all of these fields.</li>
</ul>
<p>(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/449">#449</a>).</p>
</li>
<li><p class="first">New api function <code class="xref py py-func docutils literal"><span class="pre">set_max_leveraged()</span></code>. This method adds a
trading guard that prevents your algorithm from over leveraging itself
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/552">#552</a>).</p>
</li>
</ul>
</div>
<div class="section" id="id45">
<h3>Experimental Features<a class="headerlink" href="#id45" title="Permalink to this headline"></a></h3>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Experimental features are subject to change.</p>
</div>
<ul class="simple">
<li>Adds new Pipeline API. The pipeline API is a high-level declarative API for
representing trailing window computations on large datasets (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/630">#630</a>).</li>
<li>Adds support for futures trading (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/637">#637</a>).</li>
<li>Adds Pipeline loader for blaze expressions. This allows users to pull data
from any format blaze understands and use it in the Pipeline
API. (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/775">#775</a>).</li>
</ul>
</div>
<div class="section" id="id46">
<h3>Bug Fixes<a class="headerlink" href="#id46" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Fix a bug where the reported returns could sharply dip for random periods of
time (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/378">#378</a>).</li>
<li>Fix a bug that prevented debuggers from resolving the algorithm file
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/431">#431</a>).</li>
<li>Properly forward arguments to user defined <code class="docutils literal"><span class="pre">initialize</span></code> function
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/687">#687</a>).</li>
<li>Fix a bug that would cause treasury data to be redownloaded every backtest
between midnight EST and the time when the treasury data was available
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/793">#793</a>).</li>
<li>Fix a bug that would cause the user defined <code class="docutils literal"><span class="pre">analyze</span></code> function to not be
called if it was passed as a keyword argument to
<code class="xref py py-class docutils literal"><span class="pre">TradingAlgorithm</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/819">#819</a>).</li>
</ul>
</div>
<div class="section" id="id47">
<h3>Performance<a class="headerlink" href="#id47" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Major performance enhancements to history (by Dale Jung) (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/488">#488</a>).</li>
</ul>
</div>
<div class="section" id="id48">
<h3>Maintenance and Refactorings<a class="headerlink" href="#id48" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Remove simple transform code. These are available as methods of
<code class="xref py py-class docutils literal"><span class="pre">SIDData</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/550">#550</a>).</li>
</ul>
</div>
<div class="section" id="id49">
<h3>Build<a class="headerlink" href="#id49" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="id50">
<h3>Documentation<a class="headerlink" href="#id50" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Switched to sphinx for the documentation (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/816">#816</a>).</li>
</ul>
</div>
</div>
<div class="section" id="release-0-7-0">
<h2>Release 0.7.0<a class="headerlink" href="#release-0-7-0" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">0.7.0</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">July 25, 2014</td>
</tr>
</tbody>
</table>
<div class="section" id="id51">
<h3>Highlights<a class="headerlink" href="#id51" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Command line interface to run algorithms directly.</li>
<li>IPython Magic <code class="docutils literal"><span class="pre">%%zipline</span></code> that runs algorithm defined in an IPython
notebook cell.</li>
<li>API methods for building safeguards against runaway ordering and
undesired short positions.</li>
<li>New history() function to get a moving DataFrame of past market data
(replaces BatchTransform).</li>
<li>A new <a class="reference external" href="http://nbviewer.ipython.org/github/quantopian/zipline/blob/master/docs/tutorial.ipynb">beginner
tutorial</a>.</li>
</ul>
</div>
<div class="section" id="id52">
<h3>Enhancements<a class="headerlink" href="#id52" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">CLI: Adds a CLI and IPython magic for zipline.
Example:</p>
<div class="highlight-python"><div class="highlight"><pre>python run_algo.py -f dual_moving_avg.py --symbols AAPL --start 2011-1-1 --end 2012-1-1 -o dma.pickle
</pre></div>
</div>
<p>Grabs the data from yahoo finance, runs the file
dual_moving_avg.py (and looks for <code class="docutils literal"><span class="pre">dual_moving_avg_analyze.py</span></code>
which, if found, will be executed after the algorithm has been run),
and outputs the perf <code class="docutils literal"><span class="pre">DataFrame</span></code> to <code class="docutils literal"><span class="pre">dma.pickle</span></code> (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/325">#325</a>).</p>
</li>
</ul>
<ul>
<li><p class="first">IPython magic command (at the top of an IPython notebook cell).
Example:</p>
<div class="highlight-python"><div class="highlight"><pre>%%zipline --symbols AAPL --start 2011-1-1 --end 2012-1-1 -o perf
</pre></div>
</div>
<p>Does the same as above except instead of executing the file looks
for the algorithm in the cell and instead of outputting the perf df
to a file, creates a variable in the namespace called perf (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/325">#325</a>).</p>
</li>
</ul>
<ul>
<li><p class="first">Adds Trading Controls to the algorithm API.</p>
<p>The following functions are now available on <code class="docutils literal"><span class="pre">TradingAlgorithm</span></code>
and for algo scripts:</p>
<p><code class="docutils literal"><span class="pre">set_max_order_size(self,</span> <span class="pre">sid=None,</span> <span class="pre">max_shares=None,</span> <span class="pre">max_notional=None)</span></code>
Set a limit on the absolute magnitude, in shares and/or total
dollar value, of any single order placed by this algorithm for a
given sid. If <code class="docutils literal"><span class="pre">sid</span></code> is None, then the rule is applied to any order
placed by the algorithm.
Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="n">context</span><span class="p">):</span>
<span class="c"># Algorithm will raise an exception if we attempt to place an</span>
<span class="c"># order which would cause us to hold more than 10 shares</span>
<span class="c"># or 1000 dollars worth of sid(24).</span>
<span class="n">set_max_order_size</span><span class="p">(</span><span class="n">sid</span><span class="p">(</span><span class="mi">24</span><span class="p">),</span> <span class="n">max_shares</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">max_notional</span><span class="o">=</span><span class="mf">1000.0</span><span class="p">)</span>
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">set_max_position_size(self,</span> <span class="pre">sid=None,</span> <span class="pre">max_shares=None,</span> <span class="pre">max_notional=None)</span></code>
-Set a limit on the absolute magnitude, in either shares or
dollar value, of any position held by the algorithm for a given
sid. If <code class="docutils literal"><span class="pre">sid</span></code> is None, then the rule is applied to any position
held by the algorithm.
Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="n">context</span><span class="p">):</span>
<span class="c"># Algorithm will raise an exception if we attempt to order more than</span>
<span class="c"># 10 shares or 1000 dollars worth of sid(24) in a single order.</span>
<span class="n">set_max_order_size</span><span class="p">(</span><span class="n">sid</span><span class="p">(</span><span class="mi">24</span><span class="p">),</span> <span class="n">max_shares</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">max_notional</span><span class="o">=</span><span class="mf">1000.0</span><span class="p">)</span>
<span class="sb">``</span><span class="n">set_max_order_count</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">max_count</span><span class="p">)</span><span class="sb">``</span>
<span class="n">Set</span> <span class="n">a</span> <span class="n">limit</span> <span class="n">on</span> <span class="n">the</span> <span class="n">number</span> <span class="n">of</span> <span class="n">orders</span> <span class="n">that</span> <span class="n">can</span> <span class="n">be</span> <span class="n">placed</span> <span class="n">by</span> <span class="n">the</span> <span class="n">algorithm</span> <span class="ow">in</span>
<span class="n">a</span> <span class="n">single</span> <span class="n">trading</span> <span class="n">day</span><span class="o">.</span>
<span class="n">Example</span><span class="p">:</span>
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="n">context</span><span class="p">):</span>
<span class="c"># Algorithm will raise an exception if more than 50 orders are placed in a day.</span>
<span class="n">set_max_order_count</span><span class="p">(</span><span class="mi">50</span><span class="p">)</span>
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">set_long_only(self)</span></code>
Set a rule specifying that the
algorithm may not hold short positions.
Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="n">context</span><span class="p">):</span>
<span class="c"># Algorithm will raise an exception if it attempts to place</span>
<span class="c"># an order that would cause it to hold a short position.</span>
<span class="n">set_long_only</span><span class="p">()</span>
</pre></div>
</div>
<p>(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/329">#329</a>).</p>
</li>
<li><p class="first">Adds an <code class="docutils literal"><span class="pre">all_api_methods</span></code> classmethod on <code class="docutils literal"><span class="pre">TradingAlgorithm</span></code> that
returns a list of all <code class="docutils literal"><span class="pre">TradingAlgorithm</span></code> API methods (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/333">#333</a>).</p>
</li>
<li><p class="first">Expanded record() functionality for dynamic naming.
The record() function can now take positional args before the
kwargs. All original usage and functionality is the same, but now
these extra usages will work:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">name</span> <span class="o">=</span> <span class="s">&#39;Dynamically_Generated_String&#39;</span>
<span class="n">record</span><span class="p">(</span> <span class="n">name</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="o">...</span> <span class="p">)</span>
<span class="n">record</span><span class="p">(</span> <span class="n">name</span><span class="p">,</span> <span class="n">value1</span><span class="p">,</span> <span class="s">&#39;name2&#39;</span><span class="p">,</span> <span class="n">value2</span><span class="p">,</span> <span class="n">name3</span><span class="o">=</span><span class="n">value3</span><span class="p">,</span> <span class="n">name4</span><span class="o">=</span><span class="n">value4</span> <span class="p">)</span>
</pre></div>
</div>
<p>The requirements are simply that the poritional args occur only
before the kwargs (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/355">#355</a>).</p>
</li>
<li><p class="first">history() has been ported from Quantopian to Zipline and provides
moving window of market data.
history() replaces BatchTransform. It is faster, works for minute level data
and has a superior interface. To use it, call <code class="docutils literal"><span class="pre">add_history()</span></code> inside of
<code class="docutils literal"><span class="pre">initialize()</span></code> and then receive a pandas <code class="docutils literal"><span class="pre">DataFrame</span></code> by calling history()
from inside <code class="docutils literal"><span class="pre">handle_data()</span></code>. Check out the <a class="reference external" href="http://nbviewer.ipython.org/github/quantopian/zipline/blob/master/docs/tutorial.ipynb">tutorial</a>
and an <a class="reference external" href="https://github.com/quantopian/zipline/blob/master/zipline/examples/dual_moving_average.py">example</a>.
(<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/345">#345</a> and <a class="reference external" href="https://github.com/enigmampc/catalyst/issues/357">#357</a>).</p>
</li>
<li><p class="first">history() now supports <code class="docutils literal"><span class="pre">1m</span></code> window lengths (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/345">#345</a>).</p>
</li>
</ul>
</div>
<div class="section" id="id53">
<h3>Bug Fixes<a class="headerlink" href="#id53" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Fix alignment of trading days and open and closes in trading
environment (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/331">#331</a>).</li>
<li>RollingPanel fix when adding/dropping new fields (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/349">#349</a>).</li>
</ul>
</div>
<div class="section" id="id54">
<h3>Performance<a class="headerlink" href="#id54" title="Permalink to this headline"></a></h3>
<p>None</p>
</div>
<div class="section" id="id55">
<h3>Maintenance and Refactorings<a class="headerlink" href="#id55" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Removed undocumented and untested HDF5 and CSV data sources (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/267">#267</a>).</li>
<li>Refactor sim_params (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/352">#352</a>).</li>
<li>Refactoring of history (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/340">#340</a>).</li>
</ul>
</div>
<div class="section" id="id56">
<h3>Build<a class="headerlink" href="#id56" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">The following dependencies have been updated (zipline might work with
other versions too):</p>
<div class="highlight-diff"><div class="highlight"><pre><span class="gd">-pytz==2013.9</span>
<span class="gi">+pytz==2014.4</span>
<span class="gi">+numpy==1.8.1</span>
<span class="gd">-numpy==1.8.0</span>
<span class="gi">+scipy==0.12.0</span>
<span class="gi">+patsy==0.2.1</span>
<span class="gi">+statsmodels==0.5.0</span>
<span class="gd">-six==1.5.2</span>
<span class="gi">+six==1.6.1</span>
<span class="gd">-Cython==0.20</span>
<span class="gi">+Cython==0.20.1</span>
<span class="gd">-TA-Lib==0.4.8</span>
<span class="gi">+--allow-external TA-Lib --allow-unverified TA-Lib TA-Lib==0.4.8</span>
<span class="gd">-requests==2.2.0</span>
<span class="gi">+requests==2.3.0</span>
<span class="gd">-nose==1.3.0</span>
<span class="gi">+nose==1.3.3</span>
<span class="gd">-xlrd==0.9.2</span>
<span class="gi">+xlrd==0.9.3</span>
<span class="gd">-pep8==1.4.6</span>
<span class="gi">+pep8==1.5.7</span>
<span class="gd">-pyflakes==0.7.3</span>
<span class="gd">-pip-tools==0.3.4</span>
<span class="gi">+pyflakes==0.8.1`</span>
<span class="gd">-scipy==0.13.2</span>
<span class="gd">-tornado==3.2</span>
<span class="gd">-pyparsing==2.0.1</span>
<span class="gd">-patsy==0.2.1</span>
<span class="gd">-statsmodels==0.4.3</span>
<span class="gi">+tornado==3.2.1</span>
<span class="gi">+pyparsing==2.0.2</span>
<span class="gd">-Markdown==2.3.1</span>
<span class="gi">+Markdown==2.4.1</span>
</pre></div>
</div>
</li>
</ul>
</div>
<div class="section" id="contributors">
<h3>Contributors<a class="headerlink" href="#contributors" title="Permalink to this headline"></a></h3>
<p>The following people have contributed to this release, ordered by
numbers of commit:</p>
<div class="highlight-python"><div class="highlight"><pre>38 Scott Sanderson
29 Thomas Wiecki
26 Eddie Hebert
6 Delaney Granizo-Mackenzie
3 David Edwards
3 Richard Frank
2 Jonathan Kamens
1 Pankaj Garg
1 Tony Lambiris
1 fawce
</pre></div>
</div>
</div>
</div>
<div class="section" id="release-0-6-1">
<h2>Release 0.6.1<a class="headerlink" href="#release-0-6-1" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">0.6.1</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">April 23, 2014</td>
</tr>
</tbody>
</table>
<div class="section" id="id57">
<h3>Highlights<a class="headerlink" href="#id57" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Major fixes to risk calculations, see Bug Fixes section.</li>
<li>Port of <code class="docutils literal"><span class="pre">history()</span></code> function, see Enhancements section</li>
<li>Start of support for Quantopian algorithm script-syntax, see ENH
section.</li>
<li>conda package manager support, see Build section.</li>
</ul>
</div>
<div class="section" id="id58">
<h3>Enhancements<a class="headerlink" href="#id58" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">Always process new orders
i.e. on bars where <code class="docutils literal"><span class="pre">handle_data</span></code> isn&#8217;t called, but there is &#8216;clock&#8217;
data e.g. a consistent benchmark, process orders.</p>
</li>
<li><p class="first">Empty positions are now filtered from the portfolio container.
To help prevent algorithms from operating on positions that are not in
the existing universe of stocks.
Formerly, iterating over positions would return positions for stocks
which had zero shares held. (Where an explicit check in algorithm code
for <code class="docutils literal"><span class="pre">pos.amount</span> <span class="pre">!=</span> <span class="pre">0</span></code> could prevent from using a non-existent
position.)</p>
</li>
<li><p class="first">Add trading calendar for BMF&amp;Bovespa.</p>
</li>
<li><p class="first">Add beginning of algo script support.</p>
</li>
<li><p class="first">Starts on the path of parity with the script syntax in Quantopian&#8217;s IDE
on <a class="reference external" href="https://quantopian.com">https://quantopian.com</a>
Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span> <span class="kn">import</span> <span class="nn">pytz</span>
<span class="kn">from</span> <span class="nn">zipline</span> <span class="kn">import</span> <span class="n">TradingAlgorithm</span>
<span class="kn">from</span> <span class="nn">zipline.utils.factory</span> <span class="kn">import</span> <span class="n">load_from_yahoo</span>
<span class="kn">from</span> <span class="nn">zipline.api</span> <span class="kn">import</span> <span class="n">order</span>
<span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="n">context</span><span class="p">):</span>
<span class="n">context</span><span class="o">.</span><span class="n">test</span> <span class="o">=</span> <span class="mi">10</span>
<span class="k">def</span> <span class="nf">handle_date</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
<span class="n">order</span><span class="p">(</span><span class="s">&#39;AAPL&#39;</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">context</span><span class="o">.</span><span class="n">test</span><span class="p">)</span>
<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;__main__&#39;</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">pylab</span> <span class="kn">as</span> <span class="nn">pl</span>
<span class="n">start</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2008</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">pytz</span><span class="o">.</span><span class="n">utc</span><span class="p">)</span>
<span class="n">end</span> <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2010</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">pytz</span><span class="o">.</span><span class="n">utc</span><span class="p">)</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">load_from_yahoo</span><span class="p">(</span>
<span class="n">stocks</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;AAPL&#39;</span><span class="p">],</span>
<span class="n">indexes</span><span class="o">=</span><span class="p">{},</span>
<span class="n">start</span><span class="o">=</span><span class="n">start</span><span class="p">,</span>
<span class="n">end</span><span class="o">=</span><span class="n">end</span><span class="p">)</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">dropna</span><span class="p">()</span>
<span class="n">algo</span> <span class="o">=</span> <span class="n">TradingAlgorithm</span><span class="p">(</span>
<span class="n">initialize</span><span class="o">=</span><span class="n">initialize</span><span class="p">,</span>
<span class="n">handle_data</span><span class="o">=</span><span class="n">handle_date</span><span class="p">)</span>
<span class="n">results</span> <span class="o">=</span> <span class="n">algo</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="n">results</span><span class="o">.</span><span class="n">portfolio_value</span><span class="o">.</span><span class="n">plot</span><span class="p">()</span>
<span class="n">pl</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
</pre></div>
</div>
</li>
<li><p class="first">Add HDF5 and CSV sources.</p>
</li>
<li><p class="first">Limit <code class="docutils literal"><span class="pre">handle_data</span></code> to times with market data.
To prevent cases where custom data types had unaligned timestamps, only
call <code class="docutils literal"><span class="pre">handle_data</span></code> when market data passes through.
Custom data that comes before market data will still update the data
bar. But the handling of that data will only be done when there is
actionable market data.</p>
</li>
<li><p class="first">Extended commission PerShare method to allow a minimum cost per trade.</p>
</li>
<li><p class="first">Add symbol api function
A <code class="docutils literal"><span class="pre">symbol()</span></code> lookup feature was added to Quantopian. By adding the
same API function to zipline we can make copy&amp;pasting of a Zipline algo
to Quantopian easier.</p>
</li>
<li><p class="first">Add simulated random trade source.
Added a new data source that emits events with certain user-specified
frequency (minute or daily).
This allows users to backtest and debug an algorithm in minute mode to
provide a cleaner path towards Quantopian.</p>
</li>
<li><p class="first">Remove dependency on benchmark for trading day calendar.
Instead of the benchmarks&#8217; index, the trading calendar is now used to
populate the environment&#8217;s trading days.
Remove <code class="docutils literal"><span class="pre">extra_date</span></code> field, since unlike the benchmarks list, the
trading calendar can generate future dates, so dates for current day
trading do not need to be appended.
Motivations:</p>
<ul class="simple">
<li>The source for the open and close/early close calendar and the
trading day calendar is now the same, which should help prevent
potential issues due to misalignment.</li>
<li>Allows configurations where the benchmark is provided as a generator
based data source to need to supply a second benchmark list just to
populate dates.</li>
</ul>
</li>
<li><p class="first">Port <code class="docutils literal"><span class="pre">history()</span></code> API method from Quantopian.
Opens the core of the <code class="docutils literal"><span class="pre">history()</span></code> function that was previously only
available on the Quantopian platform.</p>
<p>The history method is analoguous to the <code class="docutils literal"><span class="pre">batch_transform</span></code>
function/decorator, but with a hopefully more precise specification of
the frequency and period of the previous bar data that is captured.
Example usage:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">zipline.api</span> <span class="kn">import</span> <span class="n">history</span><span class="p">,</span> <span class="n">add_history</span>
<span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="n">context</span><span class="p">):</span>
<span class="n">add_history</span><span class="p">(</span><span class="n">bar_count</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">frequency</span><span class="o">=</span><span class="s">&#39;1d&#39;</span><span class="p">,</span> <span class="n">field</span><span class="o">=</span><span class="s">&#39;price&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">handle_data</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
<span class="n">prices</span> <span class="o">=</span> <span class="n">history</span><span class="p">(</span><span class="n">bar_count</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">frequency</span><span class="o">=</span><span class="s">&#39;1d&#39;</span><span class="p">,</span> <span class="n">field</span><span class="o">=</span><span class="s">&#39;price&#39;</span><span class="p">)</span>
<span class="n">context</span><span class="o">.</span><span class="n">last_prices</span> <span class="o">=</span> <span class="n">prices</span>
</pre></div>
</div>
<p>N.B. this version of history lacks the backfilling capability that
allows the return a full DataFrame on the first bar.</p>
</li>
</ul>
</div>
<div class="section" id="id59">
<h3>Bug Fixes<a class="headerlink" href="#id59" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">Adjust benchmark events to match market hours (<a class="reference external" href="https://github.com/enigmampc/catalyst/issues/241">#241</a>).
Previously benchmark events were emitted at 0:00 on the day the
benchmark related to: in &#8216;minute&#8217; emission mode this meant that the
benchmarks were emitted before any intra-day trades were processed.</p>
</li>
<li><p class="first">Ensure perf stats are generated for all days
When running with minutely emissions the simulator would report to the
user that it simulated &#8216;n - 1&#8217; days (where n is the number of days
specified in the simulation params). Now the correct number of trading
days are reported as being simulated.</p>
</li>
<li><p class="first">Fix repr for cumulative risk metrics.
The <code class="docutils literal"><span class="pre">__repr__</span></code> for RiskMetricsCumulative was referring to an older
structure of the class, causing an exception when printed.
Also, now prints the last values in the metrics DataFrame.</p>
</li>
<li><p class="first">Prevent minute emission from crashing at end of available data.
The next day calculation was causing an error when a minute emission
algorithm reached the end of available data.
Instead of a generic exception when available data is reached, raise and
catch a named exception so that the tradesimulation loop can skip over,
since the next market close is not needed at the end.</p>
</li>
<li><p class="first">Fix pandas indexing in trading calendar. This could alternatively be filed
under Performance. Index using loc instead of the inefficient index-ing of
day, then time.</p>
</li>
<li><p class="first">Prevent crash in vwap transform due to non-existent member.
The WrongDataForTransform was referencing a <code class="docutils literal"><span class="pre">self.fields</span></code> member,
which did not exist.
Add a self.fields member set to <code class="docutils literal"><span class="pre">price</span></code> and <code class="docutils literal"><span class="pre">volume</span></code> and use it to
iterate over during the check.</p>
</li>
<li><p class="first">Fix max drawdown calculation.
The input into max drawdown was incorrect, causing the bad results. i.e.
the <code class="docutils literal"><span class="pre">compounded_log_returns</span></code> were not values representative of the
algorithms total return at a given time, though
<code class="docutils literal"><span class="pre">calculate_max_drawdown</span></code> was treating the values as if they were.
Instead, the <code class="docutils literal"><span class="pre">algorithm_period_returns</span></code> series is now used, which does
provide the total return.</p>
</li>
<li><p class="first">Fix cost basis calculation.
Cost basis calculation now takes direction of txn into account.
Closing a long position or covering a short shouldn&#8217;t affect the cost
basis.</p>
</li>
<li><p class="first">Fix floating point error in <code class="docutils literal"><span class="pre">order()</span></code>.
Where order amounts that were near an integer could accidentally be
floored or ceilinged (depending on being postive or negative) to the
wrong integer.
e.g. an amount stored internally as -27.99999 was converted to -27
instead of -28.</p>
</li>
<li><p class="first">Update perf period state when positions are changed by splits.
Otherwise, <code class="docutils literal"><span class="pre">self._position_amounts</span></code> will be out of sync with
position.amount, etc.</p>
</li>
<li><p class="first">Fix misalignment of downside series calc when using exact dates.
An oddity that was exposed while working on making the return series
passed to the risk module more exact, the series comparison between the
returns and mean returns was unbalanced, because the mean returns were
not masked down to the downside data points; however, in most, if not
all cases this was papered over by the call to <code class="docutils literal"><span class="pre">.valid()</span></code> which was
removed in this change set.</p>
</li>
<li><p class="first">Check that self.logger exists before using it.
<code class="docutils literal"><span class="pre">self.logger</span></code> is initialized as <code class="docutils literal"><span class="pre">None</span></code> and there is no guarantee
that users have set it, so check that it exists before trying to pass
messages to it.</p>
</li>
<li><p class="first">Prevent out of sync market closes in performance tracker.
In situations where the performance tracker has been reset or patched to
handle state juggling with warming up live data, the <code class="docutils literal"><span class="pre">market_close</span></code>
member of the performance tracker could end up out of sync with the
current algo time as determined by the performance tracker.
The symptom was dividends never triggering, because the end of day
checks would not match the current time.
Fix by having the tradesimulation loop be responsible, in minute/minute
mode, for advancing the market close and passing that value to the
performance tracker, instead of having the market close advanced by the
performance tracker as well.</p>
</li>
<li><p class="first">Fix numerous cumulative and period risk calculations.
The calculations that are expected to change are:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">cumulative.beta</span></code></li>
<li><code class="docutils literal"><span class="pre">cumulative.alpha</span></code></li>
<li><code class="docutils literal"><span class="pre">cumulative.information</span></code></li>
<li><code class="docutils literal"><span class="pre">cumulative.sharpe</span></code></li>
<li><code class="docutils literal"><span class="pre">period.sortino</span></code></li>
</ul>
<p>How Risk Calculations Are Changing
Risk Fixes for Both Period and Cumulative</p>
<p>Downside Risk</p>
<p>Use sample instead of population for standard deviation.</p>
<p>Add a rounding factor, so that if the two values are close for a given
dt, that they do not count as a downside value, which would throw off
the denominator of the standard deviation of the downside diffs.</p>
<p>Standard Deviation Type</p>
<p>Across the board the standard deviation has been standardized to using a
&#8216;sample&#8217; calculation, whereas before cumulative risk was mostly using
&#8216;population&#8217;. Using <code class="docutils literal"><span class="pre">ddof=1</span></code> with <code class="docutils literal"><span class="pre">np.std</span></code> calculates as if the
values are a sample.</p>
<p>Cumulative Risk Fixes</p>
<p>Beta</p>
<p>Use the daily algorithm returns and benchmarks instead of annualized
mean returns.</p>
<p>Volatility</p>
<p>Use sample instead of population with standard deviation.</p>
<p>The volatility is an input to other calculations so this change affects
Sharpe and Information ratio calculations.</p>
<p>Information Ratio</p>
<p>The benchmark returns input is changed from annualized benchmark returns
to the annualized mean returns.</p>
<p>Alpha</p>
<p>The benchmark returns input is changed from annualized benchmark returns
to the annualized mean returns.</p>
<p>Period Risk Fixes</p>
<p>Sortino</p>
<p>Now uses the downside risk of the daily return vs. the mean algorithm
returns for the minimum acceptable return instead of the treasury
return.</p>
<p>The above required adding the calculation of the mean algorithm returns
for period risk.</p>
<p>Also, uses <code class="docutils literal"><span class="pre">algorithm_period_returns</span></code> and <code class="docutils literal"><span class="pre">tresaury_period_return</span></code>
as the cumulative Sortino does, instead of using algorithm returns for
both inputs into the Sortino calculation.</p>
</li>
</ul>
</div>
<div class="section" id="id60">
<h3>Performance<a class="headerlink" href="#id60" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Removed <code class="docutils literal"><span class="pre">alias_dt</span></code> transform in favor of property on SIDData.
Adding a copy of the Event&#8217;s dt field as datetime via the <code class="docutils literal"><span class="pre">alias_dt</span></code>
generator, so that the API was forgiving and allowed both datetime and
dt on a SIDData object, was creating noticeable overhead, even on an
noop algorithms.
Instead of incurring the cost of copying the datetime value and
assigning it to the Event object on every event that is passed through
the system, add a property to SIDData which acts as an alias
<code class="docutils literal"><span class="pre">datetime</span></code> to <code class="docutils literal"><span class="pre">dt</span></code>.
Eventually support for <code class="docutils literal"><span class="pre">data['foo'].datetime</span></code> may be removed, and
could be considered deprecated.</li>
<li>Remove the drop of &#8216;null return&#8217; from cumulative returns.
The check of existence of the null return key, and the drop of said
return on every single bar was adding unneeded CPU time when an
algorithm was run with minute emissions.
Instead, add the 0.0 return with an index of the trading day before the
start date.
The removal of the <code class="docutils literal"><span class="pre">null</span> <span class="pre">return</span></code> was mainly in place so that the
period calculation was not crashing on a non-date index value; with the
index as a date, the period return can also approximate volatility (even
though the that volatility has high noise-to-signal strength because it
uses only two values as an input.)</li>
</ul>
</div>
<div class="section" id="id61">
<h3>Maintenance and Refactorings<a class="headerlink" href="#id61" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">Allow <code class="docutils literal"><span class="pre">sim_params</span></code> to provide data frequency for the algorithm.
In the case that <code class="docutils literal"><span class="pre">data_frequency</span></code> of the algorithm is None, allow the
<code class="docutils literal"><span class="pre">sim_params</span></code> to provide the <code class="docutils literal"><span class="pre">data_frequency</span></code>.</p>
<p>Also, defer to the algorithms data frequency, if provided.</p>
</li>
</ul>
</div>
<div class="section" id="id62">
<h3>Build<a class="headerlink" href="#id62" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">Added support for building and releasing via conda
For those who prefer building with <a class="reference external" href="http://conda.pydata.org/">http://conda.pydata.org/</a> to compiling
locally with pip.
The following should install Zipline on many systems.</p>
<div class="highlight-python"><div class="highlight"><pre>conda install -c quantopian zipline
</pre></div>
</div>
</li>
</ul>
</div>
<div class="section" id="id63">
<h3>Contributors<a class="headerlink" href="#id63" title="Permalink to this headline"></a></h3>
<p>The following people have contributed to this release, ordered by
numbers of commit:</p>
<div class="highlight-python"><div class="highlight"><pre>49 Eddie Hebert
28 Thomas Wiecki
11 Richard Frank
2 Jamie Kirkpatrick
2 Jeremiah Lowin
1 Colin Alexander
1 Michael Schatzow
1 Moises Trovo
1 Suminda Dharmasena
</pre></div>
</div>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2017, Enigma MPC, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.3',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>