OPEN-SOURCE SCRIPT

IBD Distribution Tracker

311
Indicator Summary: IBD Distribution & Stalling Tracker
The Goal:
This custom TradingView indicator is designed to automatically detect and track "Distribution Days"—a core concept from William O'Neil and Investor's Business Daily (IBD). A distribution day signals that large institutions (mutual funds, hedge funds, banks) are actively selling and locking in profits, which often precedes a market correction.

What Triggers a Warning Day?
The script monitors the daily price action and volume, flagging a day if it meets any of the following three conditions:

Standard Distribution: The price drops by 0.2% or more, and the trading volume is higher than the previous day.

Churning: Heavy volume pushes into the market, but the price stalls and closes in the lower 50% of its daily range (this catches hidden selling on days that might technically close "green").

Stalling: Trading volume surges above the 25-day moving average, but the price barely moves, gaining less than 0.2% (indicating heavy overhead supply capping the advance).

The "Smart" 25-Day Memory (The 5% Rule):
Instead of just counting every bad day forever, the script utilizes a dynamic 25-day rolling window with an intelligent invalidation rule.

It keeps a running tally of valid distribution days over the last 5 weeks.

Invalidation: If the market manages to rally and close 5% higher than the closing price of a previous distribution day, that specific day is considered "defeated" by the bulls. The script automatically wipes it from the running count, ensuring the data is never skewed by old, irrelevant sell-offs.

Visual Outputs:

Chart Markers: Any day that triggers one of the three conditions has its candle colored purple and is marked with a purple downward triangle for quick visual scanning.

Live Dashboard: A clean, on-screen table sits in the top right corner of the chart, displaying the current tally of valid distribution days. If the count hits 5 or more (the traditional IBD danger zone), the text flashes red to warn of elevated market risk.

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.