OPEN-SOURCE SCRIPT

ATR Trend Strategy + KAMA Filter

1 428
ATR Trend Strategy with XMA KAMA Filter
Strategy Description
This strategy combines a dynamic ATR trailing stop with an XMA KAMA filter to precisely detect trends and generate reliable entry signals.

It uses a two-step trend confirmation system:

1️⃣ ATR Trailing Stop
Based on the Average True Range (ATR), this trailing stop automatically adapts to market volatility.
It determines whether the market is in a bullish or bearish phase by comparing the current price to the ATR trailing stop level.

2️⃣ KAMA Filter (XMA Version)
KAMA (Kaufman Adaptive Moving Average) provides an additional trend filter.
This XMA version of KAMA avoids the traditional fast/slow parameters and instead dynamically calculates the ratio of signal to market "noise", helping to reduce false signals and over-sensitivity.

How It Works
Long Signal:
Price is above both the ATR trailing stop and the KAMA (XMA) line.

Short Signal:
Price is below both the ATR trailing stop and the KAMA (XMA) line.

What Makes This Strategy Different?
Unlike many classic strategies that rely on simple moving averages, this system uses an adaptive KAMA filter that responds better to changing market conditions and volatility.

The ATR trailing stop automatically adjusts to current market volatility, providing an extra layer of protection against false breakouts.

By combining these tools, this strategy offers:

Precise trend filtering

Avoidance of false breakouts and noise

Dynamic adjustment to market conditions

How to Use
Apply the strategy to any market chart (Forex, stocks, crypto, indices, etc.)

Adjust the ATR and KAMA parameters to match your trading plan

Use the TradingView Strategy Tester to evaluate performance before live trading

Who Is This For?
Swing traders and trend followers

Traders looking for clean, filtered signals with reduced noise

Medium-term traders seeking a system that adapts to market dynamics

Additional Info: Heikin Ashi Compatibility
This strategy is fully compatible with Heikin Ashi candles.

By applying it to a chart with Heikin Ashi candles, traders can further reduce market noise and enhance trend visualization.
The combination of ATR trailing stop + XMA KAMA filter + Heikin Ashi smoothing provides an even cleaner trend-following system, minimizing false signals and improving decision-making clarity.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.