OPEN-SOURCE SCRIPT
Updated OBV Trend Candles

OBV Trend Candles
This indicator colors your candles based on the relationship between On-Balance Volume (OBV) and a moving average of OBV. It's a simple way to keep volume-based trend context visible directly on the price chart, without having to watch a separate OBV pane.
How it works
OBV accumulates volume on up-closes and subtracts it on down-closes, so a rising OBV means volume is flowing into the asset and a falling OBV means it's flowing out. This script takes that OBV line and compares it to a simple moving average of itself:
When OBV is above its SMA, volume momentum is building → candles are painted green.
When OBV is below its SMA, volume momentum is fading → candles are painted red.
The idea is that volume often shifts before or alongside price, so the color flips can give you a read on whether the current move is backed by participation.
The Sensitivity input
The single setting that matters is Sensitivity, which is the length of the SMA applied to OBV. Lower values make the indicator react faster to changes in volume flow (more color flips, more noise), while higher values smooth things out and only flip on more established shifts. Tune it to your timeframe and trading style — there's no universally "correct" value.
Notes
It works on any timeframe and any asset, as long as that asset reports volume data. On symbols without volume (some forex pairs and certain indices), OBV can't be calculated and the script will let you know. Colors are fully customizable in the settings.
This is a context/confirmation tool, not a standalone signal — it tells you about volume flow, not where to enter or exit. Use it alongside your own analysis.
This indicator colors your candles based on the relationship between On-Balance Volume (OBV) and a moving average of OBV. It's a simple way to keep volume-based trend context visible directly on the price chart, without having to watch a separate OBV pane.
How it works
OBV accumulates volume on up-closes and subtracts it on down-closes, so a rising OBV means volume is flowing into the asset and a falling OBV means it's flowing out. This script takes that OBV line and compares it to a simple moving average of itself:
When OBV is above its SMA, volume momentum is building → candles are painted green.
When OBV is below its SMA, volume momentum is fading → candles are painted red.
The idea is that volume often shifts before or alongside price, so the color flips can give you a read on whether the current move is backed by participation.
The Sensitivity input
The single setting that matters is Sensitivity, which is the length of the SMA applied to OBV. Lower values make the indicator react faster to changes in volume flow (more color flips, more noise), while higher values smooth things out and only flip on more established shifts. Tune it to your timeframe and trading style — there's no universally "correct" value.
Notes
It works on any timeframe and any asset, as long as that asset reports volume data. On symbols without volume (some forex pairs and certain indices), OBV can't be calculated and the script will let you know. Colors are fully customizable in the settings.
This is a context/confirmation tool, not a standalone signal — it tells you about volume flow, not where to enter or exit. Use it alongside your own analysis.
Release Notes
Adding a color flip transition selector.Release Notes
Small display adjustmentRelease Notes
Changed the indicator names to OBV Trend DetectionOpen-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.
atreidis.app/ Know what regime Bitcoin is in, daily.
Built by a Bitcoiner who got tired of riding the chart down 70%+ every cycle. One dashboard. One color-coded signal. Read the market at a glance.
Built by a Bitcoiner who got tired of riding the chart down 70%+ every cycle. One dashboard. One color-coded signal. Read the market at a glance.
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.
atreidis.app/ Know what regime Bitcoin is in, daily.
Built by a Bitcoiner who got tired of riding the chart down 70%+ every cycle. One dashboard. One color-coded signal. Read the market at a glance.
Built by a Bitcoiner who got tired of riding the chart down 70%+ every cycle. One dashboard. One color-coded signal. Read the market at a glance.
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.