OPEN-SOURCE SCRIPT
Distribution Day Grading [Blk0ut]

Distribution Day Grading
This script is designed to give traders and investors a fast, objective, and modern read on market health by analyzing distribution days, and stall days, two forms of institutional selling that often begin to appear before trend weakness, failed breakouts, and sharp corrections.
The goal of this script isn’t to predict tops or bottoms, but instead, it measures the character of the tape in a way that’s simple, visual, and immediately actionable.
While distribution analysis has existed for decades, my implementation is, I think, a little more adaptive. Traditional rules for identifying distribution days, coming from CANSLIM methodology, were built for markets which had lower volatility, different liquidity profiles, and slower institutional rotation. This script updates the traditional method with modernized thresholds, recency-weighted decay, stall-day logic, and dynamic presets tuned uniquely for the personality of each major U.S. index (you can change the values yourself as well).
The results are displayed as a compact letter-grade that quantitatively reflects a measure of how much institutional supply has been hitting the market, as well as how recently. This helps determine whether conditions are supportive of breakouts, mean reversion trades, aggressive trend trades, or whether caution and lighter sizing are warranted.
__________________________________________________________________________________
How It Works
The script evaluates each bar for two conditions:
1. Distribution Day
A bar qualifies as distribution when:
- Price closes down beyond a threshold (default 0.30%, adjustable)
- Volume is higher than the prior session (optional toggle)
Distribution days typically represent active institutional selling.
2. Stall Day
A softer form of supply:
-Price remains flat to slightly negative within a small threshold
-Close < open
-Volume higher than prior day
Stall days represent a passive distribution or hidden supply.
Each distribution day is counted as 1 unit by the script, each stall day as 0.5 units.
Recency Weighting
The script applies an optional half-life decay so that fresh distribution matters more than old distribution. This mimics the “aging out” effect that professional traders use, but does it in a smoother, more mathematically consistent way.
The script then produces:
A weighted distribution score
A raw distribution + stall count
A letter grade from A → F
Let's talk about the letters...
_________________________________________________________________________________
Letter Grade Meaning
A — Very Healthy Tape
Minimal institutional selling.
Breakouts behave better, momentum holds, pullbacks are shallow, upside targets are hit more consistently.
B — Healthy / Slight Caution
Some isolated supply but nothing structural.
Conditions remain favorable for trend trades, pullbacks, and breakout continuation.
C — Mixed / Caution Warranted
Distribution is building.
Breakouts begin to fail faster, candles widen, rotation becomes unstable, and risk/reward compresses.
D — Weak / Risk Elevated
Institutional selling is becoming persistent.
Failed breakouts, sharp reversals, and failed rallies become more common. Position sizing should tighten.
F — Clear Deterioration
Broad, repeated institutional distribution.
This is where major tops, deeper pullbacks, and corrections often begin to form underneath the surface.
_________________________________________________________________________________
Index-Tuned Presets (Auto Mode)
Market structure varies dramatically across indices.
To address this, the script includes auto-detect presets for:
SPY / SPX equivalents
QQQ / NASDAQ-100 equivalents
IWM / Russell 2000 equivalents
DIA / Dow 30 equivalents
Each preset contains optimized values based on volatility, liquidity, noise, and institutional behavior:
SPY / SPX
Low noise, deep liquidity → classic thresholds work well.
Distribution thresholds remain conservative.
QQQ
Higher volatility → requires a slightly larger down-percentage filter to avoid false signals.
IWM
Noisiest of the major indices → requires much stricter thresholds to filter out junk signals.
DIA
Slowest-moving index → tighter conditions catch real distribution earlier.
The script automatically detects which symbol family you’re viewing and loads the appropriate preset unless manual overrides are enabled.
__________________________________________________________________________________
How to Interpret This Indicator
Grade A–B:
Breakouts have higher odds of clean continuation
Mean reversion is smoother
Position sizing can be more assertive
Grade C:
Start tightening risk
Focus on A- setups, not B- or C- risk ideas
Grade D–F:
Expect lower win rates
Expect breakout failures
Favor countertrend plays or reduced exposure
Take faster profits
____________________________
This indicator should help traders prevent themselves from fighting the tape or sizing aggressively when the underlying environment is deteriorating through:
- Modernized distribution logic, not the 1990s thresholds
- Recency-weighted decay instead of the old 5-week “aging out”
- Stall-day detection for subtle institutional supply
- Auto-presets tuned per index, adjusting thresholds to match volatility and liquidity
- Unified letter-grade scoring for visual clarity
- Independent application for any trading style, it helps with trend, momentum, mean reversion, and options
_________________________________________________________________________________
Keep in mind: This script is provided strictly for educational and informational purposes.
Nothing in this indicator constitutes financial advice, trading advice, investment guidance, or a recommendation to buy or sell any security, option, cryptocurrency, or financial instrument.
No indicator should ever be used as the sole basis for a trading or investment decision.
Markets carry risk. Past performance does not predict future results.
Always perform your own analysis, use proper risk management, and consult a licensed professional if you need advice specific to your financial situation.
Happy Trading!
Blk0uts
This script is designed to give traders and investors a fast, objective, and modern read on market health by analyzing distribution days, and stall days, two forms of institutional selling that often begin to appear before trend weakness, failed breakouts, and sharp corrections.
The goal of this script isn’t to predict tops or bottoms, but instead, it measures the character of the tape in a way that’s simple, visual, and immediately actionable.
While distribution analysis has existed for decades, my implementation is, I think, a little more adaptive. Traditional rules for identifying distribution days, coming from CANSLIM methodology, were built for markets which had lower volatility, different liquidity profiles, and slower institutional rotation. This script updates the traditional method with modernized thresholds, recency-weighted decay, stall-day logic, and dynamic presets tuned uniquely for the personality of each major U.S. index (you can change the values yourself as well).
The results are displayed as a compact letter-grade that quantitatively reflects a measure of how much institutional supply has been hitting the market, as well as how recently. This helps determine whether conditions are supportive of breakouts, mean reversion trades, aggressive trend trades, or whether caution and lighter sizing are warranted.
__________________________________________________________________________________
How It Works
The script evaluates each bar for two conditions:
1. Distribution Day
A bar qualifies as distribution when:
- Price closes down beyond a threshold (default 0.30%, adjustable)
- Volume is higher than the prior session (optional toggle)
Distribution days typically represent active institutional selling.
2. Stall Day
A softer form of supply:
-Price remains flat to slightly negative within a small threshold
-Close < open
-Volume higher than prior day
Stall days represent a passive distribution or hidden supply.
Each distribution day is counted as 1 unit by the script, each stall day as 0.5 units.
Recency Weighting
The script applies an optional half-life decay so that fresh distribution matters more than old distribution. This mimics the “aging out” effect that professional traders use, but does it in a smoother, more mathematically consistent way.
The script then produces:
A weighted distribution score
A raw distribution + stall count
A letter grade from A → F
Let's talk about the letters...
_________________________________________________________________________________
Letter Grade Meaning
A — Very Healthy Tape
Minimal institutional selling.
Breakouts behave better, momentum holds, pullbacks are shallow, upside targets are hit more consistently.
B — Healthy / Slight Caution
Some isolated supply but nothing structural.
Conditions remain favorable for trend trades, pullbacks, and breakout continuation.
C — Mixed / Caution Warranted
Distribution is building.
Breakouts begin to fail faster, candles widen, rotation becomes unstable, and risk/reward compresses.
D — Weak / Risk Elevated
Institutional selling is becoming persistent.
Failed breakouts, sharp reversals, and failed rallies become more common. Position sizing should tighten.
F — Clear Deterioration
Broad, repeated institutional distribution.
This is where major tops, deeper pullbacks, and corrections often begin to form underneath the surface.
_________________________________________________________________________________
Index-Tuned Presets (Auto Mode)
Market structure varies dramatically across indices.
To address this, the script includes auto-detect presets for:
SPY / SPX equivalents
QQQ / NASDAQ-100 equivalents
IWM / Russell 2000 equivalents
DIA / Dow 30 equivalents
Each preset contains optimized values based on volatility, liquidity, noise, and institutional behavior:
SPY / SPX
Low noise, deep liquidity → classic thresholds work well.
Distribution thresholds remain conservative.
QQQ
Higher volatility → requires a slightly larger down-percentage filter to avoid false signals.
IWM
Noisiest of the major indices → requires much stricter thresholds to filter out junk signals.
DIA
Slowest-moving index → tighter conditions catch real distribution earlier.
The script automatically detects which symbol family you’re viewing and loads the appropriate preset unless manual overrides are enabled.
__________________________________________________________________________________
How to Interpret This Indicator
Grade A–B:
Breakouts have higher odds of clean continuation
Mean reversion is smoother
Position sizing can be more assertive
Grade C:
Start tightening risk
Focus on A- setups, not B- or C- risk ideas
Grade D–F:
Expect lower win rates
Expect breakout failures
Favor countertrend plays or reduced exposure
Take faster profits
____________________________
This indicator should help traders prevent themselves from fighting the tape or sizing aggressively when the underlying environment is deteriorating through:
- Modernized distribution logic, not the 1990s thresholds
- Recency-weighted decay instead of the old 5-week “aging out”
- Stall-day detection for subtle institutional supply
- Auto-presets tuned per index, adjusting thresholds to match volatility and liquidity
- Unified letter-grade scoring for visual clarity
- Independent application for any trading style, it helps with trend, momentum, mean reversion, and options
_________________________________________________________________________________
Keep in mind: This script is provided strictly for educational and informational purposes.
Nothing in this indicator constitutes financial advice, trading advice, investment guidance, or a recommendation to buy or sell any security, option, cryptocurrency, or financial instrument.
No indicator should ever be used as the sole basis for a trading or investment decision.
Markets carry risk. Past performance does not predict future results.
Always perform your own analysis, use proper risk management, and consult a licensed professional if you need advice specific to your financial situation.
Happy Trading!
Blk0uts
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.