Technical Studies Reference

DeMarker Oscillator Type I

This study calculates and displays a DeMarker Oscillator Type I (DeM-I) of the data specified by the Input Data High and Input Data Low Inputs. This is an oscillator that was developed by Thomas DeMark.

Let $$X^{(H)}$$ and $$X^{(L)}$$ be random variables denoting the Input Data High and Input Data Low, and let $$X^{(H)}_t$$ and $$X^{(L)}_t$$ denote their respective values at Index $$t$$. Let the Inputs DeM Length 1, DeM Length 2, and Duration Length be denoted as $$n^{(1)}_{DeM}$$, $$n^{(2)}_{DeM}$$, and $$n_D$$, respectively. We impose the restriction $$n^{(1)}_{DeM} \leq n^{(2)}_{DeM}$$

We denote the Max DeMarker Type I and the Min DeMarker Type I at Index $$t$$ as $$DeMax^{(I)}_t\left(X^{(H)}, n^{(1)}_{DeM}\right)$$ and $$DeMin^{(I)}_t\left(X^{(L)}, n^{(1)}_{DeM}\right)$$, respectively, and we compute them for $$t \geq n^{(1)}_{DeM}$$ as follows.

$$DeMax^{(I)}_t\left(X^{(H)},n^{(1)}_{DeM}\right) =\left\{ \begin{matrix} X^{(H)}_t - X^{(H)}_{t - n^{(1)}_{DeM}} & X^{(H)}_t > X^{(H)}_{t - n^{(1)}_{DeM}} \\ 0 & X^{(H)}_t \leq X^{(H)}_{t - n^{(1)}_{DeM}} \end{matrix}\right .$$

$$DeMin^{(I)}_t\left(X^{(L)},n^{(1)}_{DeM}\right) =\left\{ \begin{matrix} X^{(L)}_{t - n^{(1)}_{DeM}} - X^{(L)}_t & X^{(L)}_t < X^{(L)}_{t - n^{(1)}_{DeM}} \\ 0 & X^{(L)}_t \geq L_{t - n^{(1)}_{DeM}} \end{matrix}\right .$$

The DeMarker Oscillator Type I at Index $$t$$ is denoted as $$DeM^{(I)}_t\left(X^{(H)}, X^{(L)}, n^{(1)}_{DeM}, n^{(2)}_{DeM}\right)$$, and it is computed in terms of Moving Sums for $$t \geq n^{(1)}_{DeM} + n^{(2)}_{DeM} - 1$$ as follows.

$$\displaystyle{DeM^{(I)}_t\left(X^{(H)}, X^{(L)}, n^{(1)}_{DeM}, n^{(2)}_{DeM}\right) = \left\{ \begin{matrix} 100\cdot\frac{\mathrm{sum}_t\left({DeMax}^{(I)}\left(X^{(H)},n^{(1)}_{DeM}\right), n^{(2)}_{DeM}\right)}{\mathrm{sum}_t\left({DeMax}^{(I)}\left(X^{(H)},n^{(1)}_{DeM}\right), n^{(2)}_{DeM}\right) + \mathrm{sum}_t\left({DeMin}^{(I)}\left(X^{(L)},n^{(1)}_{DeM}\right), n^{(2)}_{DeM}\right)} & \mathrm{sum}_t\left({DeMax}^{(I)}\left(X^{(H)},n^{(1)}_{DeM}\right), n^{(2)}_{DeM}\right) + \mathrm{sum}_t\left({DeMin}^{(I)}\left(X^{(L)},n^{(1)}_{DeM}\right), n^{(2)}_{DeM}\right) \neq 0 \\ {DeM}^{(I)}_{t - 1}\left(X^{(H)}, X^{(L)}, n^{(1)}_{DeM}, n^{(2)}_{DeM}\right) & \mathrm{sum}_t\left({DeMax}^{(I)}\left(X^{(H)},n^{(1)}_{DeM}\right), n^{(2)}_{DeM}\right) + \mathrm{sum}_t\left({DeMin}^{(I)}\left(X^{(L)},n^{(1)}_{DeM}\right), n^{(2)}_{DeM}\right) = 0 \end{matrix}\right .}$$

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

Let the Smoothing Length Input be denoted as $$n_S$$, where $$n_S \leq n^{(2)}_{DeM}$$. If the Use Smoothing? Input is set to Yes, then the following Simple Moving Average replaces the normal DeM-I Oscillator, and we compute it for $$t \geq n^{(1)}_{DeM} + n^{(2)}_{DeM} + n_S - 2$$.

$$SMA_t\left(DeM^{(I)},n_S\right)$$

Let the Average DeM MA Length Input be denoted as $$n_{MA}$$, which need not be smaller than $$n^{(2)}_{DeM}$$. If the Use Moving Average? Input is set to Yes, then the DeM-I Subgraph is replaced with the following.

• $${SMA}_t\left({DeM}^{(I)},n_{MA}\right)$$ for $$t \geq n^{(1)} + n^{(2)} + n_{MA} - 2$$ if Use Smoothing? is set to No.
• $${SMA}_t\left(SMA\left({DeM}^{(I)},n_S\right),n_{MA}\right)$$ for $$t \geq n^{(1)} + n^{(2)} + n_S + n_{MA} - 3$$ if Use Smoothing? is set to Yes.

Note: The Inputs Smoothing MA Type and Average DeM MA Type control the Moving Average Types of the Simple Moving Averages (SMAs) of Length $$n_S$$ and $$n_{MA}$$, respectively. Depending on the settings of these Inputs, the SMAs 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.

Let the Input Arrow Offset Percentage be denoted as $$k$$.

If the DeM-I breaks out above the Overbought Line for $$n_D$$ chart bars or more, then a green Down Arrow appears above the DeM-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 $$DeM^{(I)}_T + \frac{k}{100} \cdot DeM^{(I)}_T$$, where $$T$$ is the value of the Index where the arrow is drawn.

If the DeM-I breaks out below the Oversold Line for $$n_D$$ chart bars or more, then a red Up Arrow appears below the DeM-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 $$DeM^{(I)}_T + \frac{k}{100} \cdot DeM^{(I)}_T$$, where $$T$$ is the value of the Index where the arrow is drawn.