Momentum
Momentum measures the rate of change of the price over a specified number of bars.
Role in the strategy
| Slot | Available | Role |
|---|---|---|
| Entry Point | No | — |
| Entry Rule | Yes | Filters entries by the Momentum direction or its level position. |
| Exit Point | No | — |
| Exit Rule | Yes | Triggers exits by the Momentum direction or its level position. |
The Momentum produces conditions, not order prices. As an entry rule it is ANDed with the entry point and the other entry rules; as an exit rule it is ORed with the other exit rules. See Indicators for the slot semantics.
Logic rules
The indicator offers the standard oscillator rule set, evaluated on the Momentum value:
| Rule | Long signal is 1 when | Short signal is 1 when |
|---|---|---|
| Momentum rises | Momentum rose on the previous bar | Momentum fell on the previous bar |
| Momentum falls | Momentum fell on the previous bar | Momentum rose on the previous bar |
| Momentum is higher than the Level line | Momentum is above Level | Momentum is below 200 − Level |
| Momentum is lower than the Level line | Momentum is below Level | Momentum is above 200 − Level |
| Momentum crosses the Level line upward | Momentum crossed above Level from below | Momentum crossed below 200 − Level from above |
| Momentum crosses the Level line downward | Momentum crossed below Level from above | Momentum crossed above 200 − Level from below |
| Momentum changes its direction upward | Momentum formed a valley (down then up) | Momentum formed a peak (up then down) |
| Momentum changes its direction downward | Momentum formed a peak (up then down) | Momentum formed a valley (down then up) |
The Level parameter sets the long threshold; the short threshold is always 200 − Level. With the default Level of 100, both sides use 100: the value is above 100 in an uptrend and below 100 in a downtrend.
Parameters
| Parameter | Type | Default | Range | Purpose |
|---|---|---|---|---|
| Apply to | select | Close | Open, High, Low, Close, Median, Typical, Weighted | Price series the Momentum is calculated from |
| Period | number | 14 | 1 to 1000 | Bars between the compared prices |
| Level | number | 100 | 50 to 150 | Long threshold; the short threshold is 200 − Level |
Calculation
tech.Momentum in engine/indicator-engine/tech.ts computes Momentum = Current Price / Price N bars ago × 100. A value above 100 means the price is rising, below 100 that it is falling. The line is drawn in a separate chart pane.
Backtesting
- The rule is evaluated on the previous (closed) bar with the standard dead zone (
SIGMA = 0.000001). - The indicator contributes only long/short signal arrays — it never changes the entry or exit order price.
- An entry happens only when the entry point allows the direction and every entry rule passes; an exit happens when the exit point is reached and any exit rule passes.