Daily Pricing

Overview

Quantopian provides daily pricing and volume data for equities listed in 26 countries around the world. Open, high, low, and closing values are available for daily prices. In addition, daily prices are adjusted for corporate actions like splits, dividends, and spinoffs.

Daily pricing and volume data are available via the Pipeline API, which means they can be accessed in Research and the IDE.

Note

Global data is available in Pipeline in Research. The IDE only has access to US equity data at this time.

Properties

  • Coverage: All supported countries on Quantopian. Note: non-US equities are not yet supported in the IDE.
  • Data Frequency: Daily
  • Update Frequency: Daily (updated overnight after each trading day).
  • Timespan: 2004-01-01 to present.
  • Holdout (US only): None
  • Holdout (non-US): 1 year

Methodology

Adjustments

All pricing data on Quantopian is adjusted for corporate actions. Prices are adjusted for events like splits, dividends, and spinoffs to correct for 'jumps' in prices that don't actually reflect changes in the equity's value. To avoid lookahead bias, Quantopian prices are adjusted point-in-time. All prices in a pipeline or backtest are adjusted as of the simulation date (as opposed to being adjusted as of today). The exact adjustment methodology is explained here.

As-Traded vs End-of-Day Prices

On Quantopian, daily prices for US equities are as-traded prices. The as-traded price of an equity is the last price at which an equity traded, regardless of the exchange on which that trade occurred. For non-US issues, prices are exchange-specific. An exchange-specific closing price for a security may not match that security's as-traded closing price.

Usage

Daily pricing data is accessible via the EquityPricing pipeline DataSet. The sections below provide more information on the EquityPricing dataset including a code example.

Import

from quantopian.pipeline.data import EquityPricing

Example

This code snippet constructs and runs a pipeline that gets the latest close price and volume for all US equities, every day. Run in the Research environment.

from quantopian.pipeline import Pipeline
from quantopian.pipeline.data import EquityPricing
from quantopian.pipeline.domain import US_EQUITIES
from quantopian.research import run_pipeline

# Get the latest daily close price for all equities.
yesterday_close = EquityPricing.close.latest

# Get the latest daily trading volume for all equities.
yesterday_volume = EquityPricing.volume.latest

# Add our data columns to our pipeline and specifies the domain
# to be US_EQUITIES.
pipe = Pipeline(
        columns={
                'close': yesterday_close,
                'volume': yesterday_volume,
        },
        domain=US_EQUITIES,
)

# Run the pipeline over a one year period and print the output.
df = run_pipeline(pipe, '2015-05-05', '2016-05-05')
print(df.head())

See also

To learn more about Pipeline, check out the Getting Started Tutorial for a brief overview or the Pipeline Tutorial for more advanced usage.

Pipeline Datasets & Columns

Dataset

EquityPricing - The EquityPricing dataset is a pipeline DataSet that provides access to daily open, high, low, and close prices as well as daily trading volume (number of shares).

Fields

The EquityPricing dataset has 5 fields (accessible as BoundColumn attributes): close, open, high, low, volume.

  • close (dtype float64) - Price at market close.
  • open (dtype float64) - Price at market open. Note that an EquityPricing.open.latest pipeline factor executed on day N gets the open price from day N-1. This is true for virtually all pipeline datasets but can sometimes be unexpected for open price.
  • high (dtype float64) - Highest price reached by the equity throughout the day.
  • low (dtype float64) - Lowest price reached by the equity throughout the day.
  • volume (dtype float64) - Number of shares traded.