Loading…

Volume Price Trend Line

Volume Price Trend (VPT) is a cumulative line, in the same family as On Balance Volume, but with one important difference: instead of adding a bar's full volume with a plain +1/-1 sign, VPT scales that volume by the size of the bar's percentage price move. A bar that moves 0.01% on heavy volume adds almost nothing to the running total; a bar that moves 1% on the same volume adds a hundred times more. That scaling is what makes VPT more sensitive to the strength of a move than OBV, which treats a flat grind and a sharp breakout the same as long as they close in the same direction. Each bar's contribution is tick_volume * (close[i]-close[i-1]) / close[i-1], summed into a running total exactly like OBV. A second line plots a simple moving average of that running total - the "signal" line - so a cross of the raw VPT line through its own average reads the same way a MACD signal-line cross does: a fast change in trend strength relative to the recent average. No real traded (dollar) volume is available on MetaTrader 4 for FX or CFDs; this indicator uses broker tick volume throughout, the same proxy every volume-based tool in this catalogue uses, and the standard, correct choice for native MQL4. Notes and limitations - Uses broker tick volume as the volume input, since no real traded volume feed exists for FX/CFDs on MetaTrader 4. Absolute VPT levels are not comparable across symbols or brokers - only the shape and trend of the line on one symbol over time is meaningful. - Being cumulative from the first loaded bar, the absolute VPT level depends on how much history the chart has loaded; only its slope and crosses against the signal line are meaningful, not any particular numeric value. - Needs at least InpSignalPeriod + 1 bars of history before the signal line starts plotting; the raw VPT line starts from the second available bar.

Indicator · MT5 · v1.0 · Free

About Volume Price Trend Line

Volume Price Trend Line is an indicator for MetaTrader 5. It has 1 setting, such as Signal period. MQL source code included.

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

Settings

SettingDefaultWhat it does
Signal period14SMA period applied to the VPT line for the signal average

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: MACD · Volume · Buy/Sell Arrows · Trend · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria