Momentum (Function)
The Momentum function calculates the change in momentum on the current bar relative to a specified number of bars ago.
Syntax
Momentum(Price, Length)
Returns (Double)
A numeric value containing Momentum for the current bar.
Parameters
|
Name |
Type |
Description |
|
Price |
Numeric |
Specifies which bar value (price, function, or formula) to use. |
|
Length |
Numeric |
Sets the number of bars to consider. |
Remarks
Momentum is an oscillator calculated by subtracting the Price value for the bar occurring Length bars ago from the Price value for the current bar. Therefore, if the value for the current bar exceeds that of the bar in the past, the result will be positive. If the value for the current bar is less than that of the bar in the past, the result will be negative. Values returned by the Momentum function oscillate above and below zero.
Example
Assigns to Value1 the momentum difference of the Close from 10 bars ago.
Value1 = Momentum(Close,10);