PINE LIBRARY

AdaptiveMovingAverages

Telah dikemas kini
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

Nota Keluaran
v2
Nota Keluaran
v2
adaptiveAdaptive Moving Average (AMA)moving_averagetechindicator

Perpustakaan Pine

Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai satu perpustakaan sumber terbuka supaya pengaturcara Pine lain dari komuniti kami boleh menggunakannya semula. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara peribadi atau dalam penerbitan sumber terbuka lain, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman.

Penafian