Momentum
Momentum in ProBuilder returns close minus the close N bars ago, an unbounded rate of change oscillator. Syntax, formula, examples and interpretation.
Syntax
Momentum[N]Parameters
| Name | Type | Default | Description |
|---|---|---|---|
N | integer | none | How many bars back to look. Momentum[20] compares the current close with the close 20 bars ago. Larger values smooth the reading and slow it down. |
Formula
momentumValue = close - close[N]The result is expressed in the instrument's own price units, points for an index, currency units for a share.
How it works
On every bar, ProBuilder subtracts the closing price recorded N bars earlier from the current closing price. The output rises while price gains ground over the lookback window and falls while price loses ground, regardless of what happens on the bars in between. Only the two endpoints matter.
Because the calculation is a plain difference, the indicator has no fixed upper or lower bound. A reading of 50 on one instrument may be extreme while the same reading on a higher-priced instrument is noise. This makes Momentum unsuitable for fixed overbought and oversold thresholds, unlike RSI or Stochastic.
The instruction always operates on closing prices and takes no price argument. To measure momentum of another series, compute the difference manually, for example high - high[N], or apply ROC for a percentage-based variant.
Examples
Example 1, Smoothed momentum line (Indicator)
// 20-bar momentum, smoothed with a 10-bar average to cut noise
mom = Momentum[20]
averagemom = average[10](mom)
RETURN averagemom AS "Average Momentum"Computes 20-bar momentum and averages it over 10 bars. The smoothed line turns more slowly but produces fewer false zero-line crossings.
Example 2, Zero-line crossover system (ProOrder)
// Long when momentum turns positive, flat when it turns negative
mom = Momentum[20]
IF NOT LongOnMarket AND mom CROSSES OVER 0 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
IF LongOnMarket AND mom CROSSES UNDER 0 THEN
SELL AT MARKET
ENDIFA minimal trend-following template. The zero line separates instruments trading above their level of 20 bars ago from those trading below it.
Example 3, Momentum leaders screener (ProScreener)
// Instruments whose 20-bar momentum is positive and still expanding
mom = Momentum[20]
rising = mom > 0 AND mom > mom[5]
SCREENER[rising](mom AS "Momentum 20")Filters for instruments where momentum is both positive and higher than five bars ago, a simple strength-continuation scan.
Interpretation
| Reading | Meaning |
|---|---|
| Above 0 | Price is higher than N bars ago, upward pressure. |
| Below 0 | Price is lower than N bars ago, downward pressure. |
| Crossing 0 | The lookback comparison has flipped sign, often used as a trend-change trigger. |
Divergences. When price prints a higher high but Momentum prints a lower high, the advance is slowing even though price is still rising, a bearish divergence. The mirror case, lower price lows with higher Momentum lows, is a bullish divergence. Both are commonly read as early reversal warnings, not standalone signals.
Since the scale is unbounded, absolute levels should only be compared with the instrument's own history, never across instruments.
Common errors and gotchas
- No price argument.
Momentum[20](close)is invalid. The instruction always uses the close and accepts only the[N]period. For other series, write the subtraction manually. - Not comparable across instruments. The output is in price units, so a stock at 10 and an index at 20000 produce values on completely different scales. Use
ROCorVariationfor percentage-based comparisons. - Endpoint sensitivity. Only two closes enter the formula. A single unusual bar dropping out of the lookback window can flip the sign with no change in current price action.
- Fixed thresholds do not transfer. Overbought and oversold levels borrowed from bounded oscillators such as
RSIhave no meaning here, because there is no upper or lower limit.
Related instructions
ROC, the same idea expressed as a percentage.RSI, bounded momentum oscillator with standard 30 and 70 thresholds.MACD, momentum from the spread between two exponential averages.PriceOscillator, difference between a short and a long moving average.Variation, percentage change of the current bar.TRIX, smoothed rate of change built on a triple exponential average.Stochastic, bounded oscillator locating the close within its recent range.Average, used to smooth the momentum line.
