# Technical Studies Reference

### Moving Average Difference

To familiarize yourself with the terminology and notation used in this study, refer to the documentation for the study Moving Average - Simple.

This study calculates and displays the difference between two moving averages, whose types are chosen by the user with the Input Moving Average Type. By default, both moving averages are Simple Moving Averages. The Input Input Data is denoted as $$X$$, and the Inputs Length 1 and Length 2 of these two moving averages are denoted as $$n_1$$ and $$n_2$$, respectively.

We denote the Moving Average Difference at Index $$t$$ for the given Inputs as $$\Delta SMA_t\left(X,n_1,n_2\right)$$, and we compute it for $$t \geq \max\{n_1,n_2\}$$ as follows.

$$\Delta SMA_t\left(X,n_1,n_2\right) = SMA_t\left(X,n_1\right) - SMA_t\left(X,n_2\right)$$

The Subgraph of this indicator is displayed in two user-selected colors: one for when the Subgraph is rising, and the other for when it is falling.

Note: Depending on the setting of the Inputs Moving Average Types 1 and 2, the Simple Moving Averages in the above formula 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.