Visual Basic (Declaration) | |
---|---|
Overloads Public Shared Function RateOfChange( _ ByVal seriesName As String, _ ByVal s As Series, _ ByVal numberDays As Integer _ ) As Series |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public static Series RateOfChange( string seriesName, Series s, int numberDays ) |
Parameters
- seriesName
- The name of the series which will be displayed on the chart, i.e. its label.
- s
- An series where the first element is the closing price in the last trading period, the second term is the closing price in the previous trading period and so on.
- numberDays
- The number of days before to which the closing price is compared.
Return Value
A series where the first term is the rate of change for the most recent period, the second term is the rate of change for the previous period and so on.Exception | Description |
---|---|
ArgumentException | Thrown if either parameter is strictly negative. |
The (n-day) rate of change (ROC) is just the last closing price divided by the closing price
n-days ago.
As with the case with the momentum indicator the rate of change (ROC) indicator on extended values and/or turning points indicates oversold or over brought conditions (respectively).