Zipline: momentum pipeline example - TypeError: a float is required
<p>I have been trying to run the example on Zipline called <code>momentum_pipeline.py</code>. It is just not running properly, I'm calling the following on terminal:</p>

<pre><code>python -m zipline run -f momentum_pipeline.py --start 2000-1-1 --end 2014-1-1 --output pipeline.pickle
</code></pre>

<p>The output is an error on Terminal saying <code>TypeError: a float is required.</code></p>

<p>This is the error log on the screenshot:</p>

<p><a href="http://i.stack.imgur.com/eNHKF.png" rel="nofollow"><img src="http://i.stack.imgur.com/eNHKF.png" alt="enter image description here"></a></p>

<p>The error seems to relate to this line in the file:</p>

<pre><code>  File "momentum_pipeline.py", line 68, in before_trading_start
    context.pipeline_data = pipeline_output('my_pipeline')
</code></pre>

<p>Not sure why it refers to a TypeError related to a float. That line should return a panda dataFrame. You can view the file on github here: <a href="https://github.com/quantopian/zipline/blob/master/zipline/examples/momentum_pipeline.py" rel="nofollow">https://github.com/quantopian/zipline/blob/master/zipline/examples/momentum_pipeline.py</a></p>

<p>How do I run this example successfully?</p>

<p>I think the date range I was using was too long (from 2000 - 2014) therefore some of the data was not available. I think Quantopian only has stock market data from 2002 only. If you change the date range to the ones found on the test_args, the example will work:</p>

<pre><code>return {
    # We run through october of 2013 because DELL is in the test data and
    # it went private on 2013-10-29.
    'start': pd.Timestamp('2013-10-07', tz='utc'),
    'end': pd.Timestamp('2013-11-30', tz='utc'),
    'capital_base': 100000,
}
</code></pre>

python zipline