Market Breadth
Calculate the breadth of the market the Toolkit’s tickers make up: how many of them take part in a move. An index can rise on the strength of a few large companies while most of its members fall; breadth shows that divergence, which often comes before the index itself turns. Breadth is most meaningful across many tickers, such as the constituents of an index, which Discovery.get_index_constituents lists (e.g. the 500 tickers of the S&P 500). Those are today’s members: breadth of past dates computed from them leaves out the companies that were removed from the index since (often after falling behind), so it is biased towards the survivors, the further back the more.
Per date it returns:
- Advancers, Decliners and Unchanged: the number of tickers whose close rose, fell or stayed the same, and the Net Advances.
- Advance-Decline Line: the running total of the net advances. A rising index with a falling line is the classic negative divergence.
- Advance-Decline Ratio: the advancers divided by the decliners.
- McClellan Oscillator: the ratio-adjusted version, the 19-period minus the 39-period exponential moving average (smoothing constants of 0.10 and 0.05) of the net advances divided by advancers plus decliners (times 1,000); unchanged issues are left out. Each average starts from the simple average of its first 19 or 39 values, so the oscillator starts once the 39-period average exists (NaN before), as does its running total, the McClellan Summation Index.
- Percentage Above the short and long moving average: the share of tickers trading above their 50 and 200-period average, a gauge of how broad a trend is.
- New Highs and New Lows: the tickers whose close is above the highest (below the lowest) close of the previous
high_low_window- 1 periods, so the highest or lowest of the lasthigh_low_windowperiods; a close that only equals the previous high is no new high. NaN until at least one ticker has a full window.
The Benchmark (and a Portfolio) are left out.
For more information, see the following book:
- McClellan, S. and McClellan, M. (1970). “Patterns for Profit: The McClellan Oscillator and Summation Index.” Trade Levels Inc.
Also known as: market breadth, advance-decline line, McClellan oscillator, percentage above 200-day moving average, new highs new lows.
Market Breadth in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_market_breadth as shown below.
from financetoolkit import Discovery, Toolkit
discovery = Discovery(api_key="FINANCIAL_MODELING_PREP_KEY")
constituents = discovery.get_index_constituents("Dow Jones")
toolkit = Toolkit(
constituents.index.tolist(),
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2024-01-01",
end_date="2025-12-31",
)
toolkit.technicals.get_market_breadth().tail()
Or, after setting up the Finance Toolkit MCP, ask:
How did the market breadth of the 30 members of the Dow Jones Industrial Average develop from 24 to 31 December 2025, based on prices from the start of 2024?
Which returns:
| Date | Advancers | Decliners | Unchanged | Net Advances | Advance-Decline Line | Advance-Decline Ratio | McClellan Oscillator | McClellan Summation Index | Percentage Above 50-Period Average | Percentage Above 200-Period Average | New Highs | New Lows |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2025-12-24 | 26 | 3 | 1 | 23 | 978 | 8.6667 | 65.5048 | -814.088 | 0.7333 | 0.8 | 3 | 0 |
| 2025-12-26 | 14 | 16 | 0 | -2 | 976 | 0.875 | 49.8424 | -764.246 | 0.7 | 0.8 | 1 | 0 |
| 2025-12-29 | 10 | 20 | 0 | -10 | 966 | 0.5 | 22.8684 | -741.377 | 0.7333 | 0.8 | 0 | 0 |
| 2025-12-30 | 9 | 21 | 0 | -12 | 954 | 0.4286 | -3.642 | -745.019 | 0.7 | 0.8 | 0 | 0 |
| 2025-12-31 | 3 | 27 | 0 | -24 | 930 | 0.1111 | -46.2902 | -791.309 | 0.5667 | 0.8 | 0 | 0 |
Parameters
get_market_breadth 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" |
short_window | int | The short moving average window. Defaults to 50. | 50 |
long_window | int | The long moving average window. Defaults to 200. | 200 |
high_low_window | int | None | The number of periods, including the current one, of the new highs and lows. Defaults to None, which uses a year of periods: 252 daily, 52 weekly, 12 monthly, 4 quarterly and 1 yearly (too short for a new high or low, so those stay NaN), and 252 for intraday data. | None, which uses a year of periods: 252 daily, 52 weekly, 12 monthly, 4 quarterly and 1 yearly (too short for a new high or low, so those stay NaN), and 252 for intraday data |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit. | 2 |