Advancers/Decliners Ratio
Calculate the Advancers/Decliners ratio for a given price series.
The Advancers/Decliners ratio is a breadth indicator that measures the number of advancing stocks (stocks with positive price changes) versus the number of declining stocks (stocks with negative price changes).
The formula is as follows:
\[\text{Advancers} / \text{Decliners} = \text{Advancers} / \text{Decliners}\]Also known as: advance decline ratio, market breadth.
Advancers/Decliners Ratio in Python
get_advancers_decliners is part of the Technicals module of the open-source Finance Toolkit. Install it with:
pip install financetoolkit -U
Then call get_advancers_decliners as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(tickers=["AAPL", "MSFT"])
toolkit.technicals.get_advancers_decliners()
Which returns:
| Date | AAPL | MSFT | Benchmark |
|---|---|---|---|
| 2026-06-18 | 298.01 | 379.4 | 746.74 |
| 2026-06-22 | 297.01 | 367.34 | 744.39 |
| 2026-06-23 | 294.3 | 373.94 | 733.58 |
| 2026-06-24 | 293.08 | 365.46 | 733.24 |
| 2026-06-25 | 275.15 | 352.83 | 734.3 |
| 2026-06-26 | 283.78 | 372.97 | 728.99 |
| 2026-06-29 | 281.74 | 368.57 | 741 |
| 2026-06-30 | 289.36 | 373.02 | 746.77 |
| 2026-07-01 | 294.38 | 384.28 | 745.76 |
| 2026-07-02 | 308.63 | 390.49 | 744.78 |
Parameters
get_advancers_decliners accepts the following parameters:
- period (str, optional): The time period to consider for historical data. Can be “daily”, “weekly”, “quarterly”, or “yearly”. Defaults to “daily”.
- close_column (str, optional): The name of the column containing the close prices. Defaults to “Adj Close”.
- rounding (int | None, optional): The number of decimals to round the results to. Defaults to 4.
- growth (bool, optional): Whether to calculate the growth of the indicator values. Defaults to False.
- lag (int | list[int], optional): The lag to use for the growth calculation.
- standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. Defaults to 1.