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

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.