Linear Momentum Indicator: Close Against Close, In Percent

Written by Dominic Walsh · Published · Last updated

The linear momentum indicator compares two closes and nothing else. Today’s close gets divided by the close `Period` `5` bars ago. Multiplying by a hundred puts the answer on a scale where 100 means no change.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Separate window
Plots 1: Momentum
Alerts popup, push notification, email, sound
Inputs 7

What the Linear Momentum Indicator draws on the chart

One turquoise `Momentum` line fills its own pane.

Values above 100 mean the close has risen over the span.

Values below 100 mean it has fallen.

No reference levels ship, so MetaTrader scales the pane to the data.

  • Momentum: plot, turquoise
Linear momentum indicator ratio line in its own pane on the EURUSD H1 chart.
Linear momentum indicator ratio line in its own pane on the EURUSD H1 chart.

How the Linear Momentum Indicator calculates its values

A ratio, not a difference

Dividing rather than subtracting makes the reading scale free. A one percent move reads the same on a currency pair and on an index. A price difference would not.

Why the span is short

`Period` `5` compares the close with the one five bars back. That is a quick look, so the line reacts to almost every push. Nothing smooths it afterwards.

One guard in the code

A zero in the older close would break the division, so the code writes 100 instead. That case only shows up on broken data, but the check keeps the line from disappearing.

How to read the signals

The 100 mark is the neutral point, and it carries no drawn level.

Distance from 100 shows how far the close moved over the span.

A crossing of 100 says the five-bar comparison changed sign.

The name says linear, though the maths is a plain ratio.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`EnableAlerts` is the parent switch and arrives true, paired with `EnablePopup`. Three more routes wait: `EnablePushNotify` for mobile, `EnableEmail` for mail, `EnableSound` for the clip in `SoundFile`. Each closed bar sends at most one.

Every Linear Momentum Indicator input

Core settings

Setting What it does Default
Period How many bars back the comparison reaches, default `5`. 5

Alert settings

Setting What it does Default
EnableAlerts Parent switch for the four delivery routes, default `true`. on
EnablePopup Message box inside the terminal, default `true`. on
EnablePushNotify Push through to MetaTrader mobile, default `false`. off
EnableEmail Mail sent by the terminal, default `false`. off
EnableSound Play a clip on an alert, default `false`. off
SoundFile Which clip that is, default `”alert.wav”`. alert.wav
Linear momentum indicator inputs panel showing Period and the alert switches.
Linear momentum indicator inputs panel showing Period and the alert switches.

Settings that fit your chart

Five bars is a very short comparison. EURUSD H1 is the reference chart, where `Period` `5` looks back five hours. On M1 the line becomes almost pure noise. H4 and daily charts turn it into something readable.

When the Linear Momentum Indicator fails

No smoothing at all means every spike in the close shows up whole.

A ratio around 100 compresses the scale, so small moves look tiny.

Nothing marks a signal, so any rule has to come from you.

Copy the compiled Linear Momentum Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Download the Linear Momentum Indicator for MT4 and MT5

The zip holds the compiled Linear Momentum Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What does Period 5 compare?

The current close against the close five bars earlier. That is the entire calculation. Lengthening the span smooths the line indirectly, because a longer comparison responds less to any single candle.

Why does the Momentum plot centre on 100?

Because the reading divides one close by another and multiplies by a hundred. Two equal closes give exactly 100. Nothing draws that level in the pane, so you read it from the scale.

Is the Momentum plot actually linear?

Not in any strict sense. The code performs a division, which makes the reading proportional rather than linear. The label is a name rather than a description of the maths inside.

Does Period smooth the Momentum plot?

No. The buffer holds the raw ratio for every bar. That keeps the reading honest and also makes it jumpy, which is why a longer `Period` usually reads better than the default five.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Linear Momentum Indicator as one input. Always backtest before trading live.

Category: this is part of our Oscillators collection. Also, truly, browse more Oscillators for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment