This indicator is different from others because with it you can select the MA type used in calculations for each line.
Available MA types are (currently):
Also configurable (for each line) are data source (open, close, hlc3, etc) and period.
- Added Double Exponential Moving Average (DEMA)
- Reordered input options
- Triple Exponential Moving Average (TEMA)
- Zero Lag Exponential Moving Average (ZLEMA)
- Reorganised inputs with the new (march 12) Pine updates
- Added Symmetrically Weighted Moving Average (SWMA) - it does use period in the calculation, so if you select this in a certain MA line, any period set will be ignored (in that specific MA line of course)
- Removed VWMA (see below why)
- Added option to make moving averages volume-weighted
The Volume-Weighted Moving Average is calculated with the following (example) formula:
sma(close * volume, 20) / sma(volume, 20)
- "close" is the data source, default is close but it can be set as open, high, HL2 (which means (high + low)/2), HLC3 (which means (high + low + close)/3), etc.
- 20 is the period example, you can type in any amount of candlesticks
So, by the same principle, it's possible to make any other moving average volume-weighted.
Then VWMA was removed because it became redundant (it is exactly like SMA with volume-weighted enabled).
Keep in mind: this makes the moving average lines more "rough" (it becomes much less smoothed) if enabled.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.