PyInvesting
Back to research notes

Methods and evidence

What fewer stocks above a moving average means

When the percentage of stocks above a moving average falls, fewer stocks in the measured universe satisfy that trend rule. That is a loss of participation. It can accompany a broad sell-off, or it can happen while a few heavily weighted stocks keep an index rising. It does not, on its own, forecast the next market move.

Separate the level from the change

If 70 of 100 stocks are above their moving average, breadth is 70%. If the count later falls to 55, breadth is 55%: a decline of 15 percentage points. The reading still describes a majority of stocks above the threshold. A move from 30% to 45% has the opposite direction but a lower final level. Both pieces of information matter.

The moving average matters too. A short lookback usually reacts more quickly and can fluctuate more. PyInvesting's live breadth measure uses a 120-session exponential moving average, approximately six months. Do not relabel it as a 200-day simple-moving-average measure.

Correction notice: the study below uses the earlier calculation, which counted some stocks that were not yet eligible or lacked enough price history as downtrending. This distorted its breadth denominator. Its chart, counts and downloads remain unchanged as a record of that calculation; they are not the corrected index history.

Archived study using the earlier calculation: 1,038 weekly observations

We took a fixed snapshot of PyInvesting's public breadth series on 5 September 2026 and retained Friday calendar observations from 20 October 2006 through 4 September 2026. The resulting 1,038 observations describe the history of the stored indicator. They are not a return backtest or a reconstruction of a point-in-time constituent universe.

Archived weekly breadth using the earlier calculation, affected by the denominator error described above. Open the archived chart or CSV for detail.
Archived Friday readings using the earlier calculation, affected by the denominator error. The original dataset and calculation code are available below. Holidays may carry the latest stored reading.
Unchanged descriptive counts from the archived study using the earlier calculation
ObservationResult
All Friday observations1,038
Breadth strictly below 25%78 observations (7.5%)
Breadth strictly above 75%231 observations (22.3%)
2008 Friday observations below 25%28 of 52
2013 Friday observations above 75%34 of 52

The distribution was not uniform, and extreme readings clustered in particular years. That is a reason to avoid treating observations as independent coin flips. These counts say how often a reading appeared in this dataset; they do not say what the next week's return will be.

Reproduce or reuse the archived study

Download the archived weekly CSV, archived annual summary and provenance, original fixed breadth input, original Python calculation script and archived PNG chart. The script uses Python's standard library for the statistics and Matplotlib for the charts (tested with version 3.11.1). Running python build_breadth_study.py breadth-source.json output with the original input reproduces the archived calculation; it does not correct the earlier breadth calculation.

The fixed input preserves public breadth values captured from the chart's data endpoint on 5 September 2026. The summary includes that input's SHA-256 checksum. The updating endpoint is separate and must not replace the archived input when reproducing these counts. Each date is interpreted in UTC; we select Fridays, retain the displayed precision, and count values strictly below 25 or above 75. The first and last years are partial years. No future returns or optimized thresholds are included.

You may reuse the chart and study tables with attribution to PyInvesting and a link to this correction notice. Describe them as an archived study using the earlier calculation and affected by the denominator error, not the corrected index history or an extension of the updating series.

What the study cannot establish

The public series alone does not supply a constituent-by-constituent audit, historical membership snapshots or information-availability timestamps. It therefore cannot establish that survivorship bias, retrospective universe changes or revised prices are absent. Friday snapshots can miss moves within a week; holidays and repeated stored values do not create independent market observations.

To evaluate a trading rule, specify when the signal becomes known, what trades can occur afterward, the investable universe, transaction costs and an untouched evaluation period. The worked allocation example shows this separation. For a different sentiment measure, read breadth versus CNN's Fear & Greed Index.