# Technical Studies Reference

### Narrow Range Bar

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

Let the High and Low Prices at Index $$t$$ be denoted as $$H_t$$ and $$L_t$$, respectively. Then we denote the Range of Current Bar at Index $$t$$ as $$RCB_t$$. $$RCB_t$$ is calculated for $$t \geq 0$$ as follows.

$$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 Narrow Range for each chart bar, and we denote its value for the given Input $$n$$ at Index $$t$$ as $$NR_t(n)$$. We compute $$NR_t(n)$$ for $$t \geq 0$$ as follows.

For $$t = 0$$: $$NR_0(n) = 1$$

For $$t \leq n - 1$$: $$NR_t(n) = \left\{\begin{matrix} 1 & RCB_t < \min\{RCB_0,...,RCB_{t - 1}\} \\ 0 & RCB_t \geq \min\{RCB_0,...,RCB_{t - 1}\} \end{matrix}\right .$$

For $$t > n - 1$$: $$NR_t(n) = \left\{\begin{matrix} 1 & RCB_t < \min\{RCB_{t - n},...,RCB_{t - 1}\} \\ 0 & RCB_t \geq \min\{RCB_{t - n},...,RCB_{t - 1}\} \end{matrix}\right .$$

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