Buying and Selling Pressure (BASP)

Calculate the Buying and Selling Pressure (BASP), which shows whether buyers or sellers control the market.

It compares the distance of the close above the low (buying) and of the high above the close (selling) with their averages, weighted by volume.

The Buying Pressure is the distance of the close above the low, the Selling Pressure the distance of the high above the close. Each is divided by its own exponential moving average, so it shows whether the pressure is larger than usual, and multiplied by the volume relative to its average, so a session with heavy volume weighs more. A short EMA smooths both lines.

The formula is as follows:

\[\text{Relative Volume} = \frac{\text{Volume}}{\operatorname{EMA}(\text{Volume},\; \text{window})}\] \[\text{Buying Pressure} = \operatorname{EMA}\left(\frac{\text{Close} - \text{Low}}{\operatorname{EMA}(\text{Close} - \text{Low},\; \text{window})} \cdot \text{Relative Volume},\; \text{smooth\_window}\right)\] \[\text{Selling Pressure} = \operatorname{EMA}\left(\frac{\text{High} - \text{Close}}{\operatorname{EMA}(\text{High} - \text{Close},\; \text{window})} \cdot \text{Relative Volume},\; \text{smooth\_window}\right)\]

Both lines are ratios around 1 (the usual pressure on the usual volume). Buying pressure above selling pressure points to accumulation, and a crossing of the two to a change in who is in control.

Also known as: BASP, BASPN, normalized buying and selling pressure.

Example · AAPL, MSFT · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_buying_selling_pressure:

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["AAPL", "MSFT"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_buying_selling_pressure().xs("AAPL", level=1, axis="columns")

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

How did the buying and selling pressure on Apple's stock develop in 2025?

Which returns:

Parameters

get_buying_selling_pressure accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe time period to consider for historical data. Options are: “intraday” (intraday prices), “daily” (daily prices), “weekly” (weekly prices), “monthly” (monthly prices), “quarterly” (quarterly prices), “yearly” (yearly prices). Defaults to “daily”."weekly"
close_columnstrThe column name for closing prices in the historical data. Defaults to “Adj Close”, in which case the open, high and low prices are adjusted for dividends in the same way."Close"
windowintThe number of periods for the averages of the pressure and the volume. Defaults to 40.20
smooth_windowintThe number of periods for the EMA that smooths both lines. Defaults to 20; 1 gives the unsmoothed lines.5
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the indicator values. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column

References

  • Paper Williams, L.R. (1985). “The Ultimate Oscillator.” Technical Analysis of Stocks & Commodities, 3(4), for a similar buying pressure measured from the lower of the low and the previous close.
  • Library Referenced against finta’s BASP
  • Library Referenced against finta’s BASPN
Share