AI Volume Divergence Trader
- Experts
- Versione: 1.0
Overview
AI Volume Divergence Trader is an automated Expert Advisor built around a volume-price divergence engine. It combines On-Balance Volume (OBV) analysis with RSI extremity filtering and a proprietary AI-inspired confidence scoring model to identify high-probability reversal zones where price action and underlying volume flow disagree with each other.
How It Works
The EA continuously scans recent and prior price swings on the selected timeframe:
- It detects bullish divergence when price prints a lower low while OBV prints a higher low over the same window, signalling fading selling pressure.
- It detects bearish divergence when price prints a higher high while OBV prints a lower high, signalling fading buying pressure.
- Each divergence signal is filtered by RSI extremity (oversold for bullish setups, overbought for bearish setups), so trades are only considered near statistically stretched conditions.
- An AI-inspired 0-100 confidence score blends the strength of the OBV/price divergence with the RSI extremity distance from its threshold. Trades are only opened once this composite score clears a configurable minimum confidence level.
- An optional EMA200 "sanity filter" uses a loose 2% tolerance band (not a hard cross) to avoid opening trades that fight an extremely strong prevailing trend.
Risk Management
- ATR-based stop loss and take profit, automatically adapting to current market volatility.
- Optional trailing stop that respects the broker's minimum stop and freeze distances at all times.
- Margin check before every trade (via OrderCalcMargin against free margin, with a safety buffer) to help avoid over-leveraging.
- Lot size is automatically normalized to the broker's volume step, minimum, and maximum.
- Session-time gate and spread filter to avoid trading during illiquid or abnormally wide-spread conditions.
- One trade per new bar (no tick-by-tick over-trading).
Input Parameters
- InpMagicNumber - unique identifier for this EA's trades.
- InpTimeframe - timeframe used for divergence analysis.
- InpMaxSpreadPoints - maximum allowed spread (in points) for new trades.
- InpRecentWindow / InpPriorWindow - bar windows used to compare recent vs. prior price/OBV swings.
- InpRsiPeriod / InpRsiOversold / InpRsiOverbought - RSI extremity filter settings.
- InpMinConfidence - minimum AI confidence score (0-100) required to open a trade.
- InpUseEmaFilter / InpEmaTrendPeriod - optional loose trend sanity filter.
- InpLotSize - base lot size (automatically normalized).
- InpAtrPeriod / InpSlAtrMult / InpTpAtrMult - ATR-based stop loss / take profit multipliers.
- InpUseTrailing / InpTrailAtrMult / InpTrailStepPoints - trailing stop configuration.
Important Notes
This Expert Advisor does not guarantee profits. Past performance, backtests, and illustrative concept diagrams are not indicative of future results. Always test thoroughly on a demo account before live deployment, and use appropriate risk settings for your account size and risk tolerance.
