EasyLanguage Reserved Words & Functions
The AdaptiveMovAvg series function calculates an adaptive moving average based on a variable speed exponential moving average. The number of bars used in the average is reduced as the price action becomes steadier with lower volatility. The number of bars used increases when the price action becomes more volatile.
This function is used to smooth the values of other functions or values. It calculates an efficiency ratio based on the trending tendency of prices, then a smoothing factor is calculated and applied to the calculation.
AdaptiveMovAvg(Price,EffRatioLength,FastAvgLength,SlowAvgLength)
A numeric value containing a variable speed exponential moving average..
Name | Type | Description |
Price | Numeric | Specifies which bar value (price, function, or formula) to consider. |
EffRatioLength | Numeric | Sets he number of bars used to calculate an efficiency ratio. |
FastAvgLength | Numeric | Sets the number of bars used to calculate a fast smoothing factor. |
SlowAvgLength | Numeric | Sets the number of bars used to calculate a slow smoothing factor. |
The input parameter Price can be a bar value such as Close, High, Low, Open, or Volume. It can also be any mathematical calculation such as High + Low) / 2, or a numeric function such as RSI, Stochastic, or ADX.
The value for the Length input parameter should always be a whole number greater than 0.
Assigns the AdaptiveMovAvg value of the bar Close to Value1, then plots Value1:
Value1 = AdaptiveMovAvg(Close, 10, 2, 30);
Plot1(Value1, "ADPMA");
Assigns the AdaptiveMovAvg value for the RSI function to Value1, then plots Value1:
Value1 = AdaptiveMovAvg(RSI(Close,14), 10, 2, 30);
Plot1(Value1, "ADPRSI");