Volume Histogram with MA
- Indicatori
-
Alexandru Dumitru
MQL5 Developer | Expert Advisors & Custom Indicators
Hi, I'm Alexandru!
I'm an active trader with programming experience, and I enjoy developing tools that make trading easier, more efficient, and better organized. - Versione: 1.0
Volume Histogram with MA is a customizable volume indicator for MetaTrader 5 that displays market activity as a color-coded histogram, with an optional moving average for comparing current volume with its recent average.
The indicator runs in a separate window below the price chart and supports tick volume, real volume, and automatic volume source selection.
It is designed to provide a simple way to observe changes in trading activity, identify unusual volume increases, and compare volume behavior with price movements.
Main Features
-
Bullish and bearish volume histogram based on price candle direction.
-
Optional simple moving average calculated from volume data.
-
Three volume source modes: Auto, Tick Volume, and Real Volume.
-
Automatic fallback to tick volume when real volume is unavailable.
-
Customizable histogram colors, moving-average color, and line widths.
-
Automatic histogram width adjustment based on chart zoom, with a manual width option.
-
Optional current Volume and Moving Average values displayed on the right side.
How It Works
Each histogram bar represents the selected volume value for the corresponding price candle.
When the candle closes at or above its opening price, the bullish volume color is used. When the candle closes below its opening price, the bearish color is used.
The colors indicate the direction of the price candle, not a separate measurement of buying or selling volume.
The optional Volume Moving Average calculates the simple average of the selected volume values over a configurable number of bars.
For example, with a Moving Average Period of 20, the line represents the average volume over the latest 20 bars.
Comparing the histogram with this moving average can help identify periods of relatively high or low market activity.
Volume Sources
Auto mode uses real volume whenever the broker provides a non-zero value and falls back to tick volume otherwise. This is the recommended setting for general use.
Tick Volume mode uses the number of price updates recorded during each candle.
Real Volume mode uses volume data supplied by the broker. If real volume is unavailable for a particular instrument, the corresponding values may be zero.
Real-volume availability varies between markets, instruments, and brokers. On Forex and many CFD instruments, tick volume is commonly used.
Because volume data comes from the broker, values may differ between trading accounts and data providers.
Settings and Customization
All main settings can be adjusted through the indicator's Inputs tab.
The Volume Settings group allows you to show or hide the histogram, select the volume source, enable or disable the moving average, and change its calculation period. The default MA period is 20.
The Appearance settings allow you to change bullish and bearish histogram colors, the moving-average color, histogram width, and moving-average line width.
When automatic histogram width is enabled, the bars adjust to changes in chart zoom. Alternatively, a fixed histogram width can be selected manually.
The Current Value Labels settings allow you to display the latest Volume and Moving Average values on the right side of the indicator window. Label width, height, and font size are configurable.
Practical Use
Volume Histogram with MA can be used alongside price action and other technical analysis methods.
A volume bar above its moving average indicates activity above the recent average. This can provide additional context when examining breakouts, strong price movements, or changes in market volatility.
Lower volume during a pullback may indicate reduced activity compared with the preceding impulse. Sudden volume spikes can also highlight periods of unusual market activity, including session openings and economic announcements.
These observations should be interpreted together with market conditions. Higher volume does not guarantee that a price movement will continue or reverse.
Installation and Limitations
Install Volume Histogram with MA from MQL5 Market and attach it to a MetaTrader 5 chart. The indicator appears in a separate window and can be configured through Inputs.
It works without DLLs, WebRequest, external files, or additional custom indicators.
Volume Histogram with MA is an analytical tool. It does not open, modify, or close trades and does not provide guaranteed trading signals.
Its calculations depend on the historical and live volume data supplied by the broker.
For questions, suggestions, or technical issues, please use the product's Comments section or MQL5 Messages.
