Time Segmented Volume

Calculate the Time Segmented Volume (TSV): the money flowing in or out over a window, the price change of each period times its volume, which shows accumulation above zero and distribution below.

The Time Segmented Volume of Worden Brothers sums the price change of each period weighted by its volume over a window. Where the On-Balance Volume adds the whole volume of an up period, the TSV weighs it by how far the price moved, so a large move on heavy volume counts more than a small one. A crossing of the zero line, or of its signal line, is read as a change from accumulation to distribution or back, and a divergence from the price as a warning that the move lacks money behind it.

The formula is as follows:

\[\text{TSV} = \text{Sum}((\text{Close}_{t} - \text{Close}_{t-1}) \cdot \text{Volume}_{t}, \texttt{window})\] \[\text{Signal Line} = \text{SMA}(\text{TSV}, \texttt{signal\_window})\]

Also known as: TSV, Time Segmented Volume.

Example · AAPL · 2021 to 2025

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

from financetoolkit import Toolkit

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

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

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

What were Apple's time segmented volume and its signal line over the last five trading days of 2025, with data from 2021?

Which returns:

Parameters

get_time_segmented_volume 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"
windowintThe number of periods of the sum. Defaults to 18.20
signal_windowintThe number of periods of the signal line. 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
growthboolWhether to calculate the growth of the Time Segmented Volume. 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
transformstr | list[str] | NoneTime series steps applied in order, such as “sma:12” (moving average), “ema:12”, “std:12”, “zscore:60”, “percentile:120”, “yoy”, “pct_change:3,annualize:3”, “log”, “diff”, “cumsum” or “hp_trend” and “hp_cycle” (Hodrick-Prescott), before growth. A window needs that many periods of history, so the first periods can be empty. Defaults to None.None
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