---
title: "US Equities"
description: "US Equities dataset from AlgoSeek."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/algoseek/us-equities
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/algoseek/us-equities.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/14%20Datasets/03%20AlgoSeek/01%20US%20Equities
modified: 2026-10-30
index: https://www.quantconnect.com/llms.txt
---

# US Equities

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Datasets > [AlgoSeek](https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/algoseek.md) > US Equities

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

The US Equities dataset by AlgoSeek is survivorship bias-free daily coverage of every stock traded in the US Securities Information Processors (SIP) CTA/UTP feed since 1998. The dataset covers approximately 27,500 securities, starts in January 1998, and is delivered in any resolution from tick to daily. The Data is collected from the full SIP feed via our Equinix co-located servers, including all trades and quotes published to every exchange as well as FINRA. Over-the-Counter (OTC) trades are not included.

This dataset depends on the [US Equity Security Master](https://www.quantconnect.com/datasets/quantconnect-us-equity-security-master) dataset because the US Equity Security Master dataset contains information on splits, dividends, and symbol changes.

For more information about the US Equities dataset, including CLI commands and pricing, see the [dataset listing](https://www.quantconnect.com/datasets/algoseek-us-equities).

## About the Provider

AlgoSeek is a leading historical intraday US market data provider offering the most comprehensive and detailed market data and analytics products in the financial industry covering Equities, Futures, Options, cash FOREX, and Cryptocurrencies. AlgoSeek data is built for quantitative trading and machine learning. For more information about AlgoSeek, visit [algoseek.com](https://www.algoseek.com).

## Getting Started

AlgoSeek is the default US Equities dataset on QuantConnect. The following snippet demonstrates how to request data from the US Equities dataset:

```python
self.aapl = self.add_equity("AAPL", Resolution.DAILY).symbol
```

## Data Summary

The following table describes the dataset properties:

| Property | Value |
| --- | --- |
| Start Date | January 1998 |
| Asset Coverage | 27,500 US Equities |
| Data Density | Dense |
| Resolution | Tick, Second, Minute, Hourly, & Daily |
| Timezone | New York |
| Market Hours | [Regular and Extended](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/us-equity/market-hours.md) |

## Requesting Data

To add US Equities data to your algorithm, call the `add_equity` method. Save a reference to the Equity `Symbol` so you can access the data later in your algorithm.

```python
class USEquityDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2018, 1, 1)
        self.set_end_date(2021, 6, 1)
        self.set_cash(100000)
        # Subscribe to AAPL data
        self.aapl = self.add_equity("AAPL", Resolution.MINUTE).symbol
```

For more information about creating US Equity subscriptions, see [Requesting Data](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/us-equity/requesting-data.md) or [US Equity Universes](https://www.quantconnect.com/docs/v2/writing-algorithms/universes/equity.md).

## Accessing Data

To get the current US Equities data, index the `bars`, `quote_bars`, or `ticks` properties of the current [`Slice`](https://www.quantconnect.com/docs/v2/writing-algorithms/key-concepts/time-modeling/timeslices.md) with the Equity `Symbol`. Slice objects deliver unique events to your algorithm as they happen, but the `Slice` may not contain data for your security at every time step. To avoid issues, check if the `Slice` contains the data you want before you index it.

```python
def on_data(self, slice: Slice) -> None:
    # Access data: TradeBar data
    if self.aapl in slice.bars:
        trade_bar = slice.bars[self.aapl]
        self.log(f"{self.aapl} close at {slice.time}: {trade_bar.close}")

    # Access data: QuoteBar data
    if self.aapl in slice.quote_bars:
        quote_bar = slice.quote_bars[self.aapl]
        self.log(f"{self.aapl} bid at {slice.time}: {quote_bar.bid.close}")

    # Access data: Ticks data
    if self.aapl in slice.ticks:
        ticks = slice.ticks[self.aapl]
        for tick in ticks:
            self.log(f"{self.aapl} price at {slice.time}: {tick.price}")
```

You can also iterate through all of the data objects in the current `Slice`.

```python
def on_data(self, slice: Slice) -> None:
    # Iterate all TradeBar received
    for symbol, trade_bar in slice.bars.items():
        self.log(f"{symbol} close at {slice.time}: {trade_bar.close}")

    # Iterate all QuoteBar received
    for symbol, quote_bar in slice.quote_bars.items():
        self.log(f"{symbol} bid at {slice.time}: {quote_bar.bid.close}")

    # Iterate all Ticks received
    for symbol, ticks in slice.ticks.items():
        for tick in ticks:
            self.log(f"{symbol} price at {slice.time}: {tick.price}")
```

For more information about accessing US Equities data, see [Handling Data](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/us-equity/handling-data.md).

## Historical Data

To get historical US Equity data, call the `history` method with the Equity `Symbol`. If there is no data in the period you request, the history result is empty.

```python
# DataFrame
history_df = self.history(self.aapl, 100, Resolution.DAILY)

# TradeBar objects
history_trade_bars = self.history[TradeBar](self.aapl, 100, Resolution.DAILY)

# QuoteBar objects
history_quote_bars = self.history[QuoteBar](self.aapl, 100, Resolution.MINUTE)

# Tick objects
history_ticks = self.history[Tick](self.aapl, timedelta(seconds=10), Resolution.TICK)
```

For more information about historical data, see [History Requests](https://www.quantconnect.com/docs/v2/writing-algorithms/historical-data/history-requests.md).

## Universe Selection

To select a universe of US Equities, see [Equity Universes](https://www.quantconnect.com/docs/v2/writing-algorithms/universes/equity.md).

## Remove Subscriptions

To unsubscribe from a US Equity that you added with the `add_equity` method, call the `remove_security` method.

```python
self.remove_security(self.aapl)
```

The `remove_security` method cancels your open orders for the security and liquidates your holdings.

## Supported Assets

To view the supported assets in the US Equities dataset, see the [Data Explorer](https://www.quantconnect.com/datasets/algoseek-us-equities/explorer). This dataset doesn't include Over-the-Counter (OTC) stocks.

## Downloading Data

You can download the US Equities dataset to your local machine to run the LEAN engine locally with the [LEAN CLI](https://www.quantconnect.com/docs/v2/lean-cli.md). For the download commands, prerequisites, and pricing, see [US Equity](https://www.quantconnect.com/docs/v2/lean-cli/datasets/quantconnect/us-equity.md) in the LEAN CLI documentation.

## Example Applications

The US Equities dataset enables you to accurately design Equity trading strategies. Examples include the following strategies:

- Momentum strategies using historical returns on the premise that the momentum will continue
- Value strategies using fundamental factors on the premise that the price of undervalued securities will rise
- Factor investing with periodic rebalancing

### Classic Algorithm Example

The following example algorithm buys and holds Apple stock:

```python
from AlgorithmImports import *

class USEquityDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2024, 9, 1)
        self.set_end_date(2024, 12, 31)
        self.set_cash(100000)

        # Requesting single equity data, since we only trade AAPL
        self.aapl = self.add_equity("AAPL", Resolution.DAILY).symbol

        # Historical data
        history = self.history(self.aapl, 60, Resolution.DAILY)
        self.debug(f"We got {len(history)} items from our history request")

    def on_data(self, slice: Slice) -> None:
        # Check if the current slice containing AAPL and if we hold any position
        # As we make use of the most updated price data to decide the order size
        if slice.contains_key(self.aapl) and slice[self.aapl] is not None and not self.portfolio.invested:
            self.set_holdings(self.aapl, 1)
```

### Framework Algorithm Example

The following example algorithm buys and holds Apple stock:

```python
from AlgorithmImports import *

class USEquityDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2024, 9, 1)
        self.set_end_date(2024, 12, 31)
        self.set_cash(100000)

        self.universe_settings.resolution = Resolution.DAILY
        # To select only AAPL, use a manual selection universe
        symbols = [Symbol.create("AAPL", SecurityType.EQUITY, Market.USA)]
        self.add_universe_selection(ManualUniverseSelectionModel(symbols))

        # Constant investment signal
        self.add_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(days=7), 0.025, None))

        # Invest in all members equally
        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())
```

## Data Point Attributes

The US Equities dataset provides `TradeBar`, `QuoteBar`, and `Tick` objects.

### TradeBar Attributes

`TradeBar` objects have the following attributes:

*Members of `QuantConnect.Data.Market.TradeBar` (JSON): https://www.quantconnect.com/services/inspector?type=T:QuantConnect.Data.Market.TradeBar&language=python*

### QuoteBar Attributes

`QuoteBar` objects have the following attributes:

*Members of `QuantConnect.Data.Market.QuoteBar` (JSON): https://www.quantconnect.com/services/inspector?type=T:QuantConnect.Data.Market.QuoteBar&language=python*

### Tick Attributes

`Tick` objects have the following attributes:

*Members of `QuantConnect.Data.Market.Tick` (JSON): https://www.quantconnect.com/services/inspector?type=T:QuantConnect.Data.Market.Tick&language=python*
