Technical Studies Reference
- Technical Studies Reference
- Common Study Inputs (Opens a new page)
- Using Studies (Opens a new page)
Williams' %R
This study calculates and displays Williams' %R for the data specified by the Input Data for High, Input Data for Low, and Input Data for Last Inputs. Williams' %R is a momentum study that measures overbought/oversold levels. It was developed by Larry Williams.
Let \(X^{(High)}\), \(X^{(Low)}\), \(X^{(Last)}\) be random variables denoting Input Data for High, Input Data for Low, and Input Data for Last, respectively, and let \(X_t^{(High)}\), \(X_t^{(Low)}\), \(X_t^{(Last)}\) denote their respective values at Index \(t\). Let the Length Input be denoted as \(n\).
We denote the maximum value of \(X^{(High)}\) and the minimum value of \(X^{(Low)}\) over a moving window of \(n\) chart bars terminating at Index \(t\) as \(\max_t\left(X^{(High)},n\right)\) and \(\min_t\left(X^{(Low)},n\right)\), respectively. These are computed for \(t > n\) as follows.
\(\max_t\left(X^{(High)},n\right) = \max\left\{X_{t - n + 1}^{(High)},..,X_t^{(High)}\right\}\)\(\min_t\left(X^{(Low)},n\right) = \min\left\{X_{t - n + 1}^{(Low)},..,X_t^{(Low)}\right\}\)
We denote the value of Williams %R at Index \(t\) for the given Inputs as \(\%R_t\left(X^{(High)}, X^{(High)}, X^{(High)}, n\right)\), and we compute it for \(t > n\). The method of computation varies slightly depending on the setting of the Invert Output Input.
If Invert Output is set to Yes, then we compute \(\%R_t\left(X^{(High)}, X^{(Low)}, X^{(Last)}, n\right)\) as follows.
\(\%R_t\left(X^{(High)}, X^{(Low)}, X^{(Last)}, n\right) = -100 \cdot \displaystyle{\frac{\max_t\left(X^{(High)},n\right) - X_t^{(Last)}}{\max_t\left(X^{(High)},n\right) - \min_t\left(X^{(Low)},n\right)}}\)This is the usual formula for Williams' %R.
If Invert Output is set to No, then we compute \(\%R_t\left(X^{(High)}, X^{(Low)}, X^{(Last)}, n\right)\) as follows.
\(\%R_t\left(X^{(High)}, X^{(Low)}, X^{(Last)}, n\right) = 100 \cdot \displaystyle{\frac{\max_t\left(X^{(High)},n\right) - X_t^{(Last)}}{\max_t\left(X^{(High)},n\right) - \min_t\left(X^{(Low)},n\right)}}\)Inputs
- Length
- Invert Output: This Input is used to toggle the sign of the output at each chart bar.
- Input Data for High
- Input Data for Low
- Input Data for Last
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.