---
title: "Regulation SHO"
description: "Regulation SHO dataset from Financial Industry Regulatory Authority."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/financial-industry-regulatory-authority/regulation-sho
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/financial-industry-regulatory-authority/regulation-sho.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/14%20Datasets/20%20Financial%20Industry%20Regulatory%20Authority/02%20Regulation%20SHO
modified: 2026-10-26
index: https://www.quantconnect.com/llms.txt
---

# Regulation SHO

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Datasets > [Financial Industry Regulatory Authority](https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/financial-industry-regulatory-authority.md) > Regulation SHO

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

## Introduction

The Regulation SHO dataset by the Financial Industry Regulatory Authority (FINRA) tracks the daily off-exchange short sale volume of US Equities. The data covers 22,073 US Equities, starts in August 2018, and is delivered on a daily frequency. This dataset is created by processing the short sale volume that broker-dealers report to FINRA under Regulation SHO.

For more information about the Regulation SHO dataset, including CLI commands and pricing, see the [dataset listing](https://www.quantconnect.com/datasets/finra-reg-sho).

## About the Provider

The Financial Industry Regulatory Authority (FINRA) is a not-for-profit organization that oversees broker-dealers in the United States, under the supervision of the SEC. It was formed in 2007 when NASD merged with the member regulation arm of the New York Stock Exchange. Its mission is to protect investors and safeguard market integrity.

## Getting Started

The following snippet demonstrates how to request data from the FINRA Reg SHO Daily Short Sale Volume dataset:

```python
self._symbol = self.add_equity("AAPL", Resolution.DAILY).symbol
self.short_volume_symbol = self.add_data(FINRAShortSaleVolume, self._symbol).symbol
```

## Data Summary

The following table describes the dataset properties:

| Property | Value |
| --- | --- |
| Start Date | August 2018 |
| Asset Coverage | 22,073 US Equities |
| Data Density | Sparse |
| Resolution | Daily |
| Timezone | New York |

## Requesting Data

To add FINRA Reg SHO Daily Short Sale Volume data to your algorithm, call the `add_data` method. Save a reference to the dataset `Symbol` so you can access the data later in your algorithm.

```python
class FINRAShortSaleVolumeDataAlgorithm(QCAlgorithm):
    def initialize(self) -> None:
        self.set_start_date(2019, 1, 1)
        self.set_end_date(2020, 6, 1)
        self.set_cash(100000)

        self._symbol = self.add_equity("AAPL", Resolution.DAILY).symbol
        self.short_volume_symbol = self.add_data(FINRAShortSaleVolume, self._symbol).symbol
```

## Accessing Data

To get the current FINRA Reg SHO Daily Short Sale Volume data, index the current [`Slice`](https://www.quantconnect.com/docs/v2/writing-algorithms/key-concepts/time-modeling/timeslices.md) with the dataset `Symbol`. `Slice` objects deliver unique events to your algorithm as they happen, but the `Slice` may not contain data for your dataset 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:
    if slice.contains_key(self.short_volume_symbol):
        data_point = slice[self.short_volume_symbol]
        self.log(f"{self.short_volume_symbol} short volume at {slice.time}: {data_point.short_volume}")
```

To iterate through all of the dataset objects in the current `Slice`, call the `get` method.

```python
def on_data(self, slice: Slice) -> None:
    for dataset_symbol, data_point in slice.get(FINRAShortSaleVolume).items():
        self.log(f"{dataset_symbol} short volume at {slice.time}: {data_point.short_volume}")
```

## Historical Data

To get historical FINRA Reg SHO Daily Short Sale Volume data, call the `history` method with the dataset `Symbol`. If there is no data in the period you request, the history result is empty.

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

# Dataset objects
history_bars = self.history[FINRAShortSaleVolume](self.short_volume_symbol, 100, Resolution.DAILY)
```

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 dynamic universe of US Equities based on FINRA Reg SHO Daily Short Sale Volume data, call the `add_universe` method with the `FINRAShortSaleVolumeUniverse` class and a selection function.

```python
def initialize(self) -> None:
    self._universe = self.add_universe(FINRAShortSaleVolumeUniverse, self.universe_selection)

def universe_selection(self, alt_coarse: List[FINRAShortSaleVolumeUniverse]) -> List[Symbol]:
    return [d.symbol for d in alt_coarse \
                if d.short_volume_ratio is not None \
                and d.short_volume_ratio > 0.5]
```

For more information about dynamic universes, see [Universes](https://www.quantconnect.com/docs/v2/writing-algorithms/universes/key-concepts.md).

## Remove Subscriptions

To remove a subscription, call the `remove_security` method.

```python
self.remove_security(self.short_volume_symbol)
```

If you subscribe to FINRA Reg SHO Daily Short Sale Volume data for assets in a dynamic universe, remove the dataset subscription when the asset leaves your universe. To view a common design pattern, see [Track Security Changes](https://www.quantconnect.com/docs/v2/writing-algorithms/algorithm-framework/alpha/key-concepts.md#05-Track-Security-Changes).

## Example Applications

The Regulation SHO dataset enables you to monitor short selling in off-exchange trading. Examples include the following strategies:

- Selling stocks when short volume becomes an unusually large share of their total volume
- Ranking stocks by the share of their volume that is sold short
- Following stocks where short selling stays high for several days in a row

### Classic Algorithm Example

The following example algorithm short sells AAPL when its short volume ratio is above 0.5. Otherwise, it buys AAPL.

```python
from AlgorithmImports import *

class FINRAShortSaleVolumeDataAlgorithm(QCAlgorithm):
    def initialize(self):
        self.set_start_date(2019, 1, 1)
        self.set_end_date(2020, 6, 1)
        self.set_cash(100000)

        aapl = self.add_equity("AAPL", Resolution.DAILY).symbol
        self.short_volume_symbol = self.add_data(FINRAShortSaleVolume, aapl).symbol
        history = self.history(FINRAShortSaleVolume, self.short_volume_symbol, 60, Resolution.DAILY)

        self.debug(f"We got {len(history)} items from our history request")

    def on_data(self, slice):
        points = slice.get(FINRAShortSaleVolume)
        for point in points.values():
            # Go short when off-exchange short volume is more than half of total reported volume
            if point.short_volume_ratio is not None and point.short_volume_ratio > 0.5:
                self.set_holdings(point.symbol.underlying, -1)

            # Go long otherwise
            else:
                self.set_holdings(point.symbol.underlying, 1)
```

### Framework Algorithm Example

The following example algorithm emits a down insight for AAPL when its short volume ratio is above 0.5. Otherwise, it emits an up insight.

```python
from AlgorithmImports import *

class FINRAShortSaleVolumeFrameworkAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2019, 1, 1)
        self.set_end_date(2020, 6, 1)
        self.set_cash(100000)

        self.universe_settings.resolution = Resolution.DAILY

        symbols = [Symbol.create("AAPL", SecurityType.EQUITY, Market.USA)]
        self.set_universe_selection(ManualUniverseSelectionModel(symbols))

        self.add_alpha(FINRAShortPressureAlphaModel())

        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())
        self.set_execution(ImmediateExecutionModel())

class FINRAShortPressureAlphaModel(AlphaModel):

    def __init__(self, threshold: float = 0.5) -> None:
        self._threshold = threshold
        self._symbols_by_security = {}

    def update(self, algorithm: QCAlgorithm, data: Slice) -> List[Insight]:
        insights = []
        for security_symbol, short_volume_symbol in self._symbols_by_security.items():
            if short_volume_symbol not in data:
                continue
            ratio = data[short_volume_symbol].short_volume_ratio
            if ratio is None:
                continue
            direction = InsightDirection.DOWN if ratio > self._threshold else InsightDirection.UP
            insights.append(Insight.price(security_symbol, timedelta(days=7), direction))
        return insights

    def on_securities_changed(self, algorithm: QCAlgorithm, changes: SecurityChanges) -> None:
        for security in changes.added_securities:
            symbol = security.symbol
            short_volume_symbol = algorithm.add_data(FINRAShortSaleVolume, symbol).symbol
            self._symbols_by_security[symbol] = short_volume_symbol
            history = algorithm.history(FINRAShortSaleVolume, short_volume_symbol, 30, Resolution.DAILY)
            algorithm.debug(f"Got {len(history)} historical short sale volume rows for {symbol}")
        for security in changes.removed_securities:
            short_volume_symbol = self._symbols_by_security.pop(security.symbol, None)
            if short_volume_symbol is not None:
                algorithm.remove_security(short_volume_symbol)
```

## Data Point Attributes

The FINRA Reg SHO Daily Short Sale Volume dataset provides `FINRAShortSaleVolume` and `FINRAShortSaleVolumeUniverse` objects.

### FINRAShortSaleVolume

`FINRAShortSaleVolume` objects have the following attributes:

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

### FINRAShortSaleVolumeUniverse

`FINRAShortSaleVolumeUniverse` objects have the following attributes:

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