Momentum OscillatorsPine Script v6

ta.mom()Momentum Indicator

Momentum is simply the difference between the current value and the value length bars ago.

Syntax

Syntax
ta.mom(source, length) → series float

Arguments

ParameterTypeDescription
sourceseries int/floatSeries to measure momentum on.
lengthseries intOffset in bars for the past reference value.

Returns

Momentum of source price and target price length bars ago.

Remarks

na values in the source series are included in calculations and will produce an na result.

Code Examples

Pine Script v6 Example
//@version=6
indicator("ta.mom")
plot(ta.mom(close, 10))

// same on pine
pine_mom(src, length) =>
    src - src[length]
plot(pine_mom(close, 10))

Trading Applications

Measure the rate of price change

Identify accelerating or decelerating trends

Generate signals from zero-line crossovers

Use as a leading indicator for trend reversals

Related Functions

Frequently Asked Questions

ta.mom(source, length) returns source minus source[length]: the absolute change over length bars.

Momentum here is a simple difference. Rate of change (ta.roc) expresses the same move as a percentage of the older value, which scales comparability across price levels.

Common uses include zero-line crosses, trend confirmation (momentum sign aligns with trend), and divergence analysis versus price. Always combine with risk controls.

Generate ta.mom() Code with AI

Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.mom() and other built-in functions instantly.