Skip to content
python.financial

Choose Zipline Reloaded for local daily or minute equity research with reproducible data bundles, trading calendars, and the Pipeline factor API. Choose LEAN for broader asset modeling, dynamic universes, derivatives, brokerage reality models, or the same algorithm API in backtests and live trading. QuantConnect Cloud adds managed datasets, compute, notebooks, and deployment around LEAN.

Zipline Reloaded and LEAN are both free Apache-2.0 engines that can run on your computer. QuantConnect Cloud is a paid service built around LEAN. Running LEAN yourself means providing the data and operating the software. Zipline also requires prepared local data and does not include maintained live broker connections.

Zipline Reloaded vs LEAN at a glance

Criterion Zipline Reloaded LEAN and QuantConnect Decision impact
Engine and license Python and Cython engine under Apache-2.0 C# engine under Apache-2.0 with C# and Python APIs Both can run locally. Language and available libraries are more important than the license difference here
Primary workflow Local bundle ingestion, Pipeline research, scheduled functions, and event-driven simulation Local or cloud research, universes, algorithms, reality models, optimization, and live deployment Zipline is a focused research engine. LEAN covers a wider algorithm lifecycle
Signature research model Declarative factors, filters, classifiers, rankings, and screens through Pipeline Coarse, fine, ETF, options, futures, and custom universes plus Alpha and Portfolio Framework components Both support dynamic selection, but Pipeline is especially concise for cross-sectional factor computation
Asset scope Equities and futures are the maintained core, at daily or minute frequency Equities, options, futures, futures options, forex, CFDs, crypto, crypto futures, indexes, and custom data LEAN is the stronger choice for cross-asset and derivatives systems
Historical data User-ingested bundles with bars, assets, splits, dividends, and custom Pipeline loaders Local files for self-hosted LEAN or hosted licensed datasets in QuantConnect Cloud Neither open-source engine includes a complete current dataset by license alone
Point-in-time machinery Asset lifetimes, symbol history, bundle snapshots, adjustments, and Pipeline loaders Security identifiers, mappings, corporate actions, universes, and dataset-specific time rules Both can represent point-in-time facts only when the source supplies them correctly
Simulation Scheduled and per-bar callbacks, blotter, market, limit, stop, stop-limit, commissions, slippage, and volume limits Per-security fill, fee, slippage, buying power, settlement, margin, brokerage, and other reality models LEAN has the broader security and brokerage model. Defaults in both need explicit review
Research scaling One local event-driven algorithm, with external orchestration for repeated trials Local backtests or repeated optimization jobs on managed QuantConnect compute Cloud scale does not replace validation or trial accounting
Results and analysis pandas performance table with orders, transactions, positions, risk, and recorded values Statistics, orders, fills, equity, charts, logs, reports, and hosted result views Zipline integrates naturally with local pandas analysis. QuantConnect has broader managed tools
Live trading No maintained first-party live brokerage runtime Same algorithm API can run live through brokerage and data-provider integrations LEAN owns more of the live boundary, but live behavior still differs from backtests
Running it User owns Python environment, bundles, calendars, storage, and jobs User runs LEAN, or pays QuantConnect to manage more of it Compare the same product scope and total data and running cost

Equity research and dynamic universes

Zipline's Pipeline is its most distinctive feature. A Pipeline declares factors, filters, classifiers, screens, and output columns. Before each session, the engine computes those terms over the eligible asset universe. A strategy reads the cross-section in before_trading_start() and can rank or rebalance the selected assets.

This fits long and short factor research, sector-neutral rankings, liquidity filters, momentum screens, and combinations of rolling and fundamental terms. Terms compose declaratively, and masks can prevent expensive calculations outside an eligible universe.

LEAN supports dynamic universe selection through several models. Equity coarse and fine data, ETFs, fundamentals, scheduled universes, options, futures, and custom data can add and remove securities. The Algorithm Framework can separate universe selection, alpha generation, portfolio construction, risk, and execution.

Pipeline is often more concise for a table-like cross-sectional factor graph. LEAN's universe and security model is broader and closer to the full algorithm lifecycle. Neither approach supplies point-in-time fundamentals merely because the API exists. The loader or dataset must carry correct publication time, revisions, identifiers, and membership history.

Local bundles versus local or cloud data

Zipline separates algorithms from ingested bundles. A bundle writer loads daily or minute bars, stable asset metadata, symbol history, exchange and calendar fields, splits, dividends, and futures metadata into internal stores. Ingestions are timestamped, so a run can select a reproducible snapshot.

That separation is valuable for repeatable local research. It also creates work. A current U.S. equity, international, futures, or custom dataset needs ingestion code and maintenance. The historical Quandl WIKI bundle stopped updating in 2018 and is not a source for current research. The built-in csvdir path is useful for controlled fixtures but does not solve broad production data.

Self-hosted LEAN also needs local data in its schemas. QuantConnect's official CLI can download licensed Dataset Market files under paid organization and data terms. Direct engine users can build their own data path, mappings, factor files, corporate actions, and custom sources.

QuantConnect Cloud provides managed access to many hosted datasets within the platform. That can eliminate substantial ingestion work but introduces dataset, provider, plan, export, and platform terms. Data access belongs to the Cloud layer, not the Apache LEAN engine.

Audit the same fields for either system: stable identifier, symbol history, listing and delisting, exchange calendar, corporate actions, terminal returns, futures expiry and multiplier, observation time, revision history, and missing intervals.

Point-in-time and survivorship controls

Zipline's asset database can store start and end dates, stable numeric IDs, and symbol histories. Its adjustment system applies supplied splits and dividends. Pipeline can screen the assets eligible on each session. Timestamped bundle ingestions make the raw snapshot explicit.

Those mechanisms can prevent common errors only if ingestion is complete. Loading today's index members for all history creates survivorship bias. Using the latest ticker for earlier periods corrupts identity. Applying a fundamental value at its fiscal period end rather than public release creates look-ahead. Omitting a delisting or merger changes terminal value.

LEAN includes mapping and factor files, corporate-action events, security changes, universes, delistings, and dataset-specific readers. QuantConnect-hosted datasets may supply much of this integration. Custom and local data still need correct time and identity semantics.

Do not award either engine a point-in-time label without testing a renamed, split, dividend-paying, delisted, and newly listed security across the actual dataset.

Asset classes and market conventions

Zipline Reloaded is strongest in equities and supports futures with appropriate bundle metadata. Its daily and minute lifecycle, calendars, Pipeline, blotter, commission, and slippage models suit traditional factor and scheduled portfolio research. Other markets and 24-hour sessions require custom calendars, bundles, and often deeper adaptation.

LEAN models a wider set of securities and conventions. Options and futures chains, contract selection, exercise and assignment, settlement, buying power, market hours, mappings, and brokerage models are first-class areas of the engine. Forex, CFDs, crypto, and custom data also use the same algorithm surface, subject to provider and brokerage support.

Broad engine support does not guarantee identical data and live tradability. Verify the exact instrument, dataset, resolution, order type, account, and brokerage. Zipline can remain the simpler and more transparent choice when the research is specifically a local equity Pipeline and those extra conventions add no value.

Event timing and simulation assumptions

Zipline's lifecycle includes initialize(), before_trading_start(), scheduled functions, and handle_data(). Its data portal limits algorithms to the current event frontier. Orders enter a simulation blotter and fill according to bar data, commission, slippage, and volume rules. The current bar has already occurred when a new order is created under normal timing.

LEAN algorithms receive chronological slices and scheduled events. Securities own reality models for fills, fees, slippage, buying power, settlement, and other behavior. A brokerage model supplies a coherent set of defaults that can be replaced per security.

Neither default is ground truth. Zipline 3.1.1 has generic default equity commission and five-basis-point slippage with a bar-volume cap. LEAN's Default Brokerage Model uses zero slippage. Built-in fills in either engine simplify partial liquidity and cannot reconstruct queue position or endogenous market impact from bars.

Set costs and models explicitly. Test next-bar timing, current-close modes if used, limit and stop gaps, partial volume, insufficient cash, final open positions, short financing, and derivative-specific economics.

Research validation and optimization

Neither engine's event loop is a full statistical validation process. Zipline users commonly run algorithms over declared ranges and analyze pandas outputs. LEAN users can run local or QuantConnect optimization jobs over parameters. Repeated jobs are only computation.

Build chronological train, validation, and final test ranges around either engine. Fit factor normalizers, models, and selectors inside training data. Use a gap or purge that matches label overlap. Preserve portfolio state correctly across test boundaries. Retain every attempted factor, universe, parameter, and cost design.

QuantConnect compute can make more trials affordable, which increases the need for multiple-testing controls. Zipline's Pipeline can make factor combinations easy to generate, which creates the same risk. A slower project is not automatically less overfit if unrecorded human iterations dominate.

Analysis and ease of research

Zipline returns a pandas DataFrame containing portfolio values, returns, leverage, positions, orders, transactions, risk fields, and anything emitted through record(). This is convenient for local notebooks and custom analysis. Pipeline outputs are also pandas-friendly cross-sections.

LEAN returns statistics, orders, fills, equity, charts, logs, and reports. QuantConnect Cloud adds browser result pages, hosted notebooks, parameter optimization views, object storage, and deployment monitoring. Local LEAN output can be consumed programmatically but requires more of the surrounding workflow from the user.

Zipline is appealing when a Python researcher wants explicit local files and tables. QuantConnect is appealing when one integrated web and compute environment reduces operational work. Compare export, reproducibility, retention, collaboration, and data rights, not only chart appearance.

Live trading and account state

Zipline Reloaded is a research backtester. The original Quantopian platform no longer exists. Third-party bridges can connect a Zipline-like algorithm to a broker, but the bridge owns authentication, order translation, partial fills, reconnects, reconciliation, persistence, monitoring, and shutdown safety.

LEAN supports live mode through brokerage and data-provider integrations. The same algorithm class can run historically and live, which reduces code translation. QuantConnect Cloud can host and supervise deployments, while self-hosted users operate the node and configuration.

Shared code is not backtest-to-live parity. Live feeds arrive at different times, brokerage holdings may already exist, external orders may be incomplete, and strategy state may require warm-up or explicit persistence. QuantConnect documents reconciliation differences across feeds, timing, normalization, auctions, and tick batching.

For either path, paper test open positions, open orders, restarts, disconnects, duplicates, stale data, corporate actions, and a manual kill procedure before considering capital.

Maintenance and installation

Zipline Reloaded remains maintained, but has fewer contributors and less frequent releases than LEAN. Its scientific and compiled dependencies make an isolated project environment a good idea.

LEAN is a large, continuously developed C# project. The official local CLI runs Docker images but currently requires membership in a paid QuantConnect organization. Building and configuring Apache LEAN directly is a separate path. Pin engine source or image, data snapshot, configuration, and algorithm dependencies.

Zipline bundle timestamps and LEAN data directories can both support reproducibility. Record the exact ingestion, engine version, calendar, mappings, adjustments, and result code. An engine version without its data snapshot is not a reproducible backtest.

Licensing and total cost

Zipline Reloaded and LEAN both use Apache-2.0. The practical cost difference comes from the work around them. With Zipline, you must obtain and prepare data, run the local research setup, and build any live connection. Running LEAN locally brings similar responsibilities.

QuantConnect Cloud, CLI access, Local Platform features, compute, datasets, and support add commercial terms and can replace internal work. Compare the current plan and dataset rights with the full engineering and data cost of local operation.

Which should you choose?

Choose Zipline Reloaded when most of these are true:

  • the project is daily or minute equity or futures research,
  • Pipeline factors, filters, rankings, and dynamic cross-sections fit the hypothesis,
  • reproducible local bundles and pandas outputs are desirable,
  • you can build and check data imports that preserve what was known at each date,
  • a maintained live broker system is not required, and
  • a compact Python research engine is preferable to a broader platform.

Choose self-hosted LEAN when most of these are true:

  • the strategy needs broader assets, derivatives, or security conventions,
  • universe, corporate-action, brokerage, and reality models fit the workflow,
  • the same algorithm API should continue into live mode,
  • C# or Python on a C# engine is acceptable, and
  • you can provide the local data and run the software.

Choose QuantConnect Cloud when those LEAN capabilities are needed and managed data, research, compute, optimization, deployment, monitoring, and broker integrations justify the commercial dependency.

A small test before you choose

  1. Use one identical point-in-time equity dataset, stable identifiers, calendar, corporate actions, and starting capital.
  2. Implement the same dynamic universe and ranking rule and reconcile constituents by session.
  3. Reconcile signals, orders, fills, fees, positions, cash, and final portfolio state.
  4. Test a split, dividend, rename, new listing, delisting, missing bar, and symbol reuse.
  5. Add market, limit, stop, gap, partial-volume, insufficient-cash, and short-cost cases.
  6. Run identical chronological ranges and record every factor and parameter trial.
  7. If broader assets or live reuse drive LEAN selection, test one representative derivative and one restart with external state.
  8. Measure data preparation, research iteration, runtime, memory, deployment work, and total platform cost.

The right choice depends less on generic equity features than on who should manage the data, research tools, security models, hosting, and live trading.

Choose which optional services may run. You can change these settings at any time.