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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。