Donchian Channels trend mt4
- Göstergeler
- Ulises Calderon Bautista
- Sürüm: 1.0
### Donchian Channels Trend v1.0
A trend-following breakout indicator that encapsulates price action within a dynamic envelope based on historical highs and lows. Originally conceptualized for TradingView, this tool provides a clear visualization of the directional bias using state memory.
**How it works**
The algorithm calculates the absolute maximum and minimum values over a specified lookback period. It utilizes a finite state machine (FSM) to maintain the current trend direction based on structural price breaks:
* **Bullish State**: Activated when the current price high crosses above the previous period's upper band.
* **Bearish State**: Activated when the current price low crosses below the previous period's lower band.
**Visual features**
* Upper and Lower dynamic threshold bands.
* Central Basis line representing the median point.
* Dynamic color routing that changes the entire channel's color based on the active trend state.
* Signal generation on trend shifts.
**Parameters**
| Parameter | Default | Description |
| :--- | :--- | :--- |
| `InpLength` | 20 | Lookback period for calculating highs and lows. |
| `InpEnableAlerts` | false | Master switch to enable or disable all alerts. |
| `InpAlertPopup` | true | Enables terminal popup alerts. |
| `InpAlertSound` | true | Enables sound notifications. |
| `InpAlertPush` | false | Enables push notifications to the mobile terminal. |
| `InpAlertEmail` | false | Enables email notifications. |
**Key characteristics**
* Non-repainting logic: state changes are confirmed only upon bar close.
* Consistent operation across both MQL4 and MQL5 environments.
* Multi-channel structured alert system.
* Compatible with any timeframe and financial instrument.
**Original source**
Ported from the TradingView Pine Script "Donchian Channels Trend" developed by `holdon_to_profits`.
