Need help with pipeline-live?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

149 Stars 45 Forks Apache License 2.0 76 Commits 13 Opened issues


Pipeline Extension for Live Trading

Services available


Need anything else?

Contributors list

Zipline Pipeline Extension for Live Trading

is an extension for zipline pipeline independently usable for live trading, outside of zipline. While zipline is a great backtesting library, the default Pipeline API requires complicated setup for data bundle, which is often challenging to average users. Quantopian's proprietary data sources such as Morningstar is also not available to many. This library is to address this issue by using online API data sources and simplify the interface for live trading usage. The interface complies the original zipline/pipeline for the most part. For more details about the Pipeline API, please see Quantopian's tutorial and zipline document.

If you are looking to use this library for your Quantopian algorithm, check out the migration document.

Data Sources

This library predominantly relies on the Alpaca Data API for daily price data. For users with funded Alpaca brokerage accounts, several Polygon fundamental data endpoints are supported. IEX Cloud data is also supported, though if too much data is requested, it stops being free. (See the note in the IEX section below.)


is a PyPI module and you can install it using
$ pip install pipeline-live

This module is tested and expected to work with python 3.6 and later


Here is a simple pipeline example. Please make sure to first set your API keys to these environment variables:

using python ```py import os os.environ["APCAAPIKEYID"] = <ALPACAAPIKEY> os.environ["APCAAPISECRETKEY"] =

if you use the paper endpoint:

os.environ["APCAAPIBASE_URL"] = "" ```

(or do it with bash if you prefer)

Please note that using polygon is only available for funded accounts: ```py from pipelinelive.engine import LivePipelineEngine from import listsymbols from import USEquityPricing from import PolygonCompany from import AverageDollarVolume from zipline.pipeline import Pipeline

eng = LivePipelineEngine(listsymbols) top5 = AverageDollarVolume(windowlength=20).top(5) pipe = Pipeline({ 'close': USEquityPricing.close.latest, 'marketcap': PolygonCompany.marketcap.latest, }, screen=top5)

df = eng.run_pipeline(pipe)

''' close marketcap AAPL 215.49 1.044037e+12 AMZN 1902.90 9.293372e+11 FB 172.90 5.042383e+11 QQQ 180.80 7.092998e+10 SPY 285.79 2.737475e+11 ''' ```

This will work (with limited functionality) for non-funded accounts:

from pipeline_live.engine import LivePipelineEngine
from import list_symbols
from import USEquityPricing
from import AverageDollarVolume
from zipline.pipeline import Pipeline

eng = LivePipelineEngine(list_symbols) top5 = AverageDollarVolume(window_length=20).top(5) pipe = Pipeline({ 'close': USEquityPricing.close.latest, }, screen=top5)

df = eng.run_pipeline(pipe)

''' close AAPL 215.49 AMZN 1902.90 FB 172.90 QQQ 180.80 SPY 285.79 '''

Data Cache

Since most of the data does not change during the day, the data access layer caches the dataset on disk. In case you need to purge the cache, the cache data is located in


Pipeline API


This class provides the similar interface to

. The main difference is its
does not require the start and end dates as parameters, and returns a DataFrame with the data for the current date (US/Eastern time). Its constructor accepts
function that is supposed to return the full set of symbols as a string list, which is used as the maximum universe inside the engine.

Alpaca Data API

The Alpaca Data API is currently the least-limited source of pricing data supported by pipeline-live. In order to use the Alpaca Data API, you'll need to register for an Alpaca account here and generate API key information with the dashboard. Once you have your keys generated, you need to store them in the following environment variables:


This class provides the basic price information retrieved from Alpaca Data API.

Polygon Data Source API

You will need to set an Alpaca API key as

to use this API.

This class provides the DataSet interface using Polygon Symbol Details API

Experimental. This class filteres symbols by the following rule to return something close to IsPrimaryShare() in Quantopian.

  • must be a US company
  • must have a valid financial data

IEX Data Source API

To use IEX-source data, you need to sign up for an IEX Cloud account and save your IEX token as an environment variable called


IMPORTANT NOTE: IEX data is now limited for free accounts. In order to avoid using more messages than you are allotted each month, please be sure that you are not using IEX-sourced factors too frequently or on too many securities. For more information about how many messages each method will cost, please refer to this part of the IEX Cloud documentation.

This class provides the basic price information retrieved from IEX Chart API.

This provides the DataSet interface using IEX Company API.

This provides the DataSet interface using IEX Key Stats API.

It is important to note that the original builtin factors from zipline does not work here as is, since some of them rely on zipline's USEquityPricing class. This package provides the same set of zipline's builtin factor classes using
class. For the complete list of builtin factors, please refer zipline document

A shortcut for


A shortcut for


We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.