PulseHub
OPEN-SOURCE SCRIPT

YURI Breadth Regime Engine

486
An index is capitalisation weighted. A handful of large members can hold the whole thing up while most of the list quietly breaks down underneath, and the price chart will not show you that, because the price chart is the weighted number. The count is a different number. This reads the count and tells you when the two have stopped agreeing.

THE TWO THINGS IT MEASURES

The level is how much of the list is participating right now. The default series is the percentage of S&P 500 members trading above their own 200 day moving average. Four bands: washout below 20, weak below 40, neutral below 60, strong above it. Below 20 has historically been forced selling rather than opinion, because most of the list is under its own annual average at the same time. Those readings cluster near the end of declines rather than the start. That is an observation about where they have occurred, not an instruction to buy them.

The participation read is a different question: is the index outrunning its own members. That is a question about speed rather than position, so each series measures how far it has moved over the same window and that move gets ranked against its own history. Percent for the index, because a 50 point move meant something different at 2000 than it does at 7000. Points for breadth, which is already bounded at 0 and 100. The gap between the two ranks is what gets read, and ranking is what makes a price and a percentage comparable at all.

Index in the top of its own distribution of moves while breadth is in the bottom of hers is thinning. Fewer names are carrying it. Breadth moving up harder than the index is broadening, and it is what the back end of a washout looks like.

Ranking positions instead of moves is the obvious way to build this and it does not work, which is worth saying because the failure is instructive. An index drifts upward, so its position rank pins at the top of its range for months at a time. That builds a permanent bias into the gap, and it quietly collapses the whole read into "breadth is low", which is something the level already tells you. A move measured over a fixed window is centred on its own history by construction, so it has neither problem.

WHY BOTH, AND NOT JUST THE LEVEL

The level tells you where participation is. It does not tell you which way it is going relative to price, so a level read is equally happy at 55 on the way up and 55 on the way down. The participation read tells you the direction of the disagreement but has no sense of absolute position, so it will call thinning at 75 and at 35 without distinguishing between them, and those are very different markets. Neither one is sufficient. Read together, the level says how much of the list is in, and the rank gap says whether that number is keeping up.

THE PART THAT ACTUALLY MATTERS

A new participation state has to hold for several bars before it replaces the current one.

Drop that and this becomes a threshold that flips every time the rank gap wobbles across the line, and within a month you have learned to ignore it. The hold period is the difference between a regime read and a flicker. It is exposed in the inputs. One bar makes it reactive and noisy, ten makes it stubborn and late, and there is no correct answer, only the one that matches how often you are willing to change your mind.

READING IT

The line is the breadth percentage, coloured by band. Red zone is washout, teal zone is strong.

Orange triangle near the top of the pane: participation just turned thinning.

Teal triangle near the bottom: participation just turned broadening.

The table carries the live reading, the current band, how many bars breadth has been sitting under the washout line, and the participation state with the raw rank gap in brackets. That bracketed number is worth watching on its own, because it moves before the label does. A gap climbing through the high twenties tells you the state is about to be named while the hold period is still counting.

SETTINGS THAT MATTER

The breadth series and the index have to be the same index or the comparison is noise. The default pairing is INDEX:S5TH against SP:SPX. If you switch to a Nasdaq or Russell breadth series, switch the index with it.

The move window sets what counts as "has moved". Shorter makes the participation read sensitive to swings inside a trend, longer makes it a read on the trend itself. The ranking window sets how much history each move is judged against, and nothing reads at all until both windows have filled.

The thinning and broadening gaps are separate inputs because there is no reason the two sides have to share a number. Left equal at 30 they fire about as often as each other, so if you want one side more sensitive, move that one and leave the other alone.

WHAT IT WILL NOT DO

It does not generate entries or exits, and it is not a forecast. It describes the state of participation as of the current bar, and what you do with that is your method, not mine.

The breadth series prints once a day and has no intraday history. On an intraday chart the daily value is pulled instead, so the line steps rather than curves and the current day's value keeps moving until the close. It settles when the day does. Daily or higher is where this is meant to run.

If the external series is unavailable on your plan or your symbol, the pane turns orange and the table reads NA rather than plotting a flat line that could be mistaken for a real value.

Breadth is a coincident measure of participation, not a leading one. Washouts are identifiable in hindsight far more cleanly than they are while you are standing in one, and a thinning read can persist for months in a market that keeps going up. This is context for a decision, not the decision.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.