Supertrend with dual EMA confirmed
- Indicadores
- Versão: 1.4
Features
- Triple-state trend engine: the Supertrend line is drawn lime in a confirmed uptrend, red in a confirmed downtrend, and grey when there is no clean trend.
- Dual EMA confirmation: a trend counts only when price agrees with the long EMA and the short EMA agrees with the long EMA, which filters out weak, counter-trend moves.
- Multi-candle confirmation: a trend is confirmed only after a set number of consecutive candles all meet the conditions, which removes single-bar noise.
- Minimum-distance filter: price must sit a minimum percentage away from the Supertrend line before a state is accepted, ignoring borderline touches.
- Trend-change arrows: an arrow marks the bar where a new confirmed uptrend or downtrend begins.
- On-chart status label: shows the current state, how many candles have confirmed it, and which filters are active, with adjustable corner, position, font and colors.
Inputs
- SupertrendPeriod (default 10) and SupertrendMultiplier (default 3.0): the ATR-based Supertrend settings.
- EMAShortPeriod (default 50) and EMALongPeriod (default 108): the two confirmation EMAs.
- UseEMAFilter (default true): require price on the correct side of the long EMA.
- UseDualEMAFilter (default true): require the short EMA on the correct side of the long EMA.
- TrendConfirmCandles (default 3): consecutive candles needed to confirm a trend.
- MinDistancePercent (default 0.05): minimum distance from the Supertrend line, as a percent of price.
- Visual: ShowTrendText, ShowArrows, ArrowCode (default 159), UpTrendColor, DownTrendColor, NoTrendColor.
- Label position: LabelCorner, LabelXDistance, LabelYDistance, LabelFontSize, LabelFont.
Outputs
- A Supertrend line that changes color by state: lime (uptrend), red (downtrend) or grey (no trend).
- A yellow arrow at each confirmed trend change.
- A text label with the current state, confirmation count and active filters.
Alerts
This version is a visual trend filter and does not send popup, sound, push or email alerts.
Limitations
Like all ATR and EMA tools, the indicator follows price and is not predictive; it lags slightly and can show No Trend during sharp, fast reversals. The colored line on the forming candle can update until the bar closes, while trend-change arrows are placed on closed bars. It is a trend filter and confirmation layer, not a complete entry system, so combine it with your own entry trigger, stop loss and risk management.
Full trading guide and examples: see the Comments section.
Group support: https://www.mql5.com/en/channels/vuongphamtrading
