PINE LIBRARY

AdaptiveMovingAverages

Atualizado
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

Notas de Lançamento
v2
Notas de Lançamento
v2
adaptiveAdaptive Moving Average (AMA)moving_averagetechindicator

Biblioteca do Pine

De acordo com o verdadeiro espírito do TradingView, o autor publicou esse código Pine como uma biblioteca de código aberto para que outros programadores Pine de nossa comunidade possam reutilizá-lo. Parabéns ao autor! Você pode usar essa biblioteca de forma privada ou em outras publicações de código aberto, mas a reutilização desse código em uma publicação é regida pelas Regras da Casa.

Aviso legal