ta.mom()
Momentum Indicator
Momentum is simply the difference between the current value and the value length bars ago.
Syntax
ta.mom(source, length) → series floatArguments
| Parameter | Type | Description |
|---|---|---|
| source | series int/float | Series to measure momentum on. |
| length | series int | Offset 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
//@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.
Related Pine Script Functions
ta.roc() - Rate of Change
Learn how to use ta.roc() in Pine Script. Syntax, parameters, code examples for the Rate of Change percentage indicator.
ta.change() - Change
Learn how to use ta.change() in Pine Script. Calculate bar-to-bar differences for price, time, and boolean series.
ta.rsi() - Relative Strength Index
Learn how to use ta.rsi() in Pine Script. Syntax, parameters, code examples for the RSI momentum oscillator.
ta.cci() - Commodity Channel Index
Learn how to use ta.cci() in Pine Script. Syntax, parameters, code examples for the CCI momentum indicator.
ta.cmo() - Chande Momentum Oscillator
Learn how to use ta.cmo() in Pine Script. Syntax, parameters, code examples for the Chande Momentum Oscillator.