PINE LIBRARY

AdaptiveMovingAverages

Aktualisiert
AdaptiveMovingAverages Library Documentation
This library provides functions for adaptive moving averages using various adaptation styles.

---

get_coeff
*Description:
Calculates the adaptation coefficient based on the selected adaptation style.

*Usage:


*Parameters:
- src: *(series float)* Input price series or data (e.g., `close`, `high`, or a custom calculation).
- length: *(simple int)* Length of the adaptation calculation.
- style: *(AdaptationStyle)* Selected adaptation style:
- AdaptationStyle.atr: Average True Range
- AdaptationStyle.roc: Rate of Change
- AdaptationStyle.stddev: Standard Deviation
- AdaptationStyle.rsi: Relative Strength Index
- AdaptationStyle.bbw: Bollinger Band Width
- AdaptationStyle.hv: Historical Volatility
- AdaptationStyle.fdi: Fractal Dimension Index
- AdaptationStyle.volumen: Volume-Based

*Returns:
*(float)* Adaptation coefficient in the range [0.01, 1.0].

---

adaptive_ema
*Description:
Calculates an Adaptive Exponential Moving Average (Adaptive EMA) using the specified adaptation style.

*Usage:


*Parameters:
- src: *(series float)* Input price series or data.
- length: *(int)* EMA length.
- adaptation_style: *(AdaptationStyle)* Adaptation style (e.g., AdaptationStyle.atr, AdaptationStyle.roc).
- adaptation_length: *(int)* Length used for calculating the adaptation coefficient.

*Returns:
*(float)* Adaptive EMA value.

---

adaptive_dema
*Description:
Calculates an Adaptive Double Exponential Moving Average (Adaptive DEMA).

*Usage:


*Parameters:
- src: *(series float)* Input price series or data.
- length: *(int)* DEMA length.
- adaptation_style: *(AdaptationStyle)* Adaptation style.
- adaptation_length: *(int)* Length used for calculating the adaptation coefficient.

*Returns:
*(float)* Adaptive DEMA value.

---

adaptive_tema
*Description:
Calculates an Adaptive Triple Exponential Moving Average (Adaptive TEMA).

*Usage:


*Parameters:
- src: *(series float)* Input price series or data.
- length: *(int)* TEMA length.
- adaptation_style: *(AdaptationStyle)* Adaptation style.
- adaptation_length: *(int)* Length used for calculating the adaptation coefficient.

*Returns:
*(float)* Adaptive TEMA value.

---

adaptive_wma
*Description:
Calculates an Adaptive Weighted Moving Average (Adaptive WMA).

*Usage:


*Parameters:
- src: *(series float)* Input price series or data.
- length: *(int)* WMA length.
- adaptation_style: *(AdaptationStyle)* Adaptation style.
- adaptation_length: *(int)* Length used for calculating the adaptation coefficient.

*Returns:
*(float)* Adaptive WMA value.

---

adaptive_hma
*Description:
Calculates an Adaptive Hull Moving Average (Adaptive HMA) using a combination of adaptive WMA and adaptive EMA.

*Usage:


*Parameters:
- src: *(series float)* Input price series or data.
- length: *(int)* HMA length.
- adaptation_style: *(AdaptationStyle)* Adaptation style.
- adaptation_length: *(int)* Length used for calculating the adaptation coefficient.

*Returns:
*(float)* Adaptive HMA value.

---

AdaptationStyle Enum
*Description:
The `AdaptationStyle` enum provides predefined options for selecting the adaptation method.

*Options:
- AdaptationStyle.atr: Average True Range
- AdaptationStyle.roc: Rate of Change
- AdaptationStyle.stddev: Standard Deviation
- AdaptationStyle.rsi: Relative Strength Index
- AdaptationStyle.bbw: Bollinger Band Width
- AdaptationStyle.hv: Historical Volatility
- AdaptationStyle.fdi: Fractal Dimension Index
- AdaptationStyle.volumen: Volume-Based

---

Example Usage

Versionshinweise
v2
Versionshinweise
v2
adaptiveAdaptive Moving Average (AMA)moving_averagetechindicator

Pine Bibliothek

Ganz im Sinne von TradingView hat dieser Autor seinen/ihren Pine Code als Open-Source-Bibliothek veröffentlicht. Auf diese Weise können nun auch andere Pine-Programmierer aus unserer Community den Code verwenden. Vielen Dank an den Autor! Sie können diese Bibliothek privat oder in anderen Open-Source-Veröffentlichungen verwenden. Die Nutzung dieses Codes in einer Veröffentlichung wird in unseren Hausregeln reguliert.

Haftungsausschluss