OPEN-SOURCE SCRIPT
Atualizado 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.
Notas de Lançamento
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.
Notas de Lançamento
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
Notas de Lançamento
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".
Notas de Lançamento
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.
Notas de Lançamento
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.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.