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.
Open-source script
In true PulseWire 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 PulseWire. Read more in the Terms of Use.
Open-source script
In true PulseWire 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 PulseWire. Read more in the Terms of Use.
