OPEN-SOURCE SCRIPT
已更新 MACD + Volume

MACD + Volume Indicator
This composite tool integrates three distinct technical indicators commonly used in intraday and swing trading analysis:
Moving Average Convergence Divergence (MACD):
A momentum oscillator derived from moving averages. It measures both trend direction and momentum by comparing short-term and long-term moving averages. The indicator allows customization of oscillator and signal line types, supporting SMA and EMA (default), as well as RMA, WMA, and VWMA.
Cumulative Volume Delta (CVD):
A volume-based indicator that tracks the cumulative difference between buying and selling pressure. By default, it uses diamond markers to represent whether the cumulative delta is trending upward or downward. This component can be disabled at any time if the user prefers.
Up/Down Volume:
Another volume-based measure that highlights bullish versus bearish volume shifts. By default, it employs triangle markers to indicate whether the volume delta is positive (bullish) or negative (bearish). This component can also be disabled at any time according to user preference.
This composite tool integrates three distinct technical indicators commonly used in intraday and swing trading analysis:
Moving Average Convergence Divergence (MACD):
A momentum oscillator derived from moving averages. It measures both trend direction and momentum by comparing short-term and long-term moving averages. The indicator allows customization of oscillator and signal line types, supporting SMA and EMA (default), as well as RMA, WMA, and VWMA.
Cumulative Volume Delta (CVD):
A volume-based indicator that tracks the cumulative difference between buying and selling pressure. By default, it uses diamond markers to represent whether the cumulative delta is trending upward or downward. This component can be disabled at any time if the user prefers.
Up/Down Volume:
Another volume-based measure that highlights bullish versus bearish volume shifts. By default, it employs triangle markers to indicate whether the volume delta is positive (bullish) or negative (bearish). This component can also be disabled at any time according to user preference.
版本注释
Update 2026/04/29:Add two configuration variables:
Volume Analysis Length: Default value, 12 periods (modifiable by the user). This variable corresponds to the number of periods over which the average is calculated.
Volume Ratio: Default value, 1.5 (modifiable by the user). This variable corresponds to the threshold value from which a volume alert is generated.
When the current period’s volume exceeds the average of the previous periods defined in Volume Analysis Length by the specified Volume Ratio, the color of the cumulative delta volume and up/down volume indicators changes accordingly.
版本注释
Update 2 2026/04/29:New option: "Change histogram color on high volume"
The MACD histogram changes its color if the volume from the CVD and Up/Down indicators exceeds the average, according to the parameters "Volume Analysis Length" and "Volume Ratio". This option is disabled by default, and when enabled, it operates even if the "Show Delta Volume" and "Show CVD" indicators are turned off.
Fixed:
delta and last volume values, are plotted as Values in status line
CVD indicator on top location by default
版本注释
1. CVD Indicator (Top position): Changes color if the body size of the bar (excluding the wick) is greater than the average of previous periods.
2. Up/Down Volume Indicator:
Changes color if the absolute delta value (difference between the last volume and the opening volume) is greater than the average of previous periods.
3. MACD Histogram:
Changes color if the conditions of the CVD and Up/Down indicators are met, and additionally, the total volume of the period is greater than the average of previous periods.
The default colors to display these volume changes are lime and maroon.
All three indicators operate based on the values of "Volume Analysis Length" and "Volume Ratio".
版本注释
Fixed:Tooltip related to the MACD histogram color calculation.
Status line values related to the CVD and Up/Down Volume indicators are now expressed in volume format (e.g., 3.13K).
Updated:
Up/Down Volume Indicator code optimized: Similar to CVD, it now displays diamonds by default, and the color indicates whether the trend is bullish or bearish.
版本注释
If the conditions of the CVD and Up/Down indicators are met, and additionally, the total volume of the period is greater than the average of previous periods, Now, you can choose to change color of Macd line, signal line or histogram as you preferYou can overlay on the main chart (above the candlestick chart, outside of the indicator) a Moving Average (MA) of the type and number of periods of your preference.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。