#### Home >> (Table of Contents) Studies and Indicators >> Technical Studies Reference >> Rate of Change Oscillator Type II

# Technical Studies Reference

- Technical Studies Reference
- Common Study Inputs (Opens a new page)
- Using Studies (Opens a new page)

# Rate of Change Oscillator Type II

This study calculates and displays a Rate of Change Oscillator Type II (ROC-II) of the data specified by the **Input Data High** and **Input Data Low** Inputs. This is an oscillator that was developed by Thomas DeMark, and it is closely related to the **Rate of Change Oscillator Type I**. See the documentation for that study for an explanation of the notation used here.

Let the **Input Data High** and **Input Data Low** Inputs be denoted as \(X^{(H)}\) and \(X^{(L)}\), respectively, and let \(X^{(H)}_t\) and \(X^{(L)}_t\) be their respective values at Index \(t\). Let the Inputs **High Threshold** and **Low Threshold** be denoted as \(y^{(H)}\) and \(y^{(L)}\), respectively.

The **Rate of Change Oscillator Type II** at Index \(t\) is denoted as \(ROC^{(II)}_t\left(X, X^{(H)}, X^{(L)}, n_{ROC}, y^{(H)}, y^{(L)}\right)\), and it is displayed for \(t \geq n_{ROC}\) as follows.

This notation will become more cumbersome as we proceed, so we will omit the function parameters when referring to ROC-I going forward.

Let the **Smoothing Length** Input be denoted as \(n_S\), where \(n_S \leq n_{ROC}\). If the **Use Smoothing?** Input is set to Yes, then the following Simple Moving Average replaces the normal ROC-II Oscillator. It is displayed for \(t \geq n_{ROC} + n_S - 1\).

**Note**: Depending on the setting of the Input **Smoothing MA Type**, the Simple Moving Average in the above function could be replaced with an Exponential Moving Average, a Linear Regression Moving Average, a Weighted Moving Average, a Wilders Moving Average, a Simple Moving Average - Skip Zeros, or a Smoothed Moving Average.

Let the **Average ROC-II MA Length** Input be denoted as \(n_{MA}\), which need not be smaller than \(n_{ROC}\). If the **Use Moving Average?** Input is set to Yes, then the ROC-II Subgraph is replaced with the following.

- \(SMA_t\left(ROC^{(II)},n_{MA}\right)\) if
**Use Smoothing?**is set to No. This is displayed for \(t \geq n_{ROC} + n_{MA} - 1\). - \(SMA_t\left(SMA\left(ROC^{(II)},n_S\right),n_{MA}\right)\) if
**Use Smoothing?**is set to Yes. This is displayed for \(t \geq n_{ROC} + n_S + n_{MA} - 2\).

**Note**: Depending on the setting of the Input **Average ROC-II MA Type**, the Simple Moving Averages in the above functions could be replaced with Exponential Moving Averages, Linear Regression Moving Averages, Weighted Moving Averages, Wilders Moving Averages, Simple Moving Averages - Skip Zeros, or Smoothed Moving Averages.

This study also displays horizontal lines at levels determined by the **Overbought Line Value** and **Oversold Line Value** Inputs. The Default values of these inputs are \(102.5\) and \(97.5\), which is the recommended setting for Historical charts. For Intraday charts with time scales under \(30\) minutes, it is recommended that these be changed to \(100.25\) and \(99.75\), respectively.

Let the Input **Arrow Offset Percentage** be denoted as \(k\).

If the ROC-II breaks out above the Overbought Line for \(n_D\) chart bars or more, then a green Down Arrow appears above the ROC-I Subgraph at a horizontal location \(n_D\) bars from the left of where the breakout occurred. The vertical position of the arrow is given by \(ROC^{(I)}_T(X,n_{ROC}) + \frac{k}{100} \cdot ROC^{(I)}_T(X,n_{ROC})\), where \(T\) is the value of the Index where the arrow is drawn.

If the ROC-II breaks out below the Oversold Line for \(n_D\) chart bars or more, then a red Up Arrow appears below the ROC-I Subgraph at a horizontal location \(n_D\) bars from the left of where the breakout occurred. The vertical position of the arrow is given by \(ROC^{(I)}_T(X,n_{ROC}) + \frac{k}{100} \cdot ROC^{(I)}_T(X,n_{ROC})\), where \(T\) is the value of the Index where the arrow is drawn.

#### Inputs

- Input Data
- Input Data High
- Input Data Low
- Input Data Close
- ROC Length
**High Threshold**: A custom Input that determines the highest value of ROC-I, above which the**Input Data**is replaced by**Input Data High**in the ROC-II calculation.**Low Threshold**: A custom Input that determines the lowest value of ROC-I, below which the**Input Data**is replaced by**Input Data Low**in the ROC-II calculation.**Use Smoothing?**: A custom Input that determines whether the values of the ROC-II Oscillator are to be smoothed- Smoothing Length
- Smoothing MA Type
**Use Moving Average?**: A custom Input that determines whether a moving average of the ROC-II Oscillator is to be used as the study Subgraph- Average ROC MA Length
- Average ROC MA Type
- Duration Length
- Arrow Offset Percentage
- Overbought Line Value
- Oversold Line Value

#### Spreadsheet

The spreadsheet below contains the formulas for this study in Spreadsheet format. Save this Spreadsheet to the Data Files Folder.

Open it through **File >> Open Spreadsheet**.

*Last modified Monday, 03rd October, 2022.