WIP: Initial port of qprof run script.
ENH: Implement CLI.

Add a CLI that reads in an algorithm, loads data,
run the algorithm, and output performance metrics.

The examples are adapted to the new zipline API and
analyses are split into separate files.

Also add config files that run the example
algorithms with preset settings.
TST: Add tests for parse_args().
ENH: Add IPython cell magic.

When zipline is imported it checks whether
it runs in the IPython notebook. If it does,
it registers a %%zipline magic that takes the
same arguments as the CLI with the addition of
a -o for specifying the output variable to store
the performance frame in.

The algo code in the cell is, as of yet, executed
in its own environment rather than that of the
IPython NB which is probably what we want.

Also adds cli option to save the perf dataframe
to a pickle file.

Also adds an IPython notebook buyapple example.
DOC: Add doc strings.
STY: Rename run_algo to run_pipeline.
DOC: Add note on installation to setting up dev env.
DOC: Update README on conda installation, CLI and new example algo.
DOC: Fix typo in release announcement.
DOC: Add release notes for 0.6.2.
BUG: Use env_trading_calender for open and closes data

TradingEnvironment class uses env_trading_calendar for trading days,
but the default trading calendar for open_and_close data, which causes
errors later, because of misalignment of trading days.

The issue can be resolved by using env_trading_calendar for
open_and_closes as well
DOC: Update release notes.
ENH: Add trading controls to zipline API.

Adds four new methods to the Zipline API that can be used as circuit-breakers
to interrupt the execution of an algorithm.  The API methods are:

`set_max_position_size`
`set_max_order_size`
`set_max_order_count`
`set_long_only`

Internally, these methods are implemented by each registering a TradingControl
callback object with the TradingAlgorithm.  During
TradingAlgorithm.__validate_order_params (and thus before any side-effects of
the order call occur), each callback's `validate` method is called with
information about the order to be placed and the algorithm's current state,
raising an exception if the callback detects that an error condition has been breached.
DOC: Update release notes for trading controls.
MAINT: deleted duplicate attribute in Portfolio

Deleted duplicate of Portfolio.portfolio_value in zipline.protocol. It
was defined on line 75 and line 82.
ENH: Add a classmethod to TradingAlgorithm to get all API methods.
DOC: Update release notes for `all_api_methods` helper.
BLD: Move statsmodels from dev requirements into main requirements.

Pandas website states statsmodels is needed for parts of pandas.stats.
Also, update statsmodels to 0.5.0.

Upgrade of version is to both keep up to date, and to improve
performance on lazy imports, as fixed by
https://github.com/statsmodels/statsmodels/issues/573
DOC: More generic PostInit error messages.

Make the error messages for {DoBadThing}PostInit no longer reference "the
simulation", since the algorithm may not actually be running as a simulation.
BLD: statsmodels requires patsy

Since statsmodels requires patsy, and statsmodels is now in
requirements.txt instead of requirements_dev.txt, patsy also needs to
be in requirements.txt instead of requirements_dev.txt.