Heiken Ashi Naive Expert Advisor (MT4/MT5)
Info
The Heiken Ashi Naive Expert Advisor (MT4/MT5) is a Expert Advisor for MetaTrader 4 that the heiken ashi naive expert advisor is based on the heiken ashi candle chart system and utilizes the standard indicator of the same name. The simplicity of this trading system lies in its interpretation of only the two most recent Heiken Ashi candles, without employing complex pattern analysis.
Usage
This tool is typically used for automated trading on major forex pairs and gold.
Platform
This Expert Advisor works exclusively on MetaTrader 4 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL4/Experts folder via File ? Open Data Folder in MetaTrader 4.
How to Install and Use Heiken Ashi Naive Expert Advisor (MT4/MT5)
1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.
2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.
3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.
4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.
Frequently Asked Questions
Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.
Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.
Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.
What this tool does
The Heiken Ashi Naive Expert Advisor is based on the Heiken Ashi candle chart system and utilizes the standard indicator of the same name.
Typical Use Case
This Expert Advisor excels in automated trading and technical analysis on MetaTrader 4.
Compatible Platform & Setup
This Expert Advisor works on MetaTrader 4. Place the file in the MQL4/Experts folder and restart the terminal.
Description & Settings
Related: APB Channel EA: Heikin-Ashi Reversals with Keltner Channel Confirmation and Swing Structure Stops - another powerful expert for MetaTrader 4 traders.
The Heiken Ashi Naive Expert Advisor is based on the Heiken Ashi candle chart system and utilizes the standard indicator of the same name.Also recommended: Automated Trend Trading with Heiken Ashi and Simple Moving Average - similar expert with strong performance on MetaTrader 4.
The simplicity of this trading system lies in its interpretation of only the two most recent Heiken Ashi candles, without employing complex pattern analysis.The core trading logic operates against the estimated trend direction, as confirmed by the current candlestick states.
A significant advantage of this EA is its lack of input parameters requiring optimization or adjustment to historical data.
For enhanced fund management, position size calculation can be enabled, which is based on the ATR indicator.
Heiken Ashi Candlestick Calculation Rules:
open_ha = (previous open_ha + previous close_ha) / 2
close_ha = min(minimum, open_ha, close_ha)
high_ha = max(high, open_ha, close_ha)
low_ha = (open + high + low + close) / 4
Where:
open_ha, high_ha, low_ha, and close_ha represent the levels of the Heiken Ashi candlesticks.
open, high, low, and close are the levels of conventional candles.
The levels for the initial Heiken Ashi candle are equivalent to the respective levels of a simple candle.
Trade Strategy:
Heiken Ashi Naive employs a straightforward yet unconventional trading methodology.
Entry Signals:
- Sell signal: Occurs if the latest completed Heiken Ashi candle is bullish, its body is longer than the previous candle's body, the previous candle was also bullish, and the latest candle has no lower wick.
- Buy signal: Occurs if the latest completed Heiken Ashi candle is bearish, its body is longer than the previous candle's body, the previous candle was also bearish, and the latest candle has no upper wick.
If an open position exists in the opposite direction when a signal is generated, the existing position is closed. If the position is in the same direction as the signal, the new signal is ignored.
Exit Signals (to close trades before new entry signals appear):
- Exit short position: If the latest completed Heiken Ashi candle is bearish, the previous candle was also bearish, and the latest candle has no upper wick.
- Exit long position: If the latest completed Heiken Ashi candle is bullish, the previous candle was also bullish, and the latest candle has no lower wick.
The Expert Advisor utilizes an inverted logic in its trading strategy. It buys during periods identified by the system as a strong bearish trend and sells during what the Heiken Ashi indicator suggests is a bullish rally. The objective is to capture potential reversals at the earliest possible stage.
Input Parameters:
Money Management:
- lots: (default = 0.1) Fixed base position size. Used when mm = false.
- mm: (default = false) If true, position size calculation based on the ATR indicator is utilized.
- atr_period: (default = 20) The period of the ATR indicator, used for position size calculation. Operates only if mm = true.
- atr_multiplier: (default = 1) The value by which the ATR indicator value is multiplied. Operates only if mm = true.
- risk: (default = 2) Risk tolerance as a percentage of account balance/equity. Operates only if mm = true. This parameter is ignored if usemoneyinsteadofpercentage = true.
- fixedbalance: (default = 0) If set to a non-zero value, it is used instead of account balance/equity for position size calculation. Operates only if mm = true.
- moneyrisk: (default = 0) Allowed risk in the account currency. Operates only if mm = true. Requires usermoneyinsteadofpercentage to be set to true.
- usermoneyinsteadofpercentage: (default = false) If true, position size is calculated based on the risk amount specified in the account currency (moneyrisk) rather than a balance/equity percentage risk (risk). Operates only if mm = true.
- useequityinsteadofbalance: (default = false) If true, position size is calculated based on account equity instead of balance. Operates only if mm = true. Ignored if usermoneyinsteadofpercentage = true.
- lotdigits: (default = 2) The number of decimal places allowed by your broker for trade volume. For instance, if your broker permits micro lots (0.01), this parameter should be set to 2. If your broker only allows mini lots (0.1), this parameter should be set to 1. Required only if mm = true.
Miscellaneous:
- ordercomment: (default = "han") The comment for opened positions.
- slippage: (default = 100) Maximum allowed slippage, in broker points.
- magic: (default = 152207122013) The magic number used to filter positions opened by this EA.
You may also like: Heiken Ashi Example Using Multi-Timeframe - excellent alternative for expert users on MetaTrader 4.
Source Code
#property copyright "robotfx"
#property link "https://robotfx.org"
#property version "1.00"
#property strict
/*
uses heiken ashi candles.
sells on bullish ha candle, its body is longer than previous body, previous also bullish, and current candle has no lower wick.
buys on bearish ha candle, its body is longer than previous body, previous also bearish, and current candle has no upper wick.
exit shorts on bearish ha candle and current candle has no upper wick, previous also bearish.
exit longs on bullish ha candle and current candle has no lower wick, previous also bullish.
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.