Skip to content

Free MT5 indicator

OBV Signal

On-Balance Volume for MT5 with an EMA signal line, cross arrows in the subwindow and optional once-per-bar alerts.

Volumev1.0MetaTrader 5 (MQL5) Compiles with 0 errors Non-repainting signals Alerts

What it does

On-Balance Volume (OBV) is a running total that adds a bar's volume when price closes higher and subtracts it when price closes lower. The idea is that volume tends to lead price: if OBV keeps rising while price moves sideways, buying pressure may be building. This version plots OBV in a separate window with an EMA signal line and marks crosses between the two.

How it works

  • If the close is above the previous close, OBV = previous OBV + volume.
  • If the close is below the previous close, OBV = previous OBV - volume.
  • If the close is unchanged, OBV stays the same.
  • Signal = EMA of OBV with smoothing factor 2 / (period + 1).
  • An up arrow prints on a closed bar where OBV moves from at or below the signal to above it; a down arrow marks the opposite cross.

The starting value of OBV is arbitrary (it begins at zero on the first loaded bar), so only its direction and shape matter, not the number itself. Volume is tick volume by default; if you choose real volume and the broker reports zero, tick volume is used for that bar.

How to use it

Common ways to read OBV:

  • Confirmation: in an uptrend, OBV making higher highs alongside price supports the move.
  • Divergence: price makes a new high but OBV does not, which can warn that participation is fading.
  • Signal crosses: OBV crossing above its EMA shows volume flow turning positive over the signal period, and crossing below shows it turning negative.

Crosses are frequent, so they work best as a filter for setups found elsewhere, for example with trendlines or support and resistance. H1 and above give smoother readings. Read the technical analysis basics lesson for how volume tools fit into a wider approach.

Settings

InputDefaultWhat it changes
Volume typeTick volumeSource of the volume added or subtracted
Signal EMA period20Longer periods give fewer, slower crosses
Show cross arrowstrueTurns the subwindow arrows on or off
Popup alert / Push notificationfalseAlerts once per bar on a new cross

Limitations

  • In spot forex, tick volume counts price updates, not traded size, so OBV is only an approximation of real flow.
  • A single high-volume bar can shift OBV for a long time, because every bar's full volume is counted.
  • Signal-line crosses happen often in ranges and lag at turning points.
  • OBV values differ between brokers because their tick feeds differ.

Key inputs

Key inputs of OBV Signal
InputDefaultDescription
Volume type (real falls back to tick when zero)Tick volumeChoose tick or real volume; real volume falls back to tick volume when the broker reports zero.
Signal EMA period20Length of the exponential moving average of OBV.
Show cross arrowstrueDraws arrows where OBV crosses its signal line on closed bars.
Popup alert on a new crossfalseShows an MT5 alert once per bar on a new cross.

Educational tools, not advice. Indicators and Expert Advisors describe price; they do not predict it, and past behaviour does not guarantee future results. Test everything on a demo account first and never risk money you cannot afford to lose. See our disclaimer.

Keep exploring

Related mt5 indicators