API Reference

Running a Backtest

Algorithm API

The following methods are available for use in the initialize, handle_data, and before_trading_start API functions.

In all listed functions, the self argument is implicitly the currently-executing TradingAlgorithm instance.

Data Object

Scheduling Functions

Orders

Order Cancellation Policies

Assets

Trading Controls

Zipline provides trading controls to help ensure that the algorithm is performing as expected. The functions help protect the algorithm from certian bugs that could cause undesirable behavior when trading with real money.

Simulation Parameters

Commission Models

Slippage Models

Pipeline

For more information, see Pipeline API

Miscellaneous

Blotters

Pipeline API

Built-in Factors

Built-in Filters

Pipeline Engine

Data Loaders

Asset Metadata

Trading Calendar API

Data API

Writers

Readers

Bundles

zipline.data.bundles.bundles

The bundles that have been registered as a mapping from bundle name to bundle data. This mapping is immutable and may only be updated through register() or unregister().

Risk Metrics

Algorithm State

Built-in Metrics

Metrics Sets

zipline.data.finance.metrics.metrics_sets

The metrics sets that have been registered as a mapping from metrics set name to load function. This mapping is immutable and may only be updated through register() or unregister().

Utilities

Caching

Command Line