HaikenAshiDouble
- エキスパート
- バージョン: 3.0
Heiken Ashi Double is an MT4 Expert Advisor based on double-smoothed Heiken Ashi signals. It analyzes the latest closed candle, supports separate timeframes for the main signal and additional entries, and includes optional pyramiding, basket management, ATR-based position sizing, initial stop-loss modes, Heiken Ashi trailing stop, spread protection, margin and volume checks, and on-chart diagnostics.
The EA evaluates signals only after a new bar is detected. Does not use a fixed Take Profit; exits are handled by the signal reversal, the configured stop-loss, or the trailing stop. This systém is designed to catch strong, clean trending moves and optionally gradually add to them at progressively better prices.
HeikenAshiDouble is built around a simple but powerful idea: enter the market only when a Heiken Ashi Smoothed candle confirms a clean, strong trend move — and then let the trade run with an intelligent trailing stop.
🔹Heiken Ashi trailing stop
Unlike a standard Heiken Ashi EA, this tool applies two independent moving-average smoothing layers to the Heiken Ashi values, significantly reducing market noise and false signals. On top of the main signal, an optional pyramiding module can add extra positions on a second timeframe using standard (non-smoothed) Heiken Ashi candles — but only in the direction of the trend and only at better prices than the main entry.
How the system trades
🔹Main entry
- Buy: the smoothed HA candle is bullish, has no lower wick (within tolerance), its body is larger than the previous candle's body, and the previous candle was also bullish.
- Sell: the mirrored opposite condition (bearish candle with no upper wick, growing body, previous candle bearish).
- This filters for momentum entering a trend with minimal counter-pressure (wick).
- The main signal timeframe is configurable independently from the chart timeframe. The default setting is PERIOD_CURRENT, but the EA can be configured to calculate the main signal on another available MT4 timeframe.
- When enabled, the EA adds further positions in the direction of the open trade on every color change of the standard HA candle on the additional timeframe.
- Optionally, each additional order can be required to open at a price better than the Main position's entry price (true pyramiding, not averaging into a loss). The EA uses strict price filtering to avoid averaging down – additional orders are only added at better prices than the main entry.
- The number of additional orders is capped by a configurable maximum.
- This setting is designed to support trend-following pyramiding rather than averaging down. The number of additional orders per basket is limited by MaxAddOrders.
- Main and Additional orders are separated by their order comments so that basket management can be applied consistently.
🔹Stop-loss and basket management
- According to Main bar - The initial stop-loss is placed beyond the latest Main Heiken Ashi candle using the configured TrailingBuffer.
- Manual - The stop-loss distance is specified in points by MainSL_ManualPoints. A value of zero means that no initial stop-loss is set.
- Additional orders inherit the current absolute stop-loss price of the Main order when they are opened. This keeps the basket aligned with the current Main stop-loss level, including stop-loss changes already made by the trailing logic.
- If the broker, a manual action, or another trading event closes only part of the basket, the EA detects the mismatch and closes the remaining positions to keep the basket synchronized. Orphaned Additional orders are also closed when the Main order no longer exists.
🔹Heiken Ashi trailing stop
- The optional trailing stop uses the latest closed Heiken Ashi Smoothed candle. For Buy positions, the stop-loss is moved below the Heiken Ashi low; for Sell positions, it is moved above the Heiken Ashi high. The distance is adjusted by TrailingBuffer points.
- The trailing stop can be configured to activate only when the Main order is profitable. The optional TrailMinProfit parameter defines the minimum Main-order profit in points required before trailing begins. Trailing stop continuously adjusts SL levels for all orders together, ensuring uniform protection.
🔹Exit
- The whole basket (Main + Add orders) is closed when an opposite-colored smoothed HA candle appears with no matching wick, following a same-colored previous candle — i.e. on a trend-reversal signal, or when reaching SL, or TrailingStop.
🔹Main input parameters overview
Main Signal MaPeriod1, MaMethod1, MaPeriod2, MaMethod2 - settings for Heiken Ashi Smoothed
Timeframes TimeFrame_Main, TimeFrame_Add - Timeframes for Main and Additional signals
Additional Orders UseAdditionalOrders, MaxAddOrders, RequireAddBeyondMain - Enable pyramiding, max Add orders, price filter
Wick Tolerance WickToleranceInPoints - Tolerance for "no wick" detection in entry/exit logic
Money Management Lots, MM, ATR_Period, Risk, MoneyRisk - Fixed or ATR-based lot sizing with risk controls.
Stop-Loss MainSLMode, MainSL_ManualPoints - Auto or manual initial SL for Main order
Trailing Stop UseTrailingStop, TrailingBuffer, TrailOnlyInProfit, TrailMinProfit - Trailing activation and thresholds.
Miscellaneous Slippage, Magic, OrderCommentary, ShowGraphDiag - General EA settings and display options.
💰Risk management
- Trailing stop tied to the smoothed HA candle values, with an adjustable buffer.
- Initial stop loss can be set automatically from the last HA candle or as a fixed value in points.
- All orders in the basket (Main and Add) share the same SL level, and the EA automatically monitors and re-synchronizes the basket if the broker partially closes it (e.g. via SL execution).
- Position sizing: fixed lot, or automatic money management based on percentage risk / fixed monetary amount / ATR.
🔥Diagnostics
- An optional on-chart panel displays current HA candle values, wick status, active signals, and stop-loss state — useful for monitoring and verifying behavior in real time.
⚙️Recommendations
- Best timeframe for Main/Add is Daily/H1, of course you can try anything (for example 15M/1M)
- Works on all symbols and timeframes (recommended symbols are those that are trending), but should always be tested on your specific broker and symbol first
- One of the most important settings is Wick Tolerance. Setting of 2 means that a signal is only generated during very strong movements. The higher this value, the higher the frequency of signals. Maximum that suited me is 10.
- The EA reacts only to closed bars — no intra-bar repainting of signals
- A VPS is recommended for reliable basket synchronization and trailing, especially when pyramiding is enabled
- Magic number and order comments allow running multiple instances on different symbols/timeframes simultaneously
📈Suitable for
Traders who favor trend-following strategies on any symbol and timeframe, and who want a system with clearly defined, mechanical rules and the ability to scale into a strong trend gradually. Thorough backtesting in the Strategy Tester on the intended symbol/timeframe is recommended before live deployment, along with choosing money-management settings that match your own risk tolerance.
⚠️Disclaimer
Trading on financial markets carries a risk of loss of invested capital. The author and provider of this product are not liable for any damages arising from its use. Past performance does not guarantee future results.
