#### Home >> (Table of Contents) Studies and Indicators >> Technical Studies Reference >> Narrow Range Bar

# Technical Studies Reference

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

### Narrow Range Bar

This study highlights chart bars that are narrower than any of the prior bars or groups of bars in a specified lookback period. There are three Schemes for doing this: **NR n**, **x Bar NR**, and **NR vs ATR**, where NR stands for "Narrow Range". The notation used here is adapted from Tony Crabel's book *Day Trading with Short Term Price Patterns and Opening Range Breakout*, and it is analogous to the notation used in the Wide Range Bar study. In this study, any of these Schemes can be selected via the **Lookback Type** Input. We will explain each one below.

** Scheme #1: NR n**:

**Note**: This is the lookback Scheme that was used in the older version of this study.

Let the **Lookback Length - NR n** Input be denoted as \(n\). In this Scheme, the range of the current chart bar is compared to the ranges of the previous \(n\) bars.

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\). The calculation of \(RCB_t\) is done for \(t \geq 0\), and the method of calculation depends on the setting of the **Use Open To Close Range for NR n Lookback Type** Input as follows.

If **Use Open To Close Range for NR n Lookback Type** is set to Yes, then \(RCB_t = |O_t - C_t|\).

If **Use Open To Close Range for NR n Lookback Type** is set to No, then \(RCB_t = H_t - L_t\).

We define a function called the Narrow Range, denoted as \(NR_t(n)\). We compute this function for \(t \geq n\) as follows.

\(\displaystyle{NR_t(n) = \left\{\begin{matrix} 1 & RCB_t \leq \min\{RCB_{t - n},...,RCB_{t - 1}\} \\ 0 & RCB_t > \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\). The highlighting is in blue by default.

** Scheme #2: x Bar NR**:

Let the **Lookback Length - xBar NR** and **Number of Bars in Comparison Group** Inputs be denoted as \(n\) and \(x\), respectively. In this Scheme, the range of the current \(x\) chart bars is compared to the ranges of every consecutive group of \(x\) bars in the previous \(n\) bars.

We denote the Range of Current Group of size \(x\) at Index \(t\) as \(RCG_t(x)\), and we compute it for \(t \geq x - 1\) as follows.

\(RCG_t(x) = \max_t(H,x) - \min_t(L,x)\)For an explanation of the \(\min\) and \(\max\) functions, see our description of the Moving Maximum and Moving Minimum.

We define a function called the Narrow Range for the Leading Bar, denoted as \(NRLB_t(n,x)\). We compute this function for \(t \geq n\) as follows.

\(\displaystyle{NRLB_t(n,x) = \left\{\begin{matrix} 1 & RCG_t \leq \min\{RCG_{t - n + x},...,RCG_{t - 1}\} \\ 0 & RCG_t > \min\{RCG_{t - n + x},...,RCG_{t - 1}\} \end{matrix}\right .}\)Because we wish to highlight all of the bars in a group of size \(x\) when its range is the narrowest in the lookback period \(n\), we define the function Narrow Range, denoted as \(NR_t(n,x)\). The default value for \(NR_t(n,x)\) is \(0\), but if \(NRLB_t(n,x) = 1\), then we have \(NR_i(n,x) = 1\) for \(i = t - x + 1, ...,t\). In this case, we highlight the leading bar (that is, the most recent bar) with the study Primary Color (default: blue), and we highlight the earlier bars in the group of size \(x\) with the study Secondary Color (default: purple). A leading bar may be highlighted in the Secondary Color if two narrow range groups of size \(x\) overlap.

** Scheme #3: NR vs ATR**:

This Scheme is not from Crabel's work. Rather, it is unique to Sierra Chart.

As in Scheme #1, the Range of Current Bar at Index \(t\) is denoted as \(RCB_t\), and it is computed as follows.

\(RCB_t = H_t - L_t\)Let \(n\) denote the Input **Lookback Length - NR vs ATR**. In this Scheme we determine the Narrow Range \(NR_t(n)\) by comparing \(RCB_t\) with the Average True Range of the previous \(n\) bars. The type of moving average used in the ATR calculation is determined by the Input **ATR Moving Average Type** We denote this in mathematical symbols as follows.

The bar with Index \(t\) is highlighted if and only if \(NR_t(n) = 1\). The highlighting is in blue by default.

#### Inputs

**Lookback Type:**This is a custom Input that can be set to either**NR n**,**x Bar NR**, or**NR vs ATR**.- Lookback Length - NR n
**Use Open To Close for NR n Lookback Type:**This is a custom Input that determines how the Range of the Current Bar is calculated in the**NR n**Scheme.- Lookback Length - xBar NR
- Number of Bars in Comparison Group
- Lookback Length - NR vs ATR
- ATR Moving Average Type

#### Spreadsheet

The spreadsheets below contain the formulas for this study in Spreadsheet format. Save these Spreadsheets to the Data Files Folder.

Open them through **File >> Open Spreadsheet**.

Narrow_Range_Bar_NR_n.166.scss

*Last modified Tuesday, 10th September, 2019.