OPEN-SOURCE SCRIPT
Volume Trend Color

This indicator colors volume bars according to trend context
instead of individual candle direction.
How it works
- A moving average of volume defines the reference level
(yellow line).
- A second moving average on price defines trend direction.
- Bars are green when price trades above the trend MA, red
when below, and gray when volume falls under the
low-volume threshold.
Why color by trend rather than by candle
Coloring volume by candle direction repeats information
already visible on the price chart: a red candle produces a
red bar, and nothing is added. Coloring by trend context
instead answers a different question, namely whether
participation is arriving in the direction the reader is
already tracking. A pullback inside an uptrend will show
red candles but green volume bars, which makes it easy to
separate a pause in an ongoing move from a genuine loss of
participation. The neutral gray state marks bars where
volume is too low to support either reading.
Settings
- Volume MA length: reference average for volume.
- Low-volume threshold: fraction of the volume MA below
which a bar is treated as noise. Raise it to filter more
aggressively.
- Trend MA length: default 50. Shorten it on fast intraday
charts if the color state lags the moves being traded.
- Trend MA type: EMA or SMA.
- Trend source: price series used for the trend MA.
Alerts
Two conditions are available: volume above its average
while price is above the trend MA, and the same while
price is below it.
This script is for chart analysis only and is not
investment advice.
instead of individual candle direction.
How it works
- A moving average of volume defines the reference level
(yellow line).
- A second moving average on price defines trend direction.
- Bars are green when price trades above the trend MA, red
when below, and gray when volume falls under the
low-volume threshold.
Why color by trend rather than by candle
Coloring volume by candle direction repeats information
already visible on the price chart: a red candle produces a
red bar, and nothing is added. Coloring by trend context
instead answers a different question, namely whether
participation is arriving in the direction the reader is
already tracking. A pullback inside an uptrend will show
red candles but green volume bars, which makes it easy to
separate a pause in an ongoing move from a genuine loss of
participation. The neutral gray state marks bars where
volume is too low to support either reading.
Settings
- Volume MA length: reference average for volume.
- Low-volume threshold: fraction of the volume MA below
which a bar is treated as noise. Raise it to filter more
aggressively.
- Trend MA length: default 50. Shorten it on fast intraday
charts if the color state lags the moves being traded.
- Trend MA type: EMA or SMA.
- Trend source: price series used for the trend MA.
Alerts
Two conditions are available: volume above its average
while price is above the trend MA, and the same while
price is below it.
This script is for chart analysis only and is not
investment advice.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.