Skip to content
All library documents

Building an Equity Universe with Liquidity and Price Screens

Article Strategy library · Author: QuantRocket

Summary

This document presents two filters for constructing an equity research universe. The first selects domestic common stocks from a securities master and excludes secondary shares. It is intended as the pipeline’s initial universe, defining which securities are eligible for subsequent analysis.

The second filter removes stocks that lack reported trading volume or trade at low prices: a security must have positive volume and a closing price above one dollar on every day in a 21-day lookback. The filter can serve as a pipeline screen or as a mask applied to factors. Together, the rules offer a basic way to narrow a stock dataset before computing signals, with the price and volume conditions acting as simple liquidity and penny-stock screens. The document supplies implementation logic but no evidence that these thresholds improve returns or execution. The fixed price cutoff and lookback may also need adjustment for the market, data source, and research objective.

Key ideas

  • A securities-master category can be used to restrict a pipeline to domestic common stocks and exclude secondary shares.
  • The base screen requires positive volume throughout a 21-day lookback.
  • The screen also requires closing prices above one dollar throughout that lookback.
  • The resulting filter can be applied as a pipeline screen or factor mask.
  • These simple eligibility rules do not establish that a universe is investable or that its thresholds suit every strategy.

Tags

Full text
# universe


# universe









## Source (Apache-2.0)

```python
# Copyright 2024 QuantRocket LLC - All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from zipline.pipeline import master, EquityPricing

def CommonStocks():
    """
    Return a Pipeline filter that is limited to domestic common stocks, excluding
    secondary shares. This filter is intended to be used as the initial_universe
    of the Pipeline.
    """
    category = master.SecuritiesMaster.sharadar_Category.latest
    common_stocks = (
        # domestic common stocks
        category.has_substring("Domestic Common")
        # no secondary shares
        & ~category.has_substring("Secondary")
    )
    return common_stocks

def BaseUniverse():
    """
    Return a Pipeline filter that excludes illiquid stocks and penny stocks.
    This filter is intended to be used as the screen of the Pipeline or the
    mask of factors in the Pipeline.
    """
    base_universe = (EquityPricing.volume.latest > 0).all(21)
    base_universe = (EquityPricing.close.latest > 1.00).all(21, mask=base_universe)

    return base_universe

```

Shown in full with attribution under the source's licence. Licence: Apache-2.0

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.