AI Momentum Divergence Trader
- Experts
- Versione: 1.0
- Attivazioni: 5
AI Momentum Divergence Trader
AI Momentum Divergence Trader is a fully automated Expert Advisor that hunts for classic RSI/price momentum divergences and filters every signal through an AI-inspired 0-100 confidence score before risking a single trade. The goal is simple: only take a divergence signal when momentum exhaustion, price-swing magnitude, and the prevailing trend all line up.
How it works
1) Detect RSI Divergence - the EA scans recent swing highs/lows and compares them with RSI at the same points to find classic bullish divergence (price makes a lower low while RSI makes a higher low) or bearish divergence (price makes a higher high while RSI makes a lower high).
2) Confirm Trend Alignment - a 200-period EMA trend-distance filter (measured in ATR units) is used to skip signals that are too extended from the prevailing trend, avoiding low-quality counter-trend entries.
3) Score AI Confidence and Trade - each valid divergence is scored from 0 to 100: 50% of the score comes from the normalized RSI divergence magnitude, and 50% from the price swing distance normalized by ATR. A trade is only opened once the score clears your configured minimum confidence threshold.
Risk management
- ATR-based Stop Loss and Take Profit, automatically adapted to current volatility
- Optional trailing stop with a built-in TP-proximity guard, so the trailing logic never pushes the stop past a take profit that is already close
- Spread filter to avoid trading during abnormally wide spreads
- Session/edge-time filter to avoid opening new trades too close to session boundaries
- Margin check before every new order
- Configurable maximum number of simultaneously open positions
Input parameters
- Magic Number - unique identifier for this EA's trades
- Timeframe - working timeframe (default H1)
- Max Spread (points) - maximum allowed spread to open a new trade
- Edge Buffer (seconds) - trading pause before/after session boundaries
- RSI Period - period used for divergence detection
- Swing Lookback - number of bars scanned to find the prior swing extreme
- Min Bars Between Swings - minimum spacing between compared swing points
- Trend MA Period - EMA period used for the trend filter (default 200)
- Trend Distance (ATR) - maximum allowed distance from the trend EMA, in ATR units
- ATR Period - period used for volatility-based SL/TP and confidence scoring
- Min Confidence Score - minimum AI confidence score (0-100) required to open a trade
- SL / TP ATR Multipliers - Stop Loss and Take Profit distance as a multiple of ATR
- Lot Size - fixed trading volume
- Max Open Positions - maximum simultaneous positions for this EA
- Use Trailing - enable/disable the trailing stop module
- Trail Start / Step (ATR) - trailing activation distance and step, in ATR units
Recommendations
Works on any symbol and broker offering RSI, ATR, and Moving Average indicators. Default settings are tuned for the H1 timeframe on major Forex pairs, but every parameter is fully adjustable. As with any automated strategy, please test thoroughly on a demo account with your broker's real spread and execution conditions before running on a live account, and use position sizing appropriate to your own risk tolerance. This description does not represent a guarantee of profit; past or simulated results are not a reliable indicator of future performance.
