Mother of All Moving Averages, MAMA [orion35]This indicator contains the huge number of 53 MA tools . So, with the Mother of All Moving Averages (MAMA) , you can draw any two of these MA tools (that is, almost all the "Moving Average" tools used in the market) in the length and thickness you want.
These MA tools include traditional averages such as SMA , EMA , DEMA, as well as innovative averaging tools such as LFS (Laguerre Filter Smoother), LSMA (Least Square Moving Average), ZLSMA (Zerolag LSMA ) developed by @veryfid and SSMA (Super Smoothed Moving Average ) by John F. Ehlers .
Another great feature of this indicator is that signals can be filtered according to the instant ADX (Average Directional Movement indeX) value of the market. By using this filter, false signals in horizontal markets can be reduced. Also, with the threshold value setting in the ADX filter, calibration can be made for different assets and time frames when desired. In addition, you can color the price bars according to the ADX threshold value you set.
You can also automatically color these drawings in conditional formats as you wish.
If desired, the intersections of the plotted curves can be showed as signals. You can also set alarms for these intersections.
This indicator contains almost twice as many MA tools as the previous Super Moving Average Tools, SMAT indicator. For this reason, they are gathered in two main groups as " Traditional " and " New Generation " MA tools.
These MA tools are listed as follows:
--------- Mostly Traditional MA Tool s ---------
LFS : Laguerre Filter Smoother
SMA : Simple Moving Average
EMA : Exponential MA
DEMA : Double EMA
TEMA : Triple EMA
QEMA : Quadrupole EMA @everget
ZLEMA : Zerolag EMA
KZLEMA : Kalman ZLEMA
LRSMA : Linear Regression SMA
LREMA : Linear Regression EMA
TMA : Triangular MA (slow)
TMA v2 : Triangular MA (normal)
TMA v3 : Triangular MA (fast) @Daveatt
SMMA : SMoothed MA
SSMA : Super Smoother MA © 2013 John F. Ehlers
SSF : Super Smoother Filter @DonovanWall
SSeMA : Smoothed SEnsitive MA @BakwaasTrading
WMA : Weighted MA
VWMA : Volume Weighted MA
VWAP : Volume Weighted Average Price
AMA : Adaptive MA @everget
KAMA : Kaufman's Adaptive MA
FrAMA : Fractal Adaptive MA @Shizaru
ALMA : Arnaud Legoux MA
--------- New Generation MA Tools ---------
HMA : Hull MA
EHMA : Exponential HMA @DonovanWall
JMA : Jurik MA @everget
RMA : Relative MA aka Rolling MA
LWMA : Linearly Weighted MA @io72signals
LSMA : Least Square MA
ZLSMA : Zerolag LSMA @veryfid
ARSI : Adaptive Relative Strength Index @everget
WWMA : Welles Wilder's MA @KivancOzbilgic
VMA : Variable MA by Tushar S. Chande,
VIDYA : Variable Index Dynamic Average @KivancOzbilgic
VIDYA v2 : @Mohamed3nan
TSF : True Strength Force @KivancOzbilgic
TILL : Tillson T3 MA @KivancOzbilgic
DAF : Dynamically Adjustable Filter @alexgrover
KFS : Kalman Filter Smoother @alexgrover
PKF : Parametric Kalman Filter @alexgrover
VAMA : Volatility Adjusted MA @Duyck
CTI : Correlation Trend Indicator by John Ehlers
BF : Blackman Filter @alexgrover
MAMA : MESA Adaptive MA aka: Mother of AMA @KivancOzbilgic
FAMA : Following Adaptive MA @KivancOzbilgic
ARMA : Autonomous Recursive MA @alexgrover
ZARMA : Zerolag ARMA @alexgrover
A2RMA : Adaptive ARMA @alexgrover
EDMA : Exponentially Deviating MA @MightyZinger
BLP : Butterworth Low Pass Filter @DonovanWall
GLP : Gaussian Low Pass Filter @DonovanWall
SWMA : Sine Weighted MA @blackcat1402
Lwma
Bears Bulls Impulse█ OVERVIEW
Maybe another version of the Bears Bulls indicator, but with a unique interpretation on the scripts found here on Tradingview. Again, this indicator is not meant to be used alone but as an entry/exit confirmation with other indicators.
█ CONCEPTS
Using a modified version of the WMA indicator, the LWMA , this indicator will work similarly to the Bears Bulls Power indicator. Quoting from Admiral Markets, "Bulls Power measures the capability of buyers in the market to lift prices above an average consensus of value. Bears Power measures the capability of sellers to drag prices below an average consensus of value. Using them in tandem with a trend measure allows you to identify favorable entry points."
█ HOW TO USE IT
As soon as the color changes, it indicates a change in the price direction and divergences. Green buy, red sell? Not that simple, but following that pattern for scalping may result in some good entries. Following this indicator blindly will not be accurate as using another indicator to filter the signals in favor of a major trend (that indicator could be another Bears Bulls Inpulse from a higher time frame)
LWMA: Linear Weighted Moving AverageCouldn't find searching for Linearly Weighted Moving Average (LWMA) in tradingview. Found one with the LWMA title, but it uses plain WMA calculation without the linearity which more heavily weights recent price data, which I need, so I try to made one.
LWMAs are also quicker to react to price changes than SMA and EMA. If you want a moving average with less lag than an SMA, try a LWMA.
It kind of also have a more clarity in defining the price trend and reversals. Trade signals usually based on crossovers, they can also indicate areas of potential support or resistance. But beware though, multiple false signals may also occur before a significant trend develops. Use a filter, some decent volatility oscillator might do the job.
--
The formula for this Linearly Weighted Moving Average is:
LWMA = (( P n∗ W 1)+( P n−1∗ W 2)+( P n−2∗ W 3)...) / ∑W
P = Price for the period
n = The most recent period, n-1 is the prior period, and n-2 is two periods prior
W = The assigned weight to each period, with the highest weight going first and then descending linearly based on the number of periods being used.
I hope I'm doing right translating it to Pine Script 4. Let me know if I miss something.
WMA/LSMA - Simplified CalculationsLots of moving averages are based on a weighted sum, the most common ones being the simple (arithmetic) and linearly weighted moving average. The problems with the weighted sum approach is that when your moving average is a FIR filter then the number of operations increase with higher values of length, and when the weights are based on a complex calculation this number of operations can increase drastically!
For the common technical analyst the calculation time of moving averages can be an insignificant factor, even more when using higher time frames, however its always a good practice to seek better performances. The SMA has already a calculation where the number of operations is independent of its length, as such it can be easy to do the same for the linearly weighted moving average (WMA). This post will describe the process toward calculating a simple and efficient WMA which will then be used to provide an efficient calculation of the least squares moving average (LSMA).
Carving Impulses Responses
Remember that impulses responses fully describe the properties of moving averages, the impulse response of the WMA is a linearly decreasing function, so we'll try to calculate it without using a weighted sum. We first need to use a cumulative sum, the cumulative sum can be described as a summation from the first element of a series to the n th element of the series, where n is the current bar number, one could say that this operation is actually super inefficient, however this is not the case, as a cumulative sum can be calculated recursively as follows:
y = y + x
The cumulative sum can be described as an amplifier and posses the following impulse response:
Once the cumulative sum receive the impulse signal as input the result will always be equal to 1. This will form the basis of our simplified calculation, all we need to do transform this response into a linearly decreasing one. The full process is as follows:
Get the impulse response of the cumulative sum
Subtract this response from a linearly increasing impulse response of size length
Normalize the result such that the sum of the resulting response is equal to 1
We need a linearly increasing response of size length , this can be done by using a running sum of the original cumulative sum response, however we must make sure that the value of this response is 0 when the one of the cumulative sum is first equal to 1. Because the resulting response as a maximum value of length we need to multiply our cumulative sum response with length , then we proceed to subtraction.
Finally we need to normalize the result, the sum of a linear sequence of values starting at 1 and ending at n is given by the explicit formula : n(n+1)/2 , which in our case give length*(length+1)/2 , we divide our previous response with this result and we end up with the impulse response of a WMA. This process can be graphically described as follows:
We can then replace the impulse function by the closing price in order to get the WMA of the closing price.
Advantages And Disadvantages
The big advantage of this calculation is its efficiency, in its non functional form (you can see it in the code) the calculation of the WMA only require 9 operations regardless of the value of length against length*2 + 4 for the weighted sum approach, as such both methods are equally efficient in terms of operations as long as the length of a standard WMA is inferior to 3, which is ridiculous, as such our approach is more appropriate.
Another advantage is that Pinescript does not allow for series as length arguments in the WMA function, however here we can have a variable length for the WMA.
Of course there are disadvantages to this approach, in terms of code we require more variables for the non functional form, which create a lengthier scripts. Another disadvantage is that we can be prone to rounding errors due to the cumulative sum, however they shouldn't be significants in our case.
Getting The Least Squares Moving Average
The LSMA is one of my favorite moving averages, and it can derived from a linear combination between the WMA and SMA described as follows : 3WMA - 2SMA. Since we proposed an alternative calculation of the WMA we can then calculate the LSMA without even using the SMA, why ? because the SMA can be calculated by computing the changes over length period of the cumulative sum of an input, this result is then divided by length .
Remember that the impulse response of a cumulative sum is just a rectangular function, all we need is to truncate it such that only length values of the response are equal to 1, this is done thanks to the change function in Pine.
In Summary
A more efficient calculations for both the WMA and LSMA have been presented, while this on itself isn't super important you have learned what is the process toward calculating a filter without relying on a weighted sum.
This calculation will soon be included in the Pinecoders script allowing series as length argument.
Thank you for reading, your interest is always appreciated !