Corrected QWMA (Quadratic Weighted Moving Average) [Loxx]Corrected QWMA (Quadratic Weighted Moving Average) is the "corrected" version of QWMA. There are other attempts on TradingView to create the QWMA, this is the correct version with weighting applied to the lookback period.
"Correcting" is a process where the value of the average is checked for the significance (how big is it) of change. For that, a standard deviation of a change is used and if the change is "not significant enough", then the change is ignored. Because of this, the average starts to have that "step like" value, but in any case, it should not be mixed with the step average type. The corrected average is different.
The correction period can be used to have different types of calculations:
If the "correction" period is set to < 0, then there is no correction made (in that case the value is exactly the same as original qwma)
If the "correction" period is set to 0, then the "correction" period is the same as qma period
If it is set to any other value, that period is used
Color combinations:
Middle: color (and alerts) on slope change
Levels: (and alerts) on outer levels cross
QWMA: (and alerts) on middle level cross
Included:
Bar coloring
Signals
Alerts
Qwma
Quadratic Weighted (QWMA) MACDMACD but on the Quadratic Weighted Moving Average instead of regular Moving Average
"The quadratic moving average ( QMA ) or quadratic weighted moving average (QWMA) is a type of moving average who is closer to the price when price is up trending. This moving average is defined as the square root of the moving average of the squared price." @alexgrover ()
Base MACD code from @RicardoSantos ()
QMA/SMA DifferenceIntroduction
The quadratic moving average (QMA) or quadratic weighted moving average (QWMA) is a type of moving average who is closer to the price when price is up trending. This moving average is defined as the square root of the moving average of the squared price. The QMA-SMA difference use this moving average to provide a new volatility indicator who aim to be reactive and filter noisy volatility in order to only provide essential information.
QMA - SMA
This indicator is defined as the difference between a quadratic moving average and a simple moving average of same period. Since the QMA emphasize up movements and tend to be away from down movements she is always greater than the simple moving average, so a simple difference between those moving average provide our volatility indicator. Below is a comparison with a standard deviation and the indicator of both period 100.
Since its a difference between two moving average it can be interesting to use a simple moving as source for the standard deviation to provide another comparison
The standard deviation is smoother but still contain more information as well as having less reactivity.
Conclusion
I have a presented a new volatility indicator based on the quadratic moving average and compared it with a classic standard deviation. It is possible to change the power order of the QMA in order to provide different results, in order to do so you must also change the root, this is done in pine with : pow(sma(pow(close,w),length),1/w) where w is the power order, notice that an high power order can provide non attributed values.