Skip to content
FXNook HubBeta

Alex / Heikin Ashi Smoothed Indicator for MT4

MetaTrader 4IndicatorMITCompiled · build 2425
AlexFirst version.build 2425v1.06 hours ago1 version
README

Overview

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.

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

InputDefaultWhat it does
Method 1 / Period 1SMMA / 6Smoothing before Heikin Ashi (period 1 = none)
Method 2 / Period 2LWMA / 2Smoothing after Heikin Ashi (period 1 = none)
Bullish / bearish colourSeaGreen / IndianRedCandle colours
Body width (MT4 only)3Body thickness; match it to your zoom level
Alert on colour changefalseOne 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.

At a glance

What it is
A free Indicator for MetaTrader 4, written in MQL4.
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
12 inputs
Lab check
Compiled with MetaEditor build 2425 for MT4 on 1 Dec 2026: 0 errors, 0 warnings.
Price
Free to download

Settings read from the code

InputTypeDefaultNote
InpSep1string=== Smoothing before Heikin Ashi ===---- Smoothing before Heikin Ashi ----
InpMethod1ENUM_MA_METHODMODE_SMMAAverage type applied to open/high/low/close
InpPeriod1int6Average period (1 = no smoothing)
InpSep2string=== Smoothing after Heikin Ashi ===---- Smoothing after Heikin Ashi ----
InpMethod2ENUM_MA_METHODMODE_LWMAAverage type applied to the Heikin Ashi values
InpPeriod2int2Average period (1 = no smoothing)
InpSep3string=== Display ===---- Display ----
InpBullColorcolorclrMediumSeaGreenBullish candle colour
InpBearColorcolorclrIndianRedBearish candle colour
InpBodyWidthint3Candle body width (1-5, match it to your chart zoom)
InpSep4string=== Alerts ===---- Alerts ----
InpAlertColourboolfalseAlert once when a closed candle changes colour

How to use it

  1. Download the compiled file (or the source and compile it in MetaEditor).
  2. Put it in MetaTrader: File → Open Data Folder → MQL4 → Indicators, then refresh the Navigator.
  3. Test it on a demo account before any real money.
  4. Want changes? Open a copy in your Lab and ask for them in plain words.