Technical Studies Reference

Wide Range Bar

This study highlights chart bars that are wider than any of the prior bars in a specified lookback period.

Let the Open, High, Low, and Close Prices at Index \(t\) be denoted as \(O_t\), \(H_t\), \(L_t\), and \(C_t\), respectively. Then we denote the Range of Current Bar at Index \(t\) as \(RCB_t\). \(RCB_t\) is calculated for \(t \geq 0\), and the method for calculating it depends on the value of the Input Use Open To Close Range Only.

If Use Open To Close Range Only is set to Yes, then \(RCB_t = |O_t - C_t|\).

If Use Open To Close Range Only is set to No, then \(RCB_t = H_t - L_t\).

Let the Input Number of Bars to Compare be denoted as \(n\). This Input plays the role of a Length. Then we compute a value called Wide Range for each chart bar, and we denote its value for the given Input \(n\) at Index \(t\) as \(WR_t(n)\). We compute \(WR_t(n)\) for \(t \geq 0\) as follows.

For \(t = 0\): \(WR_0(n) = 1\)

For \(t \leq n - 1\): \(WR_t(n) = \left\{\begin{matrix} 1 & RCB_t > \max\{RCB_0,...,RCB_{t - 1}\} \\ 0 & RCB_t \leq \max\{RCB_0,...,RCB_{t - 1}\} \end{matrix}\right .\)

For \(t > n - 1\): \(WR_t(n) = \left\{\begin{matrix} 1 & RCB_t > \max\{RCB_{t - n},...,RCB_{t - 1}\} \\ 0 & RCB_t \leq \max\{RCB_{t - n},...,RCB_{t - 1}\} \end{matrix}\right .\)

The bar with Index \(t\) is highlighted if and only if \(WR_t(n) = 1\).



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 Friday, 05th January, 2018.