Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
backtesting with zipline tutorial notebook broken !

To the Q team, Are you aware the 9. Tutorial (Advanced) - Backtesting with Zipline is broken!

I get this error on running it..

HTTPErrorTraceback (most recent call last)
in ()
5 algo_obj = TradingAlgorithm(
6 initialize=initialize,
----> 7 handle_data=handle_data
8 )
9

/build/src/qexec_repo/zipline_repo/zipline/algorithm.pyc in init(self, *args, **kwargs) 275
276 if self.trading_environment is None:
--> 277 self.trading_environment = TradingEnvironment()
278
279 # Update the TradingEnvironment with the provided asset metadata

/build/src/qexec_repo/zipline_repo/zipline/finance/trading.pyc in init(self, load, bm_symbol, exchange_tz, trading_calendar, asset_db_path, future_chain_predicates) 99 trading_calendar.day,
100 trading_calendar.schedule.index,
--> 101 self.bm_symbol,
102 )
103

/build/src/qexec_repo/zipline_repo/zipline/data/loader.pyc in load_market_data(trading_day, trading_days, bm_symbol) 162 # We need the trading_day to figure out the close prior to the first
163 # date so that we can compute returns for the first date.
--> 164 trading_day,
165 )
166 tc = ensure_treasury_data(

/build/src/qexec_repo/zipline_repo/zipline/data/loader.pyc in ensure_benchmark_data(symbol, first_date, last_date, now, trading_day) 217 symbol,
218 first_date - trading_day,
--> 219 last_date,
220 )
221 data.to_csv(get_data_filepath(filename))

/build/src/qexec_repo/zipline_repo/zipline/data/benchmarks.pyc in get_benchmark_returns(symbol, start_date, end_date) 57 index_col='Date',
58 usecols=["Adj Close", "Date"],
---> 59 squeeze=True, # squeeze tells pandas to make this a Series
60 # instead of a 1-column DataFrame
61 ).sort_index().tz_localize('UTC').pct_change(1).iloc[1:]

/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.pyc in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skip_footer, doublequote, delim_whitespace, as_recarray, compact_ints, use_unsigned, low_memory, buffer_lines, memory_map, float_precision) 560 skip_blank_lines=skip_blank_lines)
561
--> 562 return read(filepath_or_buffer, kwds)
563
564 parser
f.name = name

/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.pyc in read(filepath_or_buffer, kwds) 299 filepath_or_buffer, _, compression = get_filepath_or_buffer(
300 filepath_or_buffer, encoding,
--> 301 compression=kwds.get('compression', None))
302 kwds['compression'] = (inferred
compression if compression == 'infer'
303 else compression)

/usr/local/lib/python2.7/dist-packages/pandas/io/common.pyc in get_filepath_or_buffer(filepath_or_buffer, encoding, compression) 306
307 if is_url(filepath_or_buffer):
--> 308 req = _urlopen(str(filepath_or_buffer))
309 if compression == 'infer':
310 content
encoding = req.headers.get('Content-Encoding', None)

/usr/lib/python2.7/urllib2.pyc in urlopen(url, data, timeout, cafile, capath, cadefault, context) 152 else:
153 opener = opener
--> 154 return opener.open(url, data, timeout)
155
156 def install
opener(opener):

/usr/lib/python2.7/urllib2.pyc in open(self, fullurl, data, timeout) 433 for processor in self.process_response.get(protocol, []):
434 meth = getattr(processor, meth_name)
--> 435 response = meth(req, response)
436
437 return response

/usr/lib/python2.7/urllib2.pyc in http_response(self, request, response) 546 if not (200 <= code < 300):
547 response = self.parent.error(
--> 548 'http', request, response, code, msg, hdrs)
549
550 return response

/usr/lib/python2.7/urllib2.pyc in error(self, proto, args) 471 if http_err:
472 args = (dict, 'default', 'http_error_default') + orig_args
--> 473 return self._call_chain(
args)
474
475 # XXX probably also want an abstract factory that knows when it makes

/usr/lib/python2.7/urllib2.pyc in _call_chain(self, chain, kind, meth_name, args) 405 func = getattr(handler, meth_name)
406
--> 407 result = func(
args)
408 if result is not None:
409 return result

/usr/lib/python2.7/urllib2.pyc in http_error_default(self, req, fp, code, msg, hdrs) 554 class HTTPDefaultErrorHandler(BaseHandler):
555 def http_error_default(self, req, fp, code, msg, hdrs):
--> 556 raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
557
558 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 404: Not Found

3 responses

Did you follow the issue with yahoo api? I think your problem is answered in the following forum.
https://github.com/quantopian/zipline/issues/1776

Actually I was trying to run it on the Quantopian research platform not stand alone on the local computer. That what the example is suppose to show I believe. So I guess its broken on the Q systems . No one at Quantopian has responded yet !

I believe this is now fixed.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.