OPEN-SOURCE SCRIPT

Kaufman Adaptive Moving Average + ART

46
**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.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน