Forex Systems Review
Trend non-repaint Free · Apache-2.0

Heiken Ashi Naive EA for MT4 & MT5

Heiken Ashi Naive expert advisor running on an MT5 chart, showing smoothed Heiken Ashi candles and an open contrarian trade placed against a strongly coloured candle run.
Heiken Ashi on a MetaTrader chart. Source: EarnForex.com (Apache-2.0).
In short

Heiken Ashi Naive is a free MT4/MT5 expert advisor, not a plotting indicator. It trades a deliberately contrarian Heiken Ashi strategy, by default it sells when candles turn strongly bullish and buys when they turn strongly bearish. The underlying Heiken Ashi candles are computed only from closed bars, so finished candles do not repaint.

Heiken Ashi (Japanese for "average bar") is a charting technique that smooths the standard candlestick by averaging each bar's open, high, low, and close with the prior bar. The result strips out a lot of the bar-to-bar noise and makes the underlying trend much easier to read at a glance. It is one of the first tools most retail traders reach for when they want a cleaner picture of direction.

The free download on this page, Heiken Ashi Naive, is not the standard Heiken Ashi overlay you may be expecting. It is an automated expert advisor (EA), originally coded by EarnForex.com and re-hosted here under its open licence, that places live trades based on a deliberately contrarian Heiken Ashi rule. We explain exactly what it does, why it is called "naive," the inputs that matter, and an honest account of the risks, including the author's own blunt warning that it can lose your whole balance.

What is the Heiken Ashi indicator?

Heiken Ashi Naive is an automated MT4/MT5 expert advisor that trades a contrarian Heiken Ashi strategy, by default it opens sells when the Heiken Ashi candles turn strongly bullish and opens buys when they turn strongly bearish. It is a trading robot, not a chart indicator: drop it on a chart and it will attempt to place real orders, so it belongs on a demo account until you understand its behaviour.

The "naive" in the name is honest labelling by the author. Rather than following the conventional wisdom of buying bullish Heiken Ashi candles and selling bearish ones, this EA does the opposite through its Inverted input, fading strong moves on the assumption that an extended run of one-coloured Heiken Ashi candles is stretched and likely to snap back. The README reports only "moderate" long-term backtest profit on EUR/USD on the daily chart, a single pair on a single timeframe, which is a very thin sample to lean on.

How does the Heiken Ashi indicator work?

To understand the EA you first have to understand the Heiken Ashi candle it reads from. Each Heiken Ashi bar is built from four averaged values rather than the raw OHLC:

The close is the simple average of the current bar's open, high, low, and close. The open is the average of the previous Heiken Ashi candle's open and close. The high and low take the extreme of the real high/low and the new HA open/close. Because each candle folds in the prior candle, a sustained trend produces a run of same-colour bodies with little or no opposing wick, while indecision shows up as small bodies with wicks on both sides.

That smoothing is why Heiken Ashi looks so clean, and it is also the source of its main weakness, which we cover below. Critically, every Heiken Ashi value is derived only from closed price data. Once a bar finishes, its Heiken Ashi candle is fixed and will not change; only the current, still-forming candle updates as live price ticks. So finished Heiken Ashi candles do not repaint, that is a behaviour description, not a promise about results.

The Naive EA layers a trading rule on top. It watches for candles that are strongly directional and, with the default Inverted = true, takes the opposite side: a powerfully bullish candle triggers a sell, a powerfully bearish one triggers a buy. Position size is either a fixed lot or, if money management is switched on, an ATR-based size scaled to a percentage of your balance so that wider recent ranges produce smaller positions. Each order is tagged with a magic number so the EA only manages its own trades.

Heiken Ashi settings and parameters

These inputs govern the EA's trade direction and how large each position is. The single most behaviour-changing one is Inverted; the rest mostly tune position sizing and order handling. Here is what each does in plain English.

ParameterDefaultWhat it does
InvertedtrueThe core behaviour switch. When true (the default), the EA fades the signal, it sells on strongly bullish candles and buys on strongly bearish ones. Set it false to trade the conventional way: buy bullish, sell bearish.
Lots0.1The fixed lot size used for every trade when money management is off. This is the simplest sizing mode, change it to match your account size and risk appetite.
MMfalseMoney-management master switch. When true, it ignores the fixed Lots value and sizes each position from ATR and your chosen risk percentage instead, so size adapts to volatility.
ATR_Period20How many bars the Average True Range averages when MM is on. Shorter periods make sizing react faster to recent volatility; longer periods smooth it out.
ATR_Multiplier1Scales the ATR used in the risk calculation. Higher values treat the market as effectively more volatile, which shrinks the calculated position size; lower values do the reverse.
Risk2The percentage of balance risked per trade when MM is on. The default of 2% is aggressive for a single position, most risk frameworks suggest 1% or less while you are validating an unproven strategy.
FixedBalance0If set above zero, sizing is calculated against this fixed figure instead of your real account balance. Useful for keeping position size constant while testing, rather than letting it compound.
UseEquityInsteadOfBalancefalseWhen true, risk sizing is based on floating equity rather than closed balance. Equity reacts to open-trade profit and loss, so sizing tightens as drawdown grows.
Slippage100Maximum slippage tolerated on order execution, in points. Higher values let orders fill in fast markets at a worse price; lower values may reject fills during volatile moves.
Magic1520122013A unique ID stamped on every order so the EA only touches its own trades. Give each EA on the same account a different magic number to avoid conflicts.

Pros and cons (the honest version)

What it does well

  • Fully free and open-licence, and it runs on both MetaTrader 4 and MetaTrader 5.
  • The underlying Heiken Ashi candles are built only from closed bars, so finished candles stay fixed and do not repaint.
  • Heiken Ashi smoothing genuinely makes the prevailing trend easier to read than raw candlesticks.
  • Optional ATR-based money management scales position size to recent volatility instead of using one fixed lot.
  • The single Inverted switch lets you trade either the contrarian or the conventional Heiken Ashi rule without touching code.
  • Magic-number tagging means it coexists cleanly with other EAs and manual trades on the same account.

Where it falls short

  • This is an automated EA that places live trades, not a passive chart indicator, the author warns plainly that it can lose your entire balance.
  • The default contrarian (Inverted) logic fades trends, which means it is fighting momentum and can be run over during strong directional moves.
  • Reported edge is thin: only "moderate" backtest profit on a single pair (EUR/USD) on a single timeframe (D1), which does not prove it generalises.
  • Heiken Ashi lags because it is a double-smoothed average, its candles confirm a turn well after raw price has already moved.
  • It whipsaws in ranging markets, where the smoothing produces small alternating bodies and no real trend to fade or follow.
  • The 2% default risk per trade is aggressive for an unvalidated strategy; combined with the contrarian logic, drawdowns can compound quickly.
Free download

Download Heiken Ashi free

Enter your email and we'll send you Heiken Ashi for MT4, packaged with its original Apache-2.0 licence and author credit. Come back for any of our other free indicators whenever you want one.

We never share or sell your email. One-click unsubscribe in every message.

How to install Heiken Ashi on MetaTrader 4

  1. Download the free Heiken Ashi Naive zip file from the link on this page.
  2. Extract the zip and locate the .mq4 file (use the .mq5 file if you are on MetaTrader 5).
  3. In MetaTrader, open File → Open Data Folder, then go into MQL4/Experts (or MQL5/Experts on MT5), note this is the Experts folder, not Indicators, because it is an EA.
  4. Copy the file into that Experts folder.
  5. Restart MetaTrader, or right-click the Navigator panel and choose Refresh so the EA appears under Expert Advisors.
  6. Open a demo chart, then drag Heiken Ashi Naive from the Navigator onto it and tick "Allow live trading" in the dialog.
  7. Set the inputs, start with Inverted and your lot/risk settings, confirm AutoTrading is enabled, and click OK.

Heiken Ashi FAQ

Does Heiken Ashi repaint?

No, not on closed bars. Each Heiken Ashi candle is calculated only from completed open/high/low/close values, so once a bar finishes its Heiken Ashi candle is locked and will not change. The only candle that updates is the current, still-forming one, which naturally tracks live price until that bar closes. That is normal live recalculation, not retroactive repainting of past history.

Is Heiken Ashi Naive an indicator or an expert advisor?

It is an expert advisor (EA), a trading robot that places live orders automatically. It is not the passive Heiken Ashi overlay that only recolours your candles. Because it can open and close real trades, install it in the Experts folder and only run it on a demo account until you fully understand its behaviour.

Why does it buy on bearish candles and sell on bullish ones?

That is the deliberate "naive" contrarian design, controlled by the Inverted input, which defaults to true. The strategy fades strong moves on the idea that a long run of one-coloured Heiken Ashi candles is stretched and may snap back. If you prefer the conventional approach, buying bullish candles and selling bearish ones, set Inverted to false.

What timeframe works best?

The only positive backtest the author published was on the EUR/USD daily (D1) chart, so D1 is the sensible place to begin. Heiken Ashi's smoothing is generally more dependable on higher timeframes (H4 and up) and noisier on lower ones. Whatever you choose, re-test it on your own broker's data before trading it live.

Does it work on MT5 as well as MT4?

Yes. The download ships for both MetaTrader 4 and MetaTrader 5. Use the .mq4 file for MT4 and the .mq5 file for MT5, and place it in the matching Experts folder. The strategy logic and inputs are the same on both platforms.

Is it safe to run on a live account?

Treat it as experimental. The author states plainly that it can lose all your money and should be applied to a live account at your own risk only. The reported edge rests on one pair and one timeframe, and the default contrarian logic fights trends. Demo-test it thoroughly, lower the risk percentage, and never run it with money you cannot afford to lose.


Related free MT4 indicators