AI Adaptive EA v3
- Experts
- Omar Rukwaya
- Versione: 3.0
- Attivazioni: 5
AI Adaptive EA v3.0 is an Expert Advisor for MetaTrader 4 that connects to the Anthropic Claude AI to make real-time trading decisions based on live market data. It combines artificial intelligence with a full technical indicator system for a dual-confirmation approach — a trade only opens when both the AI and the technical signals agree.
How it works
Every 5 minutes the EA sends live market data to the Claude AI model. The data includes current price, EMA alignment (8/21/50), RSI, ADX with directional indicators, MACD, Stochastic, Bollinger Bands, ATR volatility, and the last three candle directions. The AI responds with a BUY, SELL, or HOLD decision plus a brief reason. This decision is cross-checked against a built-in technical scoring system — both must agree before any trade is placed.
If no API key is set, the EA runs entirely in technical-only mode using the same indicator scoring system as a reliable fallback. No trade is ever skipped due to a missing API connection.
Entry conditions
A trade opens only when all of the following are true at the same time. The AI decision and the technical signal both point in the same direction. The market regime is not classified as quiet or ranging. The spread is within the allowed maximum. The account has sufficient free margin. No trade in the same direction is already open.
Money management
Lot size is calculated automatically from your account balance and risk percentage. The EA reads your broker minimum lot, maximum lot, and lot step on every trade. Your user-defined MaxLot and MinLot act as additional caps. This makes the EA fully compatible with any account size from a small cent account to a large live account without any manual lot adjustment.
Safety and risk control
The EA includes a multi-layer safety system. A maximum total drawdown limit halts all trading if equity falls beyond a set percentage from the starting balance. A daily loss limit stops trading for the remainder of the day if losses exceed the threshold. A daily profit lock closes all trades and pauses when the daily profit target is reached. A maximum open trades cap prevents overexposure. An automatic weekend close removes all positions before Friday session end. A margin pre-check skips any trade where free margin would be insufficient, preventing order send errors on any account size.
Market regime detection
The EA classifies the current market as Strong Trend, Trend, Range, Volatile, or Quiet using ADX and ATR. Quiet and ranging conditions suppress entries automatically to avoid false signals in low-momentum markets.
Trailing stop
An optional trailing stop activates once a trade reaches a set profit in pips and moves the stop loss step by step as price advances, locking in gains while letting winners run.
On-chart dashboard
A live dashboard is displayed on the chart at all times showing AI signal and reason, market regime, account balance, equity, floating profit and loss, daily profit and loss, current drawdown percentage, number of open trades, calculated lot size, AI mode status, and time of last AI call.
Key features
- Live Claude AI integration via MT4 native WebRequest — no DLL required
- Full technical fallback mode when API is unavailable or no key is set
- Risk-based automatic lot sizing compatible with any account size
- Multi-layer safety system with drawdown, daily loss, and profit lock limits
- Market regime filter suppresses trades in quiet and ranging conditions
- Trailing stop with configurable activation and step
- Clean on-chart dashboard with all live statistics
- Works on any forex symbol and any timeframe
- No hidden limitations, no expiry, no account restrictions
Recommended settings
- Symbols: EURUSD, GBPUSD, USDJPY, AUDUSD, NZDUSD
- Timeframe: H1 or H4
- Minimum deposit: $100 standard account or $10 cent account
- Recommended spread: 10 points or less
- Leverage: 1:100 or higher
Required setup before use
To activate AI mode you must enable WebRequest in MetaTrader 4. Go to Tools then Options then Expert Advisors then Allow Web Requests for Listed URL and add https://api.anthropic.com to the list. Then paste your Anthropic API key into the AI_ApiKey input field in the EA settings. The EA runs in technical-only mode automatically if no key is configured, so it works out of the box without any API setup.
Input parameters
AI_ApiUrl — Anthropic API endpoint address. AI_ApiKey — your personal Anthropic API key. AI_Model — Claude model to use. AI_MaxTokens — maximum tokens in AI response. AI_CallInterval — seconds between AI calls, default 300. AI_Enabled — toggle AI mode on or off. RiskPercent — percentage of balance to risk per trade. MaxLot — maximum lot size cap. MinLot — minimum lot size floor. TakeProfit — take profit distance in pips. StopLoss — stop loss distance in pips. UseTrailing — enable trailing stop. TrailStart — pips in profit before trailing activates. TrailStep — pip step for trail movement. ADX_Period — ADX indicator period. ADX_MinTrend — minimum ADX value to allow trend trades. ATR_Period — ATR indicator period. MaxDDPercent — maximum total drawdown before EA halts. DailyLossLimit — maximum daily loss percentage. DailyProfitLock — daily profit target percentage. MaxOpenTrades — maximum simultaneous open trades. MagicNumber — unique identifier for this EA's trades. CloseWeekend — automatically close all trades before weekend.
