Trend Detector + Trailing Stop

Heiken Ashi EA MT4 & MT5
MetaTrader Expert Advisor

The Heiken Ashi EA for MT4 and MT5 is a professional trend-following MetaTrader expert advisor that trades using the popular Heiken Ashi indicator. It automatically detects trend direction, opens trades on Heiken Ashi candle color changes, and manages positions with advanced trailing stop methods including Heiken Ashi candles, ATR, PSAR, Moving Averages, Fractals, and more.

Alternative download link Added to cart — redirecting to checkout in 3 seconds...
Download Free Version
Heiken Ashi Expert Advisor for MetaTrader 4 and MetaTrader 5.

NFA & FIFO ONE PAYMENT FREE UPDATES

Key Features of the Heiken Ashi EA for MT4 & MT5

  • Detects the current trend using the powerful RobotFX Heiken Ashi indicator on multiple timeframes
  • Opens and closes trades based on Heiken Ashi candle color changes (green for buy, red for sell)
  • Applies advanced trailing stop techniques to protect and maximize profits on winning trades
  • Offers full risk management with Stop Loss, Take Profit, BreakEven, Trailing Stop, and optional Martingale

The RobotFX Heiken Ashi Expert Advisor is a complete automated trading solution for traders who prefer smooth, noise-reduced trend following. Unlike traditional Japanese candlesticks, Heiken Ashi candles filter out market noise and make trends much easier to identify. This Heiken Ashi EA for MT4 and MT5 combines the visual clarity of Heiken Ashi with intelligent trade management, making it suitable for both beginners and experienced traders.


The EA can trade purely on Heiken Ashi signals or combine them with higher-timeframe trend confirmation for safer entries. It also includes powerful trailing options so you can let profitable trades run while protecting gains.


Heiken Ashi EA for MT4 – Multi Currency Expert Advisor Trading Chart Example
Heiken Ashi EA trading with the trend on multiple timeframes

Heiken Ashi Trend Trading Examples

Money management is fully customizable: traders can use a percentage of free margin for lot size calculation or set a fixed lot size for each trade, ensuring proper risk management while trading with the Heiken Ashi EA.

Configuring Heiken Ashi EA Settings

Heiken Ashi Expert Advisor Settings MT5 / MT4
The RobotFX Heiken Ashi Expert Advisor settings
Take your time to understand what each of these settings does. After you’ve done that, try to optimize the default settings based on the pairs you are trading, the time-frame you trade on, your equity and initial LotSize etc.
  • ClientEmail - fill this with your email IF you are using a paid version of this EA on a LIVE account
  • Enable Lot Size Management (%) - set to true to automatically calculate the lotsize based on the “Lotsize as % of Free Margin”
  • Lotsize as % of Free Margin - see above
  • LotSize as Fixed Value - trade lotsize if “Enable lotsize management” set to false
  • Stop Loss (pips) - stoploss value set in pips
  • Take Profit (pips) - takeprofit value set in pips
  • Maximum orders allowed - how many orders is the EA allowed to have opened at the same time, on the same chart
  • Slippage (pips) - distance allowed for the price to move from the open/close/trail order to the execution
  • Close trades at opposite Heiken Ashi signal - whether or not to close opened trade/s when the Heiken Ashi candles change color
  • Do not close at Heiken Ashi if negative profit - if above is set to true and this to false, the EA will close the trade/s regardless of the profit. Set to true to close only if the profit is positive
  • Close trades at opposite Heiken Ashi trend+signal - whether or not to close the trade/s if the trend changes and there is a buy or sell signal, depending on the trend
  • Close opened winning trades if same signal occurs - if another trade signal occurs and existing trade/s is positive, the EA can close it before starting a new one (if instructed to do so)
  • Do not close trades (if same signal) if negative profit - if above is set to true but the profit of the trade/s is negative, the EA can be instructed not to close the trade. Set to true to close an existing trade only if there is profit at the moment of changing the candle color
  • Display chart info - whether or not to show information on the chart
  • Information color - the chart info color Trades' comment - assign a comment for trades opened by this EA, for easy monitoring
  • MagicNumber - assign a unique number to trades opened by this EA so they can be managed by other EAs or allow this EA to manage trades opened by other EAs
  • Open Next Trade (bars) - this the number of bars/candles between a previously opened trade and the next signal, and it is used a filter to restrict the EA from opening too many trades in a small interval
  • Heiken Ashi signal & trend settings - choose the Heiken Ashi signal settings
  • Number of Heiken Ashi bars to consider the swing - choose the number of Heiken Ashi candles to consider the “swing zone” used to confirm the entry signals
  • Pips away from the last swing - set to 0 pips to deactivate the swing zone.
Example: when using a “Pips away from last swing” of 30 pips the EA will enter a trade when the Heiken Ashi signal changes color AND the price (at that moment) is at least 30 pips away from the swing zone upper level (when buying) or lower level (when selling). This should be used to reject buy signals that might occur on overbought areas or sell signals that happen in oversold areas.
  • FOLLOW TREND A / FOLLOW TREND B - if set to true, the trader can also set the Heiken Ashi trend. Both, one or none of these option can be used.
  • Enable Martingale - whether or not to multiply the next trade’s lotsize if the previous one/s closed in loss
  • Martingale if sum of last 2 orders negative - whether or not to consider the lotsize of the last 2 closed trades instead of only the last 1
  • Martingale multiplier - lotsize multiplier is martingale is enabled
  • Martingale consecutive trades - maximum number of times a trade lotsize is multiplied, if martingale is enabled and the loss not yet recovered
  • Price Trailing Method - choose how the EA trails the winning trade/s; Heiken Ashi can also be used to trail the price
  • Trailing Step (pips) - trailing step used to trail the price
  • Trailing Stop Buffer (pips) - trailing buffer used to trail the price
  • Minimum Profit if Trailing Stop Points - the trailing stop will be placed this distance away from the opened price
  • Trail from Breakeven - whether or not to start trailing only if the price is in profit. Set to false to trail the price as soon as the trade opens, if that is allowed by the trailing option
  • Trailing indicators settings - settings for some indicators used to trail the price (if that option is chosen to trail). For the Heiken Ashi trailing option, the same settings with the signal are used
  • Print more logs (disable for normal use) - set to true for testing and for when something doesn’t seem to work as described. Careful as it will write too many logs and slow down your computer
How do you determine your manual GMT offset?
Go to https://greenwichmeantime.com/ Find your brokers time by seeing it displayed in your trading platform under Market Watch (the top left hand side of your MetaTrader4 platform). Now do a little math to find out the hourly difference between the GMT and your brokers time. That is the offset. If the market watch time is ahead of the GMT then your setting is a positive number. But don't use a plus sign. Just write as you normally would for a positive number. If your broker's time is behind the GMT put a negative sign in front of the number.

Differences between MT5 EA version compared to MT4 EA

The Heiken Ashi MT5 expert advisor:

  • delays opening of trades by a trader defined number of candles/bars to prevent too many orders being places by:
  1. If no open trades, open first trade after previous - applies when there are no trades on the chart
  2. If opened trades, open next trade after previous - applies when there are trades on the chart
  • has the option to close all trades if their (negative) profits reach the Maximum Loss amount and/or close trades based on the Minimum Profit
  • also trails the price by Bollinger Bands line, along with all the other trailing methods from the MT4 version

The MT5 version of the Heiken Ashi EA introduces more refined execution control and improved trade timing logic, making it especially useful for traders who prefer structured, lower-frequency entries with better trend filtering. It is designed to reduce overtrading while maintaining alignment with strong directional moves identified by Heiken Ashi candles.

How to Use Heiken Ashi EA MT4 / MT5

  1. Install the Heiken Ashi EA and the RobotFX Heiken Ashi indicator on your MetaTrader 4 or MetaTrader 5 platform.
  2. Attach the EA to your preferred chart (H1 or H4 recommended for best results).
  3. Configure trend detection (Heiken Ashi on multiple timeframes) and entry signal settings using tools from the MT4 Expert Advisors and MT5 Expert Advisors ecosystem.
  4. Choose your preferred trailing method and set risk management parameters (Stop Loss, Take Profit, Trailing Stop, etc.), optionally combining with advanced tools like trailing stop management.
  5. Optionally enable Martingale and swing zone confirmation for additional control.
  6. Enable AutoTrading and let the EA automatically trade with the Heiken Ashi trend.

Frequently Asked Questions

Q: Does the Heiken Ashi EA work on both MT4 and MT5?

Yes, dedicated versions are available for both MetaTrader 4 and MetaTrader 5.


Q: What makes Heiken Ashi better than regular candlesticks?

Heiken Ashi candles filter out market noise and show clearer trends, making it easier to stay on the right side of the market.


Q: Can I use custom trailing methods?

Yes. The EA supports many trailing options including Heiken Ashi candles, ATR, PSAR, Moving Averages, Fractals, and more, often used alongside indicators from the MT5 indicators collection.


Q: Is this EA suitable for beginners?

Yes. It is beginner-friendly while offering advanced features for experienced traders. Start testing on a demo account, and many users combine it with other systems like Auto Recovery EA strategies to build more resilient trading portfolios.


RobotFX Heiken Ashi trading Video Tutorial

Video Content

In this video series, you will learn how to trade profitably using the Heiken Ashi strategy and the RobotFX Heiken Ashi Expert Advisor for MT4 and MT5. It covers trend identification, high-probability entry signals, advanced trailing stop techniques, money management, signal filtering, and complete EA setup and optimization. You will have to watch the rest of the videos too if you want to master this trading tool.


Auto Recovery EA for MT4 and MT5 is suitable for forex traders looking for automated hedge recovery, drawdown reduction, recovery zone trading and advanced trade management on MetaTrader platforms.

YouTube video thumbnail