ATR Trend Bands With EMA Filter

# ATR Trend Bands & EMA Indicator for MetaTrader 5 (MQL5)

A professional, volatility-adaptive trend-following indicator for MetaTrader 5. It identifies breakout momentum using dynamically adjusting **Average True Range (ATR) Bands** combined with **Exponential Moving Average (EMA)** multi-timeframe trend filters.

---

## 📌 Features

- **Adaptive ATR Channels:** Dynamically tracks trailing support/resistance bands that expand during high volatility and contract during consolidation.
- **Dynamic Color Transition:** Automatically shifts line colors (Green = Bullish, Red = Bearish, Gray = Neutral) based on the baseline slope.
- **EMA Trend Filter:** Integrates an optional EMA 200 trend filter to prevent taking trades against higher-timeframe momentum.
- **Signal Deduplication:** Internal state machine prevents duplicate consecutive signals, delivering clean, alternating Buy/Sell trade arrows.
- **Zero Repainting on Signals:** Alerts and signal arrows evaluate exclusively on closed candles (`Bar 1`).
- **Comprehensive Alerts:** Native terminal pop-ups and customizable audio notifications.

Suitable for Scalping Traders, the recommended timeframes are M1, M5, M15... or you can use any timeframe you find suitable.

---

## ⚙️ How It Works

### 1. Volatility Band Mechanics
The channel dynamically expands and locks using ATR offsets based on price breakouts:
- **Upper Band (Trailing Resistance)
- **Lower Band (Trailing Support)
- **Mid Band (Baseline):** Calculated as the midpoint between Upper and Lower bands:

### 2. Multi-EMA Trend Framework
- **EMA 55 (Dodger Blue) & EMA 89 (Gold):** Act as dynamic pull-back zones in trending phases.
- **EMA 200 (Magenta):** Macro-trend baseline filter.

---

## 🚦 Trading Signals & Entry Rules

| Signal | Chart Graphic | Trigger Conditions | Trend Filter (`UseEMAFilter = true`) | State Reversal Rule |
| :--- | :--- | :--- | :--- | :--- |
| **BUY** | 🟢 Up Arrow (`#233`) |
| **SELL** | 🔴 Down Arrow (`#234`) |

---

## 🛠️ Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `ATR_Period` | `int` | `14` | Lookback period for Average True Range calculation. |
| `ATR_Multiplier` | `double` | `1.7` | Multiplier defining the channel width and breakout sensitivity. |
| `UseEMAFilter` | `bool` | `true` | When enabled, filters Buy signals above EMA 200 and Sell signals below EMA 200. |
| `ShowLabels` | `bool` | `true` | Displays graphical arrow markers on the chart for validated signals. |
| `EnableAlerts` | `bool` | `true` | Enables pop-up alert dialogs upon bar close. |
| `SoundFile` | `string` | `"alert.wav"` | Audio file played during signal alerts. |
| `Source` | `ENUM_APPLIED_PRICE` | `PRICE_CLOSE` | Applied price calculation base for EMAs. |

---

## 📈 Suggested Trading Strategy

- **Entry:** Enter at the open of the next bar following an arrow confirmation.
- **Stop Loss (SL):**
  - For **BUY**: Place Stop Loss below the current **Lower Band**, below previous swing low or below **EMA 200**.
  - For **SELL**: Place Stop Loss above the current **Upper Band**, above previous swing high or above **EMA 200**.
- **Take Profit (TP) / Exit:**
  - Ride the trend until an opposing signal appears.
  - Or trail your stop loss progressively behind the **Mid Band**.

---

## 📂 Installation

1. Open MetaTrader 5 and click **File -> Open Data Folder**.
2. Navigate to `MQL5/Indicators/`.
3. Copy `ATR_TB_EMA.mq5` into this folder.
4. Restart MetaTrader 5 or right-click **Indicators** in the Navigator panel and select **Refresh**.
5. Drag the indicator onto your preferred chart and timeframe.

---

## 📄 License
This project is open-source under the [MIT License](LICENSE).
Plus de l'auteur
A lightweight, non-intrusive on-chart floating dashboard for MetaTrader 4 (MT4) and MetaTrader 5 (MT5) . It provides critical market telemetry and live account status directly inside the chart window with interactive drag-and-drop and minimize functionality. Key Features Interactive Drag & Drop: Click anywhere on the dashboard panel to reposition it seamlessly across the chart window. Automatic boundary detection keeps the panel within the chart frame. Smart Minimize / Expand Toggle ( _ / + ): C
FREE
# ATR Trend Bands & EMA Indicator for MetaTrader 4 (MQL4) A professional, volatility-adaptive trend-following indicator for MetaTrader 4. It identifies breakout momentum using dynamically adjusting **Average True Range (ATR) Bands** combined with **Exponential Moving Average (EMA)** multi-timeframe trend filters. --- ## Features - **Adaptive ATR Channels:** Dynamically tracks trailing support/resistance bands that expand during high volatility and contract during consolidation. - **Dyna
A lightweight, non-intrusive on-chart floating dashboard for MetaTrader 4 (MT4) and MetaTrader 5 (MT5) . It provides critical market telemetry and live account status directly inside the chart window with interactive drag-and-drop and minimize functionality. Key Features Interactive Drag & Drop: Click anywhere on the dashboard panel to reposition it seamlessly across the chart window. Automatic boundary detection keeps the panel within the chart frame. Smart Minimize / Expand Toggle ( _ / + ): C
FREE
Filtrer:
Aucun avis
Répondre à l'avis