OPEN-SOURCE SCRIPT
已更新

ATR Trend Strategy + KAMA Filter

5 559
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.

發行說明
ATR Trend Strategy + KAMA Filter + Heikin Ashi Option
This strategy combines a dynamic ATR trailing stop system with a simplified Kaufman Adaptive Moving Average (XMA KAMA), providing trend detection and noise filtering. Additionally, it includes an option to use Heikin Ashi candles for signal generation, while keeping the standard candlestick chart view intact.

What is this strategy designed for?
This script is designed for traders who prefer clear, adaptive trend filters combined with additional noise filtering using Heikin Ashi methodology.

ATR trailing stop defines dynamic support and resistance levels that adjust based on market volatility.

KAMA (XMA version) uses an adaptive algorithm that changes speed according to market conditions. In calm markets, it reacts faster; in volatile markets, it slows down to filter out noise.

Heikin Ashi option: The user can choose to base entries on Heikin Ashi candle calculations while still viewing regular candlesticks on the chart. This provides a clean visual display without the need to switch chart types.

How does it work?
1️⃣ Trend detection using ATR trailing stop:
If the price is above the ATR line, the market is in an uptrend. If it's below, the market is in a downtrend.

2️⃣ KAMA (XMA version) as a trend filter:
Unlike simple moving averages, KAMA adjusts its responsiveness according to price efficiency, providing smoother trend shifts.

3️⃣ Optional Heikin Ashi filter:
The user can enable Heikin Ashi-based entries to reduce market noise and filter out false signals while keeping the chart in standard candle mode.

Default parameters and backtest setup:
ATR period: 10

ATR multiplier: 2.7

KAMA (XMA) length: 40

Risk per trade: 1% of total capital

Initial capital: $10,000

Commission: 0.1% per trade

Slippage: 2 ticks

Order type: Market order

Timeframe: Can be used on all timeframes, but works best on H1 and H4.

Why is this strategy original?
Most public strategies rely on standard EMA or SMA filters.
This script uses the KAMA (XMA) method, which is known for its adaptive nature, reacting faster in trends and filtering noise in sideways markets.
Additionally, combining ATR trailing stop for dynamic trend detection with optional Heikin Ashi-based entries makes this strategy unique.

Who is this strategy for?
Swing traders – looking for medium-term trend detection

Intraday traders – aiming to reduce false signals and get smoother entries

Traders who prefer adaptive indicators over fixed MA systems

Disclaimer:
This strategy is for educational and research purposes only.
It is not financial advice and does not guarantee profitability.
Further testing and optimization are recommended before using it in live trading.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。