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提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。