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:
| Price Bin | Down Volume | High Price | Low Price | Total Volume | Up Volume |
|---|---|---|---|---|---|
| 1 | 281,326,000 | 182.632 | 171.236 | 281,326,000 | 0 |
| 2 | 354,266,000 | 194.028 | 182.632 | 354,266,000 | 0 |
| 3 | 1,256,670,000 | 205.424 | 194.028 | 2,795,070,000 | 1,538,410,000 |
| 4 | 940,298,000 | 216.820 | 205.424 | 2,324,310,000 | 1,384,020,000 |
| 5 | 829,322,000 | 228.216 | 216.820 | 1,589,980,000 | 760,656,000 |
| 6 | 1,108,740,000 | 239.612 | 228.216 | 2,112,050,000 | 1,003,310,000 |
| 7 | 332,909,000 | 251.008 | 239.612 | 1,009,770,000 | 621,122,000 |
| 8 | 348,740,000 | 262.404 | 251.008 | 981,495,000 | 632,755,000 |
| 9 | 725,819,000 | 273.800 | 262.404 | 1,472,120,000 | 746,301,000 |
| 10 | 238,447,000 | 285.196 | 273.800 | 623,550,000 | 385,104,000 |
10 rows
Parameters
get_volume_profile accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The 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_column | str | The column name for closing prices in the historical data. Defaults to “Adj Close”. | "Close" |
bins | int | The number of price bins of equal width. Defaults to 10. | 10 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
show_columns | str | list[str] | None | The 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 Steidlmayer, J.P. and Koy, K. (1986). “Markets and Market Logic.” Porcupine Press.
- Paper StockCharts ChartSchool, “Volume by Price” (https://chartschool.stockcharts.com/table-of-contents/technical-indicators-and-overlays/technical-overlays/volume-by-price).
- Library Referenced against pandas-ta-classic’s vp