AI Heikin Ashi Reversal Trader
- Experts
- 버전: 1.0
Overview
AI Heikin-Ashi Reversal Trader is a fully automated Expert Advisor for MetaTrader 5. It reconstructs synthetic Heikin-Ashi candles from the live price feed and looks for a color-flip reversal signal after an extended directional streak. Every potential signal is scored by an AI-inspired confidence engine before any trade is considered.
How It Works
- The EA builds Heikin-Ashi candles internally from the raw OHLC data of the selected symbol and timeframe - no external indicator file is required.
- It watches for a color flip (for example, a run of red candles turning green) that follows a minimum streak of same-color candles, treated as a sign of an exhausted directional move.
- Each flip is cross-checked against the ADX indicator's directional lines (+DI / -DI) to confirm the new direction has underlying momentum before it is treated as a signal.
- A 0-100 AI-inspired confidence score combines the length of the prior streak and the strength of the directional separation. A trade is only considered once the score clears a configurable minimum threshold.
- An EMA200 sanity filter helps avoid taking a reversal signal too far against the prevailing longer-term trend.
Risk Management
- ATR-based stop loss and take profit distances that adapt to current market volatility.
- Optional ATR-based trailing stop. Before adjusting the stop loss, the EA checks the distance between price and the current take profit to avoid broker rejections when price is already close to the target.
- A margin check runs before every trade request, comparing the estimated required margin against free margin with a safety buffer.
- Lot size is automatically normalized to the broker's minimum, maximum and step volume constraints.
- A configurable session-time filter with an edge buffer, plus a maximum spread filter, help the EA stand aside in unfavorable conditions.
- One position at a time per symbol/magic number.
Input Parameters
- InpMagicNumber - unique identifier for this EA's trades.
- InpTimeframe - working timeframe used to build the Heikin-Ashi candles and indicators.
- InpMaxSpreadPoints - maximum allowed spread, in points, before a new trade is skipped.
- InpEdgeBufferSeconds - buffer, in seconds, kept clear from the session open/close edges.
- InpMinStreak - minimum number of same-color Heikin-Ashi candles required before a flip is considered a signal.
- InpMaxStreakNorm - streak length that maps to the maximum streak-based confidence score.
- InpAdxPeriod - period used for the ADX / +DI / -DI calculation.
- InpAdxDiNorm - directional separation value that maps to the maximum ADX-based confidence score.
- InpMinConfidence - minimum AI confidence score (0-100) required before a trade is opened.
- InpEmaTrendPeriod - period of the EMA used for the longer-term trend sanity filter.
- InpEmaSanityAtrMult - maximum ATR-multiple distance from the EMA allowed for a reversal signal.
- InpLotSize - base lot size before broker volume normalization.
- InpAtrPeriod, InpSlAtrMult, InpTpAtrMult - ATR period and multipliers used to size the stop loss and take profit.
- InpMinStopPoints - minimum stop distance in points, regardless of ATR.
- InpUseTrailing, InpTrailAtrMult, InpTrailStepPoints - trailing stop settings.
Important Notes
This Expert Advisor automates a clearly defined trading logic based on Heikin-Ashi candle construction and directional strength confirmation. It does not guarantee profit, and no result - hypothetical or otherwise - is a reliable indicator of future performance. Please test on a demo account first, use position sizing appropriate to your account, and be aware that trading leveraged instruments carries a risk of loss.
