OPEN-SOURCE SCRIPT
Kaufman Adaptive Moving Average + ART

**Kaufman Adaptive Moving Average (fixed TF) + ATR Volatility Bands**
This script is a Pine Script v5 extension of the original *Kaufman Adaptive Moving Average* by Alex Orekhov (everget).
It adds:
* a **fixed timeframe option** for KAMA
* a separate **ATR panel under the chart**
* **configurable ATR volatility levels** with dynamic coloring.
KAMA adapts its smoothing to market conditions: it speeds up in strong trends and slows down in choppy phases. Here, KAMA can be calculated on any timeframe (e.g. 1D) and overlaid on a lower-timeframe chart (e.g. 1H), so you can track higher-TF trend structure while trading intraday.
The ATR panel visualizes volatility in the same or a separate timeframe and highlights phases of high/low volatility based on user-defined thresholds.
---
### Features
**KAMA (on chart)**
* Standard KAMA parameters: `Length`, `Fast EMA Length`, `Slow EMA Length`, `Source`
* Input: **KAMA Timeframe**
* empty → uses chart timeframe
* any value (e.g. `60`, `240`, `D`, `W`) → calculates KAMA on that fixed TF and maps it to the chart
* Color-changing KAMA line:
* **green** when the selected-TF KAMA is rising
* **red** when it is falling
* Optional *Await Bar Confirmation* to avoid reacting to still-forming bars
* Built-in alert when the KAMA color changes (potential trend shift).
**ATR panel (separate window under the chart)**
* Own inputs: `Show ATR`, `ATR Length`
* **ATR Timeframe** input:
* empty → ATR uses the same TF as KAMA
* custom value → fully independent ATR timeframe
* Two user-defined volatility levels:
* `ATR High Vol Level` – threshold for **high volatility**
* `ATR Low Vol Level` – threshold for **low volatility**
* ATR line coloring:
* **red** when ATR > High Vol Level (high volatility regime)
* **green** when ATR < Low Vol Level (quiet market)
* **blue** in the normal range between the two levels.
---
### How to use
1. Add the script to your chart.
2. Choose a **KAMA Timeframe** (leave empty for chart TF, or set to a higher TF for multi-timeframe trend following).
3. Optionally set a different **ATR Timeframe** to monitor volatility on yet another TF.
4. Adjust `ATR High Vol Level` and `ATR Low Vol Level` to match the instrument and timeframe you trade.
5. Use:
* the **KAMA color changes** as trend / regime signals, and
* the **ATR colors & levels** to quickly see whether you’re trading in a low-, normal- or high-volatility environment.
This combination is designed to keep the chart itself clean (only KAMA on price) while giving you a dedicated volatility dashboard directly underneath.
This script is a Pine Script v5 extension of the original *Kaufman Adaptive Moving Average* by Alex Orekhov (everget).
It adds:
* a **fixed timeframe option** for KAMA
* a separate **ATR panel under the chart**
* **configurable ATR volatility levels** with dynamic coloring.
KAMA adapts its smoothing to market conditions: it speeds up in strong trends and slows down in choppy phases. Here, KAMA can be calculated on any timeframe (e.g. 1D) and overlaid on a lower-timeframe chart (e.g. 1H), so you can track higher-TF trend structure while trading intraday.
The ATR panel visualizes volatility in the same or a separate timeframe and highlights phases of high/low volatility based on user-defined thresholds.
---
### Features
**KAMA (on chart)**
* Standard KAMA parameters: `Length`, `Fast EMA Length`, `Slow EMA Length`, `Source`
* Input: **KAMA Timeframe**
* empty → uses chart timeframe
* any value (e.g. `60`, `240`, `D`, `W`) → calculates KAMA on that fixed TF and maps it to the chart
* Color-changing KAMA line:
* **green** when the selected-TF KAMA is rising
* **red** when it is falling
* Optional *Await Bar Confirmation* to avoid reacting to still-forming bars
* Built-in alert when the KAMA color changes (potential trend shift).
**ATR panel (separate window under the chart)**
* Own inputs: `Show ATR`, `ATR Length`
* **ATR Timeframe** input:
* empty → ATR uses the same TF as KAMA
* custom value → fully independent ATR timeframe
* Two user-defined volatility levels:
* `ATR High Vol Level` – threshold for **high volatility**
* `ATR Low Vol Level` – threshold for **low volatility**
* ATR line coloring:
* **red** when ATR > High Vol Level (high volatility regime)
* **green** when ATR < Low Vol Level (quiet market)
* **blue** in the normal range between the two levels.
---
### How to use
1. Add the script to your chart.
2. Choose a **KAMA Timeframe** (leave empty for chart TF, or set to a higher TF for multi-timeframe trend following).
3. Optionally set a different **ATR Timeframe** to monitor volatility on yet another TF.
4. Adjust `ATR High Vol Level` and `ATR Low Vol Level` to match the instrument and timeframe you trade.
5. Use:
* the **KAMA color changes** as trend / regime signals, and
* the **ATR colors & levels** to quickly see whether you’re trading in a low-, normal- or high-volatility environment.
This combination is designed to keep the chart itself clean (only KAMA on price) while giving you a dedicated volatility dashboard directly underneath.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。