How it is calculated
Momentum is the price minus the price length bars ago, on the chosen source, with no smoothing. As TA-Lib MOM.
Reference: TA-Lib MOM
How to read it
Above zero price is higher than at the start of the window, below zero lower; the distance from zero is the size of the move. In price units, so values cannot be compared between markets or across years with very different prices; ROC does that in percent. A momentum that falls while price still rises shows the move slowing.
In a strategy
A simple trend filter: ctx.ind("mom", length=10) > 0 allows longs only while price is above where it was ten bars ago, with an exit when it turns negative.
Inputs
| Input | Type | Default | Range or choices |
|---|---|---|---|
Lengthlength | Whole number | 10 | min 1, max 5000 |
Sourcesource | Price | "close" | close, open, high, low, hl2, hlc3, ohlc4, hlcc4 |
What it draws
| Line | Drawn as |
|---|---|
| Momentum | Line |
Guide lines at 0.
Used in
No strategy template reads it yet.