Loading…

Two Timeframe Volume Alignment

A busy stretch of bars on the current chart can mean very different things depending on what the bigger picture is doing. If the higher timeframe is also getting busier, the pickup is a genuine, broad change in participation. If the higher timeframe is quiet or fading, the current-timeframe pickup may just be noise from a handful of active minutes that will not show up once the bigger candle closes. Each side's "activity trend" is measured the same way: a fast tick- volume average divided by a slow tick-volume average, minus one. A positive value means recent bars are busier than the slow baseline; a negative value means they are quieter. The indicator computes this ratio independently on the chart's own timeframe and on the chosen higher timeframe (aligned to the same point in time via iBarShift), then compares the sign of the two. When they agree, the bar plots green ("confirmed") at the current-timeframe ratio's value. When they disagree, it plots red ("diverging") at the same value - the colour carries the confirmation, the height carries the current timeframe's own reading. Native MQL4 has no colour-changing histogram plot type. This is drawn with the standard two-buffer trick used throughout this catalogue: one buffer holds a value only where the bar is confirmed, the other only where it diverges, with EMPTY_VALUE in the unused slot - two plots that together read as one colour-changing line. Notes and limitations - Uses broker tick volume on both timeframes - the standard, correct choice in native MQL4, since no real traded volume feed exists for FX/CFDs. - A bar is skipped (both buffers EMPTY_VALUE) if the higher timeframe does not yet have InpSlowPeriod bars of history available at the aligned point, which can happen at the very start of the chart's loaded history. - The comparison is sign-only (both rising vs both falling); it does not weight by how strongly each timeframe is trending, so a barely positive current-timeframe ratio counts as "confirmed" against a strongly positive higher-timeframe ratio the same as against a barely positive one.

Indicator · MT5 · v1.0 · Free

About Two Timeframe Volume Alignment

Two Timeframe Volume Alignment is an indicator for MetaTrader 5. It has 3 settings, such as Higher tf, Fast period and Slow period. MQL source code included.

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

Settings

SettingDefaultWhat it does
Higher tfPERIOD_H1Higher timeframe volume trend is measured on
Fast period5Fast tick-volume average, bars
Slow period20Slow tick-volume average, bars (the baseline)

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 · Trend · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria