P
PipsGrowth

Smoothed Heikin-Ashi with Closed-Bar Confirmation

#08 · Trend / Price Action Non-Repainting EA Readable Dashboard Alerts

This indicator applies an additional smoothing layer (WMA or EMA) on top of standard Heikin-Ashi candles. The smoothing dramatically reduces noise while preserving trend direction. Color changes signal trend shifts, while Doji-like candles (small body relative to ATR) flag indecision zones where no trades should be taken. Confirmation requires 2+ consecutive same-color candles.

How It Works

Standard HA: HA_Close = (O+H+L+C)/4, HA_Open = (prev_HA_Open + prev_HA_Close)/2. Smoothing: Smoothed_HA_Close = WMA(HA_Close, Smooth_Period), Smoothed_HA_Open = WMA(HA_Open, Smooth_Period). Bull when Smoothed_HA_Close > Smoothed_HA_Open (green). Bear when < (red). Doji when abs(Close - Open) < Doji_Threshold × ATR. Strong bull: 2+ consecutive green with rising closes. Reversal: color change after 2+ same-color.

Entry Signals

  • BUY: 2+ consecutive green HA candles with rising closes after color change from red
  • SELL: 2+ consecutive red HA candles with falling closes after color change from green
  • No-Trade: Doji detected (small body) → indecision zone
  • No-Trade: Less than Confirmation_Bars consecutive same-color candles

Exit Signals

  • TP: Price reaches entry ± (TP_ATR_Mult × ATR)
  • Reversal: Color change after 2+ same-color candles
  • Expiry: Signal_Expiry_Bars passed

Trade / No-Trade Filters

  • Doji Filter: Body < Doji_Threshold × ATR → no signal
  • ATR Regime: Extreme volatility → no signal
  • Spread: Spread > Max_Spread_Points → no signal
  • Cooldown: Last signal < Cooldown_Bars ago → no signal

Source Code Preview

First 50 of 874 lines
PG_08_HeikinAshi_Smoothed.mq5
MQL5
//+------------------------------------------------------------------+
//| PipsGrowth_HeikinAshi_Smoothed_Indicator_v1.mq5 |
//| Copyright 2025, Pipsgrowth.com |
//| https://www.pipsgrowth.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, Pipsgrowth.com"
#property link "https://www.pipsgrowth.com"
#property version "1.00"
#property indicator_chart_window
#property indicator_buffers 16
#property indicator_plots 5
#property indicator_label1 "BUY Entry"
#property indicator_type1 DRAW_COLOR_ARROW
#property indicator_color1 clrLime
#property indicator_width1 2
#property indicator_label2 "SELL Entry"
#property indicator_type2 DRAW_COLOR_ARROW
#property indicator_color2 clrRed
#property indicator_width2 2
#property indicator_label3 "Exit"
#property indicator_type3 DRAW_COLOR_ARROW
#property indicator_color3 clrAqua,clrOrange,clrGray
#property indicator_width3 2
#property indicator_label4 "HA Candles"
#property indicator_type4 DRAW_COLOR_CANDLES
#property indicator_color4 clrLime,clrRed,clrGray
#property indicator_width4 1
#property indicator_label5 "Doji"
#property indicator_type5 DRAW_ARROW
#property indicator_color5 clrOrange
#property indicator_width5 1
//--- Inputs
input group "Core"
enum ENUM_SMOOTH_METHOD { SM_WMA, SM_EMA, SM_SMA };
input ENUM_SMOOTH_METHOD Smooth_Method = SM_WMA; // Smoothing method
input int Smooth_Period = 3; // Smoothing period
input int Confirmation_Bars = 2; // Consecutive same-color candles to confirm
input double Doji_Threshold = 0.15; // Body/ATR ratio for doji detection
input group "SL/TP"
input int ATR_Period = 14; // ATR period
input double SL_ATR_Mult = 1.0; // Stop loss in ATR multiples
input double TP_ATR_Mult = 1.5; // TP in ATR multiples
input int Signal_Expiry_Bars = 12; // Bars before expiry

Educational purposes only. Do NOT use with real money. Test on demo accounts only.

Key Features

Double-smoothed Heikin-Ashi (HA + WMA/EMA)
Doji detection for no-trade zones
2+ candle confirmation requirement
Color-coded trend visualization
Noise reduction without excessive lag
ATR-adaptive Doji threshold

Input Parameters

Smooth_Period
Default: 3
Smoothing period for HA values
Smooth_Method
Default: WMA
Smoothing method (WMA or EMA)
Doji_Threshold
Default: 0.15
Body/ATR ratio for Doji detection
Confirmation_Bars
Default: 2
Consecutive same-color candles required
SL_ATR_Mult
Default: 1.0
Stop loss in ATR multiples
TP_ATR_Mult
Default: 1.5
TP in ATR multiples

Installation Guide

1Download the .mq5 file using the download button
2Open MetaTrader 5 → File → Open Data Folder
3Navigate to MQL5 → Indicators
4Copy the .mq5 file into the Indicators folder
5Open MetaEditor (F4) and press F5 to compile
6The indicator will appear in Navigator under Indicators
7Drag the indicator onto your chart
8Test on a demo account before live trading

Clear Warning: Educational Purposes Only

This indicator is for educational and testing purposes only. Do NOT use it with real money. Test only on demo accounts. Trading with real money involves substantial risk of capital loss. This tool does not constitute investment advice.

Community

Sign in to contributeSign In

Frequently Asked Questions

The Heikin-Ashi color is your filter, the real candle is your confirmation. The HA smoothed color tells you the direction of the trend according to the indicator's smoothing. The real candle (with its actual open/close) is what you use to time your entry. The standard workflow: HA turns green → watch for a pullback entry on a bullish real candle. When the real candle shows a rejection (like a pin bar) at the same time HA is green, that's high-probability. Never take a "sell" on a real bullish candle just because HA turned red — wait for the real candle to confirm the reversal first.
Last updated: July 11, 2026

Educational Disclaimer

This content is for educational purposes only and does not constitute financial or investment advice. Trading involves significant risk and you may lose your capital. Always consult a licensed financial advisor before making investment decisions.

Smoothed Heikin-Ashi with Closed-Bar Confirmation | Free MT5 Indicator