- Platform
- Portfolio backtesting framework
- License
- Apache-2.0
- Pricing
- Free and open source
- Live trading
- Not supported by the maintained public framework
- Best for
- Daily or minute equity factor research with dynamic universes and point-in-time data
Zipline Reloaded is the maintained community fork of Quantopian's event-driven backtester. It is most useful for daily or minute equity research that needs exchange calendars, asset lifetimes, corporate-action adjustments, scheduled portfolio logic, and cross-sectional factor calculations.
Its main feature is Pipeline, a declarative API for calculating factors, filters, classifiers, rankings, and dynamic universes before each session. Pipeline can keep a long/short equity strategy concise, but Zipline does not include a point-in-time fundamental database. Results still depend on whether the asset metadata and datasets supplied by the bundle and Pipeline loaders were truly available on each date.
How Zipline Reloaded works
Zipline separates an algorithm from the historical data store it reads:
- A bundle ingests OHLCV, asset metadata, trading calendars, splits, and dividends into Zipline's internal stores.
initialize()configures assets, schedules, commission, slippage, Pipeline definitions, and persistent strategy state.before_trading_start(), scheduled functions, andhandle_data()receive data without direct future access.- The simulation blotter manages open orders, applies fill and commission models, updates positions and cash, and emits daily performance packets.
run_algorithm()returns a pandas DataFrame containing portfolio state, orders, transactions, risk metrics, and values recorded by the strategy.
This division is useful for reproducibility. Bundle ingestions are timestamped, and a backtest can select the latest ingestion available before a chosen bundle timestamp. It also creates setup work: an algorithm cannot run until a compatible bundle has been ingested.
What Zipline Reloaded does well
| Capability | Practical value | Required care |
|---|---|---|
| Pipeline factors | Computes cross-sectional factors and screens a changing universe by session | Fundamental and classification data need point-in-time loaders |
| Trading calendars | Aligns sessions, opens, closes, holidays, and scheduled callbacks | The selected calendar must match every instrument in the bundle |
| Asset metadata | Tracks stable asset identifiers, symbol histories, and start or end dates | A current-symbol-only file can still create survivorship bias |
| Corporate actions | Applies splits and cash dividends supplied during ingestion | Missing or incorrectly dated adjustments make portfolio history wrong |
| Event-driven API | Supports market, limit, stop, and stop-limit orders plus scheduled decisions | Historical bars still cannot reveal actual queue position or market impact |
| Execution models | Commission and slippage models can limit volume, move fill prices, and split fills | Defaults are assumptions, not venue evidence, and financing is separate |
| Daily and minute modes | Runs the same lifecycle on two supported data frequencies | Minute bundles can be large and still contain only bar-level information |
| Open analysis output | Returns pandas-friendly performance, order, and transaction data | Performance columns should be audited before becoming reporting inputs |
The API reference documents order, scheduling, Pipeline, commission, and slippage interfaces. Some documentation pages retain older version labels because the fork inherited Quantopian's manual, so confirm behavior against the installed 3.1.1 API and source when a detail affects results.
Example with a local CSV data bundle
This example exercises the real bundle and simulation path without downloading market data. Create sample-data/daily/TEST.csv with synthetic NYSE-session bars:
date,open,high,low,close,volume,dividend,split
2024-01-02,100,101,99,100,100000,0,1
2024-01-03,101,102,100,101,100000,0,1
2024-01-04,102,103,101,102,100000,0,1
2024-01-05,103,104,102,103,100000,0,1
2024-01-08,104,105,103,104,100000,0,1
2024-01-09,105,106,104,105,100000,0,1
2024-01-10,106,107,105,106,100000,0,1
2024-01-11,107,108,106,107,100000,0,1
2024-01-12,108,109,107,108,100000,0,1
Point Zipline at a project-local state directory and ingest the built-in csvdir bundle:
export ZIPLINE_ROOT="$PWD/.zipline-demo"
export CSVDIR="$PWD/sample-data"
zipline ingest -b csvdir
The bundle guide specifies this OHLCV, dividend, and split format. The following strategy.py submits one target order, sets costs explicitly, and prints the simulated fill:
import pandas as pd
from zipline import run_algorithm
from zipline.api import order_target, record, set_commission, set_slippage, symbol
from zipline.finance import commission, slippage
def initialize(context):
context.asset = symbol("TEST")
context.ordered = False
set_commission(us_equities=commission.PerShare(cost=0.01, min_trade_cost=0))
set_slippage(us_equities=slippage.FixedSlippage(spread=0.10))
def handle_data(context, data):
if not context.ordered:
order_target(context.asset, 10)
context.ordered = True
record(
close=data.current(context.asset, "close"),
position=context.portfolio.positions[context.asset].amount,
)
result = run_algorithm(
start=pd.Timestamp("2024-01-02"),
end=pd.Timestamp("2024-01-12"),
initialize=initialize,
handle_data=handle_data,
capital_base=10_000,
data_frequency="daily",
bundle="csvdir",
benchmark_returns=pd.Series(
0.0,
index=pd.date_range("2024-01-02", "2024-01-12", tz="UTC"),
),
)
transactions = [item for day in result.transactions for item in day]
fill = transactions[0]
orders = [item for day in result.orders for item in day]
filled_order = orders[-1]
print("shares:", fill["amount"])
print("fill price:", round(fill["price"], 2))
print("commission:", round(filled_order["commission"], 2))
print("final position:", int(result.position.iloc[-1]))
Executed with Zipline Reloaded 3.1.1, it prints:
shares: 10
fill price: 101.05
commission: 0.1
final position: 10
The order submitted on January 2 fills on the next daily bar at its 101 close plus half of the configured 0.10 spread. Ten shares at 0.01 per share produce a 0.10 commission. This verifies bundle ingestion, asset lookup, event ordering, order processing, slippage, commission, position state, and recorded output. The steadily rising synthetic prices are not evidence of an edge.
Pipeline is useful, but data decides the result
A Pipeline attached during initialize() is computed before each trading day. Factors can use rolling price or volume windows, combine terms, mask assets, and rank a cross-section. A strategy can then read pipeline_output() before the session and rebalance a selected long and short basket.
That clean API does not solve the hardest data questions:
- Did the universe include delisted assets on the date being tested?
- Were identifier changes and reused tickers mapped to stable asset IDs?
- Did each fundamental value carry the timestamp when it became public, not the period end?
- Were restatements and later corrections excluded from earlier sessions?
- Were splits, dividends, mergers, and delistings complete and effective on the right date?
Zipline's adjustment and asset-lifetime machinery can represent these facts when an ingestion supplies them. It cannot reconstruct facts missing from a current constituents file or revised database. This is why Zipline can help control survivorship bias and point-in-time data errors, but cannot prevent them automatically.
Bundles are both a strength and a cost
The built-in Quandl WIKI bundle is useful only for historical demonstrations because that dataset stopped updating in early 2018. Current research normally requires a custom ingestion or the csvdir adapter. Bundle writers accept daily or minute bars, metadata, futures, splits, and dividends, while custom Pipeline loaders handle additional datasets.
This ingestion layer gives the engine stable schemas and reproducible snapshots. It also means maintaining a data pipeline, exchange calendars, identifiers, adjustment logic, storage, and update jobs. The csvdir route hardcodes its assets as equities on an NYSE-style calendar unless a custom bundle is registered. Crypto, FX, 24-hour markets, and nonstandard sessions therefore require more than dropping a CSV into a folder.
Execution and cost realism
Zipline 3.1.1 defaults equities to FixedBasisPointsSlippage at 5 basis points with a 10% bar-volume limit, plus PerShare commission at 0.001 per share with no minimum. Those are generic defaults. Set models explicitly so a result does not change unnoticed with a package upgrade or differ from the intended broker and venue.
Available models cover fixed spread, basis-point, volume-share, and futures volatility-volume impact, plus per-share, per-dollar, per-trade, and per-contract commissions. Limit and stop triggers operate on historical bar information. None of these models reconstructs an order book, queue priority, hidden liquidity, or the counterfactual response to the strategy's own trades. A volume cap constrains fills but is not proof that the historical volume was available at the modeled price.
Short positions also require external assumptions for locate availability, borrow fees, recalls, dividends in lieu, and financing. Futures research needs correct contract metadata, multipliers, roll rules, commissions, and margin economics. Stress transaction costs and slippage rather than treating one configured model as ground truth.
Installation and live-trading limits
PyPI publishes wheels for supported Python versions and major desktop platforms, while conda-forge is another documented route:
pip install zipline-reloaded==3.1.1
The package depends on compiled extensions and several scientific libraries, so use an isolated project environment. After upgrading dependencies, test data loading and a full strategy run, not only import zipline.
Zipline Reloaded is a backtesting package, not a maintained live brokerage platform. The original Quantopian service and its hosted datasets no longer exist. A third-party bridge can map the algorithm API to a broker, but that bridge owns authentication, order-state reconciliation, partial fills, disconnect recovery, broker-specific restrictions, monitoring, and kill controls. Do not infer backtest-to-live parity from the shared strategy callbacks.
When to choose it
Choose Zipline Reloaded when the project centers on session-aware equity or futures research, especially a cross-sectional Pipeline strategy backed by a carefully maintained point-in-time dataset. The event lifecycle, bundle snapshots, corporate-action machinery, and pandas performance output remain a productive combination.
Choose QuantConnect LEAN when broader market coverage and several live broker connections matter more than Zipline's Python Pipeline workflow. Choose Backtrader when a small local event loop and broker adapters matter more than cross-sectional factor tools. For large parameter searches, a library such as VectorBT solves a different problem more directly.
Bottom line
Zipline Reloaded 3.1.1 preserves a distinctive research model: ingest a reproducible market database, calculate point-in-time cross-sectional signals, and execute a calendar-aware event-driven portfolio. It is valuable when that model matches the problem and the researcher can own the data pipeline. It is a poor shortcut for current market data, nontraditional asset classes, order-book realism, or live operations, because those responsibilities sit outside the package.