# Heikin Ashi Smoothed Indicator for MT5

> Draws smoothed Heikin Ashi candles on the chart, with a moving average before and after the Heikin Ashi step, to show trends with less noise.

## At a glance

- What it is: A free Indicator for MetaTrader 5, written in MQL5.
- What it does: Draws smoothed Heikin Ashi candles on the chart, with a moving average before and after the Heikin Ashi step, to show trends with less noise.
- Shared by: Alex
- Licence: MIT
- Version: 1.0 (1 Dec 2026)
- Settings: 7 inputs
- Lab check: Compiled with MetaEditor build 6333 for MT5 on 1 Dec 2026: 0 errors, 0 warnings.
- Price: Free to download
- Page: https://hub.fxnook.com/heikin-ashi-smoothed-indicator-for-mt5
- Download (compiled): https://hub.fxnook.com/download/4a4c05b7-0bc5-4661-91d5-96a58b5e8f9f/compiled
- Download (source): https://hub.fxnook.com/download/4a4c05b7-0bc5-4661-91d5-96a58b5e8f9f/source

## About

Normal Heikin Ashi candles already filter some noise, but on lower timeframes they still flip colour often. Smoothed Heikin Ashi adds a moving average before and after the Heikin Ashi calculation, giving longer runs of one colour that make the trend easier to follow.

## How it works

1. Open, high, low and close are each smoothed with `Method 1` over `Period 1` bars.
2. Heikin Ashi is calculated on the smoothed prices:
   - `HA close = (open + high + low + close) / 4`
   - `HA open = (previous HA open + previous HA close) / 2`
   - `HA high = max(high, HA open, HA close)`, `HA low = min(low, HA open, HA close)`
3. The four Heikin Ashi values are smoothed again with `Method 2` over `Period 2` bars, and the high and low are kept outside the body.
4. A candle is bullish (first colour) when its smoothed close is at or above its smoothed open, otherwise bearish.

The moving averages are calculated inside the indicator (SMA, EMA, SMMA, LWMA), and only the newest bar is recalculated on each tick.

## Inputs

| Input | Default | What it does |
|---|---|---|
| Method 1 / Period 1 | SMMA / 6 | Smoothing before Heikin Ashi (period 1 = none) |
| Method 2 / Period 2 | LWMA / 2 | Smoothing after Heikin Ashi (period 1 = none) |
| Bullish / bearish colour | SeaGreen / IndianRed | Candle colours |
| Body width (MT4 only) | 3 | Body thickness; match it to your zoom level |
| Alert on colour change | false | One alert when a closed candle changes colour |

## How to use it

1. In MetaTrader open **File > Open Data Folder**.
2. MT4: copy `FXN_HeikinAshiSmoothed.mq4` into `MQL4/Indicators`. MT5: copy `FXN_HeikinAshiSmoothed.mq5` into `MQL5/Indicators`.
3. Right-click **Indicators** in the Navigator and choose **Refresh** (or restart the terminal). The file compiles on first use; you can also open it in MetaEditor and press Compile.
4. Drag the indicator onto a chart and set the inputs.

For a clean view, set the chart to **Line chart** with the line colour equal to the background, or keep normal candles and use the smoothed candles as an overlay. Start with the defaults on H1 or H4. Raise `Period 1` (8-12) for slower, steadier trends; lower it (3-4) for faster reaction. Many traders use the colour as a trend filter and look for entries on pullbacks in the same direction.

## Good to know

- The forming candle changes with price, like any Heikin Ashi. Closed candles do not change, and the alert checks closed candles only.
- Smoothed Heikin Ashi prices are **not** real prices. Do not use them for stop or entry levels.
- More smoothing means more delay: colour changes come later than on plain candles.
- In MT4 the candles are drawn with histogram pairs, so the body width does not follow the zoom automatically.
- It does not trade. The four price buffers can be read with iCustom (open, high, low, close in MT5; low/high, high/low, open, close in MT4).

Trading carries risk. Test on a demo account first; past results do not predict future results.

## Settings (inputs)

| Input | Type | Default | Note |
|---|---|---|---|
| InpMethod1 | ENUM_MA_METHOD | MODE_SMMA | Average type applied to open/high/low/close |
| InpPeriod1 | int | 6 | Average period (1 = no smoothing) |
| InpMethod2 | ENUM_MA_METHOD | MODE_LWMA | Average type applied to the Heikin Ashi values |
| InpPeriod2 | int | 2 | Average period (1 = no smoothing) |
| InpBullColor | color | clrMediumSeaGreen | Bullish candle colour |
| InpBearColor | color | clrIndianRed | Bearish candle colour |
| InpAlertColour | bool | false | Alert once when a closed candle changes colour |

Tags: heikin-ashi, heiken-ashi, smoothed, trend, candles, moving-average, indicator

Shared code is the author's work, not financial advice. Test on a demo account first.
