Volume Profile

Calculate the Volume Profile (Volume by Price) between the start and end date: how much volume traded at each price level, which shows the prices the market accepted most.

The Volume Profile is not a series over time but a histogram: it divides the range of the closes between the start and end date into price bins of equal width and adds up the volume traded at a close in each bin, split into the volume of up closes and that of down closes.

The formula is as follows:

\[\text{Bin edges} = \min(\text{Close}) + \frac{k \cdot (\max(\text{Close}) - \min(\text{Close}))}{\text{bins}},\;\; \text{for}\;\; k = 0 \;\text{to bins}\] \[\text{Up Volume} = \operatorname{Sum}(\text{Volume of the periods with Close} > \operatorname{Close}(t-1) \;\text{and the Close in the bin})\] \[\text{Down Volume} = \operatorname{Sum}(\text{Volume of the periods with Close} < \operatorname{Close}(t-1) \;\text{and the Close in the bin})\] \[\text{Total Volume} = \operatorname{Sum}(\text{Volume of all periods with the Close in the bin})\]

Bins with a lot of volume are prices at which many positions were opened, which tend to act as support or resistance when price returns to them; the bin with the most volume is the point of control. More up than down volume in a bin suggests the positions opened there were mostly purchases.

Also known as: VP, Volume by Price, Volume at Price, Market Profile.

Example · AAPL, MSFT · 2025

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

from financetoolkit import Toolkit

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

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

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

At which price levels did Apple's stock trade the most volume in 2025?

Which returns:

Parameters

get_volume_profile 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”."Close"
binsintThe number of price bins of equal width. Defaults to 10.10
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
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

Share