TRIN (Arms Index)
Calculate the TRIN (Arms Index) for a given price series.
TRIN compares the ratio of advancing to declining issues against the ratio of volume in advancing issues to volume in declining issues. It is a market-wide breadth reading computed across all tickers in the Toolkit instance (excluding the synthetic “Portfolio” and “Benchmark” columns), and the resulting single reading is broadcast to every ticker column so it lines up with the other breadth indicators.
The formula is as follows:
\[\text{TRIN} = (\text{Advancing Issues} / \text{Declining Issues}) / (\text{Advancing Volume} / \text{Declining Volume})\]A TRIN below 1 means the volume in rising stocks outweighs their number, which is read as buying pressure, and above 1 as selling pressure; readings far above 2 tend to come with capitulation days. It is meant for a broad universe, such as all stocks of an exchange. Calculated across a handful of tickers it jumps between extremes and is undefined on days when none of them fell.
Also known as: Arms Index, TRIN.
TRIN (Arms Index) in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_trin as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
tickers=["XLK", "XLF", "XLE", "XLV", "XLY", "XLP", "XLI", "XLB", "XLU", "XLRE", "XLC"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2025-01-01",
end_date="2025-12-31",
)
# TRIN is one market-wide reading, repeated in every ticker column
toolkit.technicals.get_trin().loc[:, ["XLK"]].tail(5)
Or, after setting up the Finance Toolkit MCP, ask:
Measured across the 11 Select Sector SPDR ETFs (XLK, XLF, XLE, XLV, XLY, XLP, XLI, XLB, XLU, XLRE and XLC) as one market, how did the Arms Index (TRIN) move from 24 to 31 December 2025?
Which returns:
| Date | XLK |
|---|---|
| 2025-12-24 | 2.485 |
| 2025-12-26 | 1.6498 |
| 2025-12-29 | 0.6578 |
| 2025-12-30 | 0.6376 |
| 2025-12-31 | nan |
Parameters
get_trin accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The time period to consider for historical data. Can be “intraday”, “daily”, “weekly”, “monthly”, “quarterly” or “yearly”. Defaults to “daily”. | "weekly" |
close_column | str | The name of the column containing the close prices. Defaults to “Adj Close”. | "Close" |
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 |
growth | bool | Whether to calculate the growth of the indicator values. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |