✔️ Heiken Ashi EA MT4©: https://www.mql5.com/en/market/product/45283
✔️ Heiken Ashi EA MT5©: https://www.mql5.com/en/market/product/64877
Video Guide: How to Set Up Heiken Ashi EA MT4/5 with Provided Set Files - Please Enable Subtitles in this YouTube Video!
RECOMMENDATIONS FOR MAY 2025
For the Heiken Ashi EA MT4/5, my current recommendation is to trade only the following set files: DE40, GBPAUD, US500, USDCAD, XAUUSD with a low risk of 0.5% or lower per trade.
You can find the Heiken Ashi EA MT4/5 set files, along with detailed instructions and advice, at the bottom of this guide.
Please Enable Subtitles in this YouTube Video!
Heiken Ashi EA MT4/5 Settings/Inputs Guide
-
Allow Long: Enables or disables Buy trades. Set to True to allow the EA to open Buy trades, or False to disable them.
-
Allow Short: Enables or disables Sell trades. Set to True to allow the EA to open Sell trades, or False to disable them.
-
Minimum Distance for Same Direction Trades in Points: This setting defines the minimum required distance (in points) between trades in the same direction (Buy or Sell). If you want to trade Heiken Ashi candles in the traditional way—where a new trade is opened only on the first candle of a different color—you can enter a very large number here (e.g., 1000000). If you allow multiple trades in the same direction, this setting prevents them from being too close together.
- Maximum Number of Trades per Heiken Ashi Change: This determines how many trades (in the same direction) the EA can open per Heiken Ashi color change (trend shift). It includes both open and closed trades within the same Heiken Ashi cycle, and every time the Heiken Ashi candles change color, this counter resets.
-
Stop Same HA Change Trades After Close: If set to True, the EA will stop opening new trades in the same direction after the first trade(s) have been closed, regardless of whether they hit Take Profit, Stop Loss, Break Even, Trailing Stop, Basket TP/SL, or were closed manually. If set to False, the EA can continue opening trades in the same direction even after previous ones have closed.
-
New Signal on Heiken Ashi Candle: This setting determines which Heiken Ashi candle (Classic or Smoothed) will trigger the first trade when a new trend starts. By default, the EA enters on the 2nd Heiken Ashi candle of a new color since the 1st candle is often too early to confirm a trend. You can select any candle from the 2nd to the 10th, depending on how conservative you want to be.
-
First Session Trade on Next Signal: This setting controls when the first trade is opened after attaching the EA to a chart or when a new trading session begins. If set to False (default), the EA will wait for the next Heiken Ashi candle to place its first trade. If set to True, the EA will wait for the next opposite signal instead, which helps to avoid entering a trade too late in an already exhausted trend.
-
Lot Size: This defines the fixed lot size for all trades. If you want each trade to have the same lot size, enter your preferred value here.
-
Use Risk %: When set to True, the EA will calculate the lot size based on the percentage of your account balance that you want to risk per trade instead of using a fixed lot size.
-
Risk %: This determines the percentage of your account balance that will be risked on each trade. The lot size is automatically adjusted based on this percentage and is calculated using the Virtual Stop Loss level.
-
Magic Number: A unique identifier assigned to each trade by the EA. This is useful for distinguishing trades placed by this EA from other trades in your account.
-
EA Comment: The text that will appear in the Comments section of the Terminal/Toolbox window in MT4/5 for all trades placed by the Heiken Ashi EA.
-
Offset in Points: The number of points away from the current price where the EA will wait before opening a new trade. A positive offset means the trade will be delayed until the price moves in a more favorable direction.
-
Opposite Logic: When enabled (set to True), the EA will open trades in the opposite direction of the Heiken Ashi signal. For example, a Buy trade will be placed when the Heiken Ashi candle signals a Sell, and vice versa.
-
EA Timeframe: The timeframe in which the EA will operate and execute trades. This determines when the EA processes signals and places trades.
-
Heiken Ashi Timeframe: The timeframe of the Heiken Ashi candles used to generate trading signals. This does not have to be the same as the EA’s operating timeframe.
-
Use MA Filter: When enabled (set to True), the EA will only open Buy trades if the price is above a specified Moving Average and Sell trades if the price is below it. This helps filter out lower-quality trades.
-
MA Filter Timeframe: The timeframe of the Moving Average used for filtering trades. This can be different from the EA or Heiken Ashi timeframe.
-
MA Filter Period: The number of candles used to calculate the Moving Average. A higher value smooths out price fluctuations, while a lower value makes the MA react more quickly to price changes.
-
MA Filter Method: The type of Moving Average calculation used (Simple, Exponential, Smoothed, or Linear Weighted). Each method has a different way of weighting recent price data.
-
MA Filter Shift: The number of bars the Moving Average is shifted forward or backward on the chart. A positive shift moves the MA into the future, while a negative shift moves it backward.
-
MA Filter Applied Price: The price data used for the Moving Average calculation (e.g., Close price, Open price, High, Low, Median, etc.). This setting determines how the MA is plotted and how signals are filtered.
-
Use MACD Filter: True or False. This setting enables or disables the MACD filter. When enabled, the EA will only open Buy trades if the MACD's moving average (MA) line is above the signal line. For Sell trades, the opposite applies—the EA will only open a trade if the MA line is below the signal line.
-
MACD Filter Timeframe: This setting determines the period of the Simple Moving Average (SMA) applied to the MACD histogram. It is used to smooth out MACD values and provide clearer trade signals
-
MACD Filter Fast EMA: This defines the period of the Fast Exponential Moving Average (EMA) used in the MACD indicator. A lower value makes the MACD more responsive to price changes, while a higher value smooths out fluctuations.
-
MACD Filter Slow EMA: This defines the period of the Slow Exponential Moving Average (EMA) used in the MACD indicator. A larger value helps identify longer-term trends, making the MACD less sensitive to short-term price movements.
-
MACD Filter SMA: This setting determines the period of the Simple Moving Average (SMA) applied to the MACD histogram. It is used to smooth out MACD values and provide clearer trade signals.
-
MACD Filter Applied Price: This specifies which price value (such as Close, Open, High, or Low) will be used for MACD calculations.
-
Start Hour: This setting defines the hour at which the EA will begin trading. For example, if you want trading to start at 1:00, enter 1. If you want trading to run 24 hours a day, enter 0
-
Start Minutes: This setting defines the exact minute within the Start Hour when the EA will begin trading. For example, if you want trading to start at 1:05, enter 5. If you want continuous trading, enter 0.
-
End Hour: This setting determines the hour at which the EA will stop opening new trades. For example, if you want trading to stop at 1:30, enter 1. If you want trading to run 24 hours a day, enter 23.
-
End Minutes: This setting determines the exact minute within the End Hour when the EA will stop trading. For example, if you want trading to stop at 1:30, enter 30. If you want continuous trading, enter 59.
-
Trade on Monday: True or False. Enables or disables the option to open new trades on Mondays. If set to False, the EA will not open any trades on this day.
-
Trade on Tuesday: True or False. Enables or disables the option to open new trades on Tuesdays. If set to False, the EA will not open any trades on this day.
-
Trade on Wednesday: True or False. Enables or disables the option to open new trades on Wednesdays. If set to False, the EA will not open any trades on this day.
-
Trade on Thursday: True or False. Enables or disables the option to open new trades on Thursdays. If set to False, the EA will not open any trades on this day.
-
Trade on Friday: True or False. Enables or disables the option to open new trades on Fridays. If set to False, the EA will not open any trades on this day.
-
Trade on Saturday: True or False. Enables or disables the option to open new trades on Saturdays. If set to False, the EA will not open any trades on this day.
-
Trade on Sunday: True or False. Enables or disables the option to open new trades on Sundays. If set to False, the EA will not open any trades on this day.
-
Max Spread in Points: Defines the maximum spread (in points) allowed for opening a trade. If the current market spread exceeds this value, the EA will not execute a trade to avoid excessive costs.
-
Max Slippage in Points: Defines the maximum slippage (in points) allowed for trade execution. If the price moves beyond this limit before the order is filled, the trade will not be opened to ensure better control over entry prices.
-
Use SL/TP Levels in: Select either 'Points' or 'Percentage of Average Daily Range' to determine how Stop Loss, Take Profit, Break Even, and Trailing Stop Loss levels are calculated. If 'Points' is selected, the EA will use the fixed values set below. If 'Percentage of Average Daily Range' is selected, the EA will adjust these levels dynamically based on the instrument’s volatility, ensuring the strategy adapts to market conditions.
-
Stop Loss in Points: Defines the fixed Stop Loss level (in points) for each order. If the price reaches this level, the trade will be closed to limit losses.
-
Take Profit in Points: Defines the fixed Take Profit level (in points) for each order. If the price reaches this level, the trade will be closed to secure profits.
-
Virtual Stop Loss in Points: Sets a hidden Stop Loss level (in points) that is not visible to the broker. This helps prevent Stop Loss hunting and gives the EA more control over trade exits.
-
Virtual Take Profit in Points: Sets a hidden Take Profit level (in points) that is not visible to the broker. This allows the EA to close trades at a profit without the broker seeing the exact target level.
-
Break Even Profit in Points: Specifies the number of points in profit required before the EA moves the Stop Loss to the entry price, ensuring the trade is risk-free.
-
Trailing Start in Points: Defines the profit level (in points) at which the EA will begin trailing the Stop Loss to protect profits.
-
Trailing Stop in Points: Sets the distance (in points) that the Stop Loss will trail behind the current price, locking in profits while allowing the trade to run.
-
Trailing Step in Points: Determines the increment (in points) by which the Stop Loss will be adjusted when the price moves in a favorable direction.
-
Average Daily Range Candles: Defines the number of daily candles used by the EA to calculate the average daily range. This calculation determines the Stop Loss, Take Profit, Break Even, and Trailing Stop Loss levels when using the 'Percentage of ADR' option, allowing the EA to adapt to market volatility.
-
Stop Loss in % of ADR: Sets the Stop Loss level as a percentage of the instrument’s average daily range. For example, if this setting is 30 and the average daily range is 1000 points, the Stop Loss will be set at 300 points, ensuring that risk adapts to market conditions.
-
Take Profit in % of ADR: Sets the Take Profit level as a percentage of the instrument’s average daily range. For example, if this setting is 50 and the average daily range is 1000 points, the Take Profit will be set at 500 points, allowing the EA to secure profits dynamically.
-
Break Even in % of ADR: Defines the profit level at which the EA will move the Stop Loss to Break Even. This level is calculated as a percentage of the instrument’s average daily range. For example, if this setting is 20 and the average daily range is 1000 points, the Stop Loss will move to Break Even when the trade reaches 200 points in profit.
-
Trailing Start in % of ADR: Specifies the level at which the EA will start trailing the Stop Loss. This is calculated as a percentage of the instrument’s average daily range. For example, if this setting is 40 and the average daily range is 1000 points, the Stop Loss will start trailing when the price moves 400 points in profit.
-
Trailing Stop in % of ADR: Sets the Trailing Stop Loss distance as a percentage of the instrument’s average daily range. For example, if this setting is 30 and the average daily range is 1000 points, the Stop Loss will trail the price at a distance of 300 points, securing profits while allowing the trade to continue running.
-
Trailing Step in % of ADR: Determines the step size for adjusting the Trailing Stop Loss as a percentage of the instrument’s average daily range. For example, if this setting is 10 and the average daily range is 1000 points, the Stop Loss will be adjusted in 100-point increments as the price moves in a favorable direction.
-
Use Heiken Ashi Candles Trailing: Enables or disables the Heiken Ashi candle-based trailing stop feature. If set to True, this method will override any other trailing stop settings based on points or percentage of ADR, ensuring that trades follow the Heiken Ashi trend dynamically.
-
Number of Trailing Heiken Ashi Candles: Defines how trades will be trailed using Heiken Ashi candles. For Buy trades, the Stop Loss will be placed at the bottom of the selected number of previous Heiken Ashi candle bodies, and for Sell trades, it will be placed at the top. As new Heiken Ashi candles form, the Stop Loss moves accordingly, following the trend.
-
Basket Take Profit %: Sets the Take Profit level for all open trades combined as a percentage of the account balance. When this level is reached, the EA will close all positions. Decimals are supported for precise control over risk and reward. *
-
Use Basket Stop Loss: Enables or disables the Basket Stop Loss feature, which closes all open trades when a specific percentage of the account balance is lost.
-
Basket Stop Loss %: Defines the Basket Stop Loss level as a percentage of the account balance. If the combined floating loss of all open trades reaches this level, the EA will close all positions to protect the account from further drawdown. Decimals are supported for accuracy. *
-
Use Basket Break Even: Enables or disables the Basket Break Even feature, allowing the EA to move the Basket Stop Loss to Break Even when a specified profit level is reached.
-
Basket Break Even %: Defines the profit level, as a percentage of the account balance, at which the EA will move the Basket Stop Loss to Break Even. Decimals are supported, ensuring flexibility in managing risk. *
-
Use Basket Trailing Stop Loss: Enables or disables the Basket Trailing Stop Loss feature, which dynamically adjusts the Basket Stop Loss based on account balance percentage.
-
Basket Trailing Start %: Sets the profit level, as a percentage of the account balance, at which the EA will begin trailing the Basket Stop Loss. Once this level is reached, the Stop Loss will adjust upwards to secure profits. Decimals are supported for fine-tuned control.
-
Basket Trailing Stop %: Defines the Basket Trailing Stop Loss distance as a percentage of the account balance. If the floating profit drops to this level, the EA will close all open positions to lock in gains. *
-
Basket Trailing Step %: Determines the incremental step in percentage of account balance at which the EA will adjust the Basket Stop Loss. As profits increase, the Stop Loss moves up in these steps to secure additional gains.
-
Close by Opposite Signal: Enables or disables the option to close trades when an opposite signal is detected. An opposite signal includes a Heiken Ashi candle of the opposite color and any additional active filters, such as the Moving Average or MACD filters. If set to True, the EA will exit trades in the same direction when these conditions are met.
- Close by Opposite Heiken Ashi Candle: Enables or disables the option to close trades solely based on a Heiken Ashi candle of the opposite color, even if the Moving Average or MACD filters do not confirm an opposite signal. This provides a more responsive exit strategy for trend reversals.
- Close All Trades on: This setting allows you to enable or disable the automatic closure of all open trades at a specific time. You can choose to apply this closure on a particular day of the week or every day. Activating this option helps mitigate risks associated with rollover periods, overnight exposure, and weekend market gaps, ensuring better trade management. The EA will not close any additional trades that are opened after the specified closing time. If you do not want any new trades to be opened after this time, you must set the EA’s trading stop time to an earlier point than the selected closing time in this setting.
- Close All Trades Hour: Specifies the exact hour at which the EA will close all open positions on the selected day. The time is based on the broker’s server time. For example, if you want the EA to close all trades at 22:40, you must enter 22 in this setting.
- Close All Trades Minutes: Defines the precise minute at which the EA will execute the automatic closure of all open trades on the selected day, ensuring precise control over trade exit timing. For example, if you want the EA to close all trades at 22:40, you must enter 40 in this setting.
-
Heiken Ashi Candles Type: Allows selection between Classic and Smoothed Heiken Ashi candles. Classic Heiken Ashi provides standard trend visualization, while Smoothed Heiken Ashi offers a more refined trend representation by averaging price movements.
-
MA Method 1: Defines the method used for Smoothed Heiken Ashi Moving Average 1. The available options are Simple, Exponential, Smoothed, or Linear Weighted, allowing customization of trend filtering. **
-
MA Period 1: Sets the period for Smoothed Heiken Ashi Moving Average 1, determining how much past price data is considered in trend calculation. **
-
MA Method 2: Defines the method used for Smoothed Heiken Ashi Moving Average 2, with options including Simple, Exponential, Smoothed, or Linear Weighted. **
-
MA Period 2: Sets the period for Smoothed Heiken Ashi Moving Average 2, influencing the responsiveness of trend signals. **
* Basket-related settings are calculated as equity over balance, factoring in swaps and commissions.
** These settings apply only to Smoothed Heiken Ashi candles and do not affect Classic Heiken Ashi candles.
✔️ Heiken Ashi EA MT4©: https://www.mql5.com/en/market/product/45283
✔️ Heiken Ashi EA MT5©: https://www.mql5.com/en/market/product/64877