Home >> (Table of Contents) Studies and Indicators >> Technical Studies Reference >> Moving Average - Adaptive Binary Wave
Technical Studies Reference
- Technical Studies Reference
- Common Study Inputs (Opens a new page)
- Using Studies (Opens a new page)
Moving Average - Adaptive Binary Wave
This study calculates the binary wave for Kaufman's Adaptive Moving Average. Refer to that study to familiarize yourself with the notation used here.
Just as with the Adaptive Moving Average, this study relies on the Inputs Input Data \(X\), Length \(n\), Fast Smoothing Constant \(c_F\), and Slow Smoothing Constant \(c_S\). The study also has an additional Input, namely the Filter Percentage \(f\).
We define two functions \(AMA^{(Low)}_t(X,n,c_F,c_S)\) and \(AMA^{(High)}_t(X,n,c_F,c_S)\) at Index \(t\) as follows.
For \(t = 0\):
\(AMA^{(Low)}_0(X,n,c_F,c_S) = AMA^{(High)}_0(X,n,c_F,c_S) = AMA_0(X,n,c_F,c_S)\)For \(t > 0\):
\(\displaystyle{AMA^{(Low)}_t(X,n,c_F,c_S) = \left\{ \begin{matrix} AMA_t(X,n,c_F,c_S) & AMA_t(X,n,c_F,c_S) < AMA_{t-1}(X,n,c_F,c_S) \\ AMA^{(Low)}_{t-1}(X,n,c_F,c_S) & AMA_t(X,n,c_F,c_S) \geq AMA_{t-1}(X,n,c_F,c_S) \end{matrix}\right .}\)\(\displaystyle{AMA^{(High)}_t(X,n,c_F,c_S) = \left\{ \begin{matrix} AMA^{(High)}_{t-1}(X,n,c_F,c_S) & AMA_t(X,n,c_F,c_S) \leq AMA_{t-1}(X,n,c_F,c_S) \\ AMA_t(X,n,c_F,c_S) & AMA_t(X,n,c_F,c_S) > AMA_{t-1}(X,n,c_F,c_S) \end{matrix}\right .}\)
The function \(AMA^{(Low)}\) only changes value if the Adaptive Moving Average decreases from Index \(t-1\) to Index \(t\). The function \(AMA^{(High)}\) only changes value if the Adaptive Moving Average increases from Index \(t-1\) to Index \(t\).
Finally, the Binary Wave is calculated. We denote the value of the Binary Wave at Index \(t\) for the given Inputs as \(BW_t(X,n,c_F,c_S,f)\), and we compute it as follows.
\(\displaystyle{BW_t(X,n,c_F,c_S,f) = \left\{ \begin{matrix} 1 & AMA_t(X,n,c_F,c_S) - AMA^{(Low)}_t(X,n,c_F,c_S) > \frac{f}{100}\sigma_t(AMA(X,n,c_F,c_S),n) \\ -1 & AMA^{(High)}_t(X,n,c_F,c_S) - AMA_t(X,n,c_F,c_S) > \frac{f}{100}\sigma_t(AMA(X,n,c_F,c_S),n) \\ 0 & otherwise \end{matrix}\right.}\)In the above formula, the function \(\sigma\) (sigma) is the Standard Deviation function.
Inputs
- Input Data
- Length
- Fast Smoothing Constant: This is the Length of a fast-moving Exponential Moving Average. It should be set to a value that is less than that of the Input Slow Smoothing Constant to obtain sensible results.
- Slow Smoothing Constant: This is the Length of a slow-moving Exponential Moving Average.
- Filter Percent: This Input, together with the Standard Deviation, determines the lower bound on both \(AMA_t(X,n) - AMALow_t(X,n)\) and \(AMAHigh_t(X,n) - AMA_t(X,n)\), which in turn determine the value of \(BW_t(X,n,f)\).
Spreadsheet
The spreadsheet below contains the formulas for this study in Spreadsheet format. Save this Spreadsheet to the Data Files Folder.
Open it through File >> Open Spreadsheet.
*Last modified Monday, 26th September, 2022.