ha n
Info
The ha n is a Expert Advisor for MetaTrader 4 that the heiken ashi naive expert advisor is based on the heiken ashi candle chart system and uses the standard indicator of the same name. the «naivete» of the trading system used is that it interprets only the two last candles of heiken ashi and does not use some complex analysis of patterns.
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 ha n
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 uses 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: Quantora Trade Manager MT4: Advanced Position Management for MetaTrader 4 - another powerful expert for MetaTrader 4 traders.
Also recommended: Quantora Break Even Manager MT4 - Professional Automatic Break Even Utility - similar expert with strong performance on MetaTrader 4.
the heiken ashi naive expert advisor is based on the heiken ashi candle chart system and uses the standard indicator of the same name. the «naivete» of the trading system used is that it interprets only the two last candles of heiken ashi and does not use some complex analysis of patterns. the only «but» — the ea trades against the estimated trend direction, which is confirmed by the current state of the candlesticks.the greatest advantage of the ea is that it has no input parameters, which would need optimization or "adjustment" to fit the previous data. for better control of the funds, the position size calculation can be enabled, which is based on the atr indicator.
calculation rules
the following rules are used in the calculation of the heiken ashi candlesticks:
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 are the levels of the heiken ashi candlesticks.
open + high + low and close are the levels of conventional candles.
the levels of the initial heiken ashi candle are equal to respective levels of the simple candle.
trade strategy:
heiken ashi naive uses a rather simple, yet not very obvious trading method.
the following entry signals are used:
sell if the latest completed heiken ashi candle is bullish, its body is longer than previous candle's body, previous candle is also bullish, and latest candle has no lower wick.
buy if the latest completed heiken ashi candle is bearish, its body is longer than previous candle's body, previous candle is also bearish, and latest candle has no upper wick.
if there exists an open position in an opposite direction when a signal arrives, the position is closed. if the position is in the same direction as the signal, the latter is ignored.
the following exit signals are used to close the trades before the new entry signals appear:
exit the short position if the latest completed heiken ashi candle is bearish, the previous candle is also bearish, and latest candle has no upper wick.
exit the long position if the latest completed heiken ashi candle is bullish, the previous candle is also bullish, and latest candle has no lower wick.
as you can see, the expert advisor uses the inverted logic in its trading strategy. it buys when the system points at a rather strong bearish trend, and it sells when it is a bullish rally according to heiken ashi. the point is to try to catch the reversals as early as possible.
input parameters:
money management
lots
(default = 0.1) — fixed base position size. used when
mm
= false.
mm
(default = false) — if true, the position calculation based on the atr indicator will be used.
atr_period
(default = 20) — the period of the atr indicator, which is used for position size calculation. works only if
mm
= true.
atr_multiplier
(default = 1) — value, by which the atr indicator value will be multiplied. works only if
mm
= true.
risk
(default = 2) — risk tolerance in percentage of account balance/equity. works only if
mm
= true. this parameter is ignored if
usemoneyinsteadofpercentage
= true.
fixedbalance
(default = 0) — if set to non-zero value, it is used instead of account balance/equity for position size calculation. works only if
mm
= true.
moneyrisk
(default = 0) — allowed risk in the account currency. works only if
mm
= true. requires
usemoneyinsteadofpercentage
to be set to true.
usemoneyinsteadofpercentage
(default = false) — if true, position size is calculated based on risk amount given in account currency (
moneyrisk
) instead of balance/equity percentage risk (
risk
). works only if
mm
= true.
useequityinsteadofbalance
(default = false) — if true, position size is calculated based on account equity instead of balance. works only if
mm
= true. ignored if
usemoneyinsteadofpercentage
= true.
lotdigits
(default = 2) — number of decimal places allowed by your broker in order volume. for example, if your broker allows trading micro lots (0.01), then this parameter should be set to 2. if your broker allows only 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 to filter positions opened by this ea.
You may also like: Quantora Trailing Stop Manager: Automatic Stop Loss for MT4 - 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.