Loading…

Volume By Price Histogram

This bucket tick_volume by price over a fixed number of the most recent closed bars (InpLookbackBars) and draws the result as a horizontal histogram anchored to the newest bar's time. Because the anchor is the latest bar rather than whatever happens to be on screen, the histogram stays put next to current price even while the chart is scrolled back to look at older history - it answers "where has volume concentrated recently", a fixed and repeatable question, rather than "where did volume concentrate in whatever I am currently looking at". That is the deliberate difference from a visible-range profile: this one is driven by bar closes and a fixed depth, not by the viewport, so its shape only changes when a new bar actually completes. As with every volume tool in this catalogue, MetaTrader 4 has no consolidated forex tape and no per-price-level volume record - each bar's tick_volume is spread evenly across every price bucket its high-low range touches, and the highest-volume bucket is marked separately. Notes and limitations - Uses tick_volume as the volume input, since forex has no consolidated tape - a proxy for tick activity, not a literal traded volume count. - Each bar's volume is split evenly across every bucket its high-low range touches rather than weighted by where price actually spent more time within the bar, since MQL4 exposes no intrabar detail to weight it with. - Only rebuilds when a bar closes, so the histogram lags the current forming bar by at most one bar's worth of volume - a deliberate confirmation delay, not a bug, and it keeps the indicator from recomputing on every tick. - Draws over the chart's own bars near the latest one; on a chart zoomed out far enough that the anchor bar and lookback window are off screen, the histogram is still there, just not currently visible - scroll to the newest bars to see it.

Indicator · MT5 · v1.0 · Free

About Volume By Price Histogram

Volume By Price Histogram is an indicator for MetaTrader 5. It has 6 settings, such as Lookback bars, Price step pips and Max rows. MQL source code included.

Files in the download: VolumeByPrice.ex5, VolumeByPrice.mq5, VolumeByPrice.txt.

Settings

SettingDefaultWhat it does
Lookback bars200Closed bars scanned for the histogram
Price step pips5.0Bucket width, in pips, each histogram row represents
Max rows60Maximum rows drawn; the step is coarsened automatically past this
Profile width bars20Bar-widths the highest-volume row is allowed to occupy
Row colorclrTealNormal row colour
High volume colorclrGoldHighest-volume row colour

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Volume · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria