# Relative Vigor Index 3

This study calculates and displays the Relative Vigor Index and Trigger Line for the data given by the Input Data Input. This study is an ACSIL implementation of the Indicator given in Figures 6.2 and 6.3 of the book Cybernetic Analysis for Stocks and Futures by John Ehlers.

Let $$O_t$$, $$H_t$$, $$L_t$$, and $$C_t$$ denote, respectively, the values of the Open, High, Low, and Close Prices at Index $$t$$.

We first compute two Average Prices at Index $$t$$: The Close-Open Average Price and the High-Low Average Price, denoted as $$\overline{P}^{(CO)}_t$$ and $$\overline{P}^{(HL)}_t$$, respectively. These are symmetric weighted averages computed over $$4$$ periods for $$t \geq 3$$ as follows.

$$\displaystyle{\overline{P}^{(CO)}_t = \frac{(C_{t - 3} - O_{t - 3}) + 2(C_{t - 2} - O_{t - 2}) + 2(C_{t - 1} - O_{t - 1}) + (C_t - O_t)}{6}}$$

$$\displaystyle{\overline{P}^{(HL)}_t = \frac{(H_{t - 3} - L_{t - 3}) + 2(H_{t - 2} - L_{t - 2}) + 2(H_{t - 1} - L_{t - 1}) + (H_t - L_t)}{6}}$$

Let $$n$$ denote the Length Input.

We denote the values of the Relative Vigor Index 3 and the Trigger Line for the given Input at Index $$t$$ as $$RVI_t(n)$$ and $$Trig^{(RVI)}_t(n)$$, respectively, and we compute them as follows.

$$\displaystyle{RVI_t(n) = \left\{ \begin{matrix} \frac{\sum_{i = t - n + 1}^t \overline{P}^{(CO)}_i}{\sum_{i = t - n + 1}^t \overline{P}^{(HL)}_i} & \sum_{i = t - n + 1}^t \overline{P}^{(HL)}_i \neq 0 \\ 0 & \sum_{i = t - n + 1}^t \overline{P}^{(HL)}_i = 0 \end{matrix}\right .}$$

$$Trig^{(RVI)}_t(n) = RVI_{t - 1}(n)$$

For an explanation of the Sigma ($$\Sigma$$) notation for summation, refer to our description here.