TradingView
gotbeatz26107
5 août 2023 23:52

Extended Moving Average (MA) Library 

SPX500 FutureBlackBull Markets

Description

This Extended Moving Average Library is a sophisticated and comprehensive tool for traders seeking to expand their arsenal of moving averages for more nuanced and detailed technical analysis.
The library contains various types of moving averages, each with two versions - one that accepts a simple constant length parameter and another that accepts a series or changing length parameter.
This makes the library highly versatile and suitable for a wide range of strategies and trading styles.


Moving Averages Included:

Simple Moving Average (SMA): This is the most basic type of moving average. It calculates the average of a selected range of prices, typically closing prices, by the number of periods in that range.

Exponential Moving Average (EMA): This type of moving average gives more weight to the latest data and is thus more responsive to new price information. This can help traders to react faster to recent price changes.

Double Exponential Moving Average (DEMA): This is a composite of a single exponential moving average, a double exponential moving average, and an exponential moving average of a triple exponential moving average. It aims to eliminate lag, which is a key drawback of using moving averages.

Jurik Moving Average (JMA): This is a versatile and responsive moving average that can be adjusted for market speed. It is designed to stay balanced and responsive, regardless of how long or short it is.

Kaufman's Adaptive Moving Average (KAMA): This moving average is designed to account for market noise or volatility. KAMA will closely follow prices when the price swings are relatively small and the noise is low.

Smoothed Moving Average (SMMA): This type of moving average applies equal weighting to all observations and smooths out the data.

Triangular Moving Average (TMA): This is a double smoothed simple moving average, calculated by averaging the simple moving averages of a dataset.

True Strength Force (TSF): This is a moving average of the linear regression line, a statistical tool used to predict future values from past values.

Volume Moving Average (VMA): This is a simple moving average of a volume, which can help to identify trends in volume.

Volume Adjusted Moving Average (VAMA): This moving average adjusts for volume and can be more responsive to volume changes.

Zero Lag Exponential Moving Average (ZLEMA): This type of moving average aims to eliminate the lag in traditional EMAs, making it more responsive to recent price changes.

Selector: The selector function allows users to easily select and apply any of the moving averages included in the library inside their strategy.

This library provides a broad selection of moving averages to choose from, allowing you to experiment with different types and find the one that best suits your trading strategy.
By providing both simple and series versions for each moving average, this library offers great flexibility, enabling users to pass both constant and changing length parameters as needed.

Notes de version

v2
I added a lot of new moving averages.
At the bottom of this library is a selectMA input parameter, it contains all currently working MA's that are ready to use.
I will continue my work on this library to fix bugs, finish some other MA's and to provide one-stop shop for all kind of moving averages.

Some of the new code was inspired by or copied from other members of TradingView community and I want to thank them for that:
@everget
@alexgrover
@HPotter
@KivancOzbilgic
@LazyBear

Notes de version

v3

Some functions were fixed with correct implementation

Notes de version

- RMA added
- Bug fixes

Notes de version


Updated:
Kaufman's Adaptive MA calculated closely to original implementation
Commentaires
tradingaccount7777777
Thanks a lot for this!
gotbeatz26107
@tradingaccount7777777, No problem, thanks for using it!
reider
I'm not familiar with programming or PineScript. Is there a way I could put all of these into a single indicator by itself?
gotbeatz26107
@reider,
Sure, with some learning of a PineScript you can import this library and plot any MA from here.
Its up to you how to use it, that's the point of creating a library, so people will easily make their own indicators!
Plus