OPEN-SOURCE SCRIPT
DD Ratio

The DD Ratio (“Directional Distribution Ratio”) is a breadth indicator that shows, in real time, how many of the selected stocks (e.g., S&P 500 components) are bullish vs. bearish relative to today’s open.
The DD Ratio tells you what’s really happening under the hood of the index:
Futures may mislead: An index future (like ES or NQ) can rise on a few heavy-weighted stocks even while most components fall.
The DD Ratio exposes that divergence.
Breadth confirmation: When the futures are up and DD Ratio ≥ 0.5 → healthy rally.
When futures are up but DD Ratio < 0.5 → weak, narrow advance.
Intraday sentiment gauge: It updates live with each bar, reflecting “who’s winning” since the open.
The DD Ratio tells you what’s really happening under the hood of the index:
Futures may mislead: An index future (like ES or NQ) can rise on a few heavy-weighted stocks even while most components fall.
The DD Ratio exposes that divergence.
Breadth confirmation: When the futures are up and DD Ratio ≥ 0.5 → healthy rally.
When futures are up but DD Ratio < 0.5 → weak, narrow advance.
Intraday sentiment gauge: It updates live with each bar, reflecting “who’s winning” since the open.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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 TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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 TradingView. Read more in the Terms of Use.