
MT5 / MT4 · RULES + AI · BACKTESTABLE
AIFW – AI Framework for MT5
Rules by default, AI on top. An EA you can backtest, with a monthly API budget you set yourself.
The free version runs on a live Exness, XM or HFM account opened through our links and registered with us (it does not start on demo accounts; you can check how it works in the Strategy Tester). The paid version is sold on MQL5 Market and needs no account registration.
Verification Status
How far verification has progressed, from backtest to forward testing
- BacktestDone
- Period
- M5 (2023.01.01 - 2026.09.01)
- History quality
- 99%
- Trades
- 228
- PF
- 1.77
- Max DD
- 4.60%
- Recommended minimum capital
- $1,000+ recommended
- OOSCaution
- Data source
- MT5 official ticks
- Years verified
- 3.7
- ForwardIn progress
This EA is in forward testing. Results for all EAs are published together on the forward test page.
See all forward tests → - LiveNot started
The backtest figures above come from the rules engine alone at its default settings (v1.15, fixed 0.01 lot), with no AI connected. They are not AI performance. The 2023–2026 test period was a rising gold market; the same settings over 2018–2022 gave a profit factor of 1.42, and 2018 was a losing year. Since November 5, 2026 the forward account runs without an API key, on the rules engine only. From October 9 to November 5 it traded on AI decisions, and those trades are included in the account figures.
WHAT IT IS
What it is
An MT5 EA that uses OpenAI / Anthropic large language models as an override layer above a deterministic rules engine. The rules engine runs with no API key, no balance and no network. Only when the AI answers is its decision adopted, and only inside the limits set by the rules.
WHAT IT DOES
What it does
- Default decision layer: H1 moving-average trend (optional H4 agreement) + M15 RSI cross + ATR-relative SL/TP. Every new position carries a stop-loss.
- AI override: at a fixed interval it sends a market summary and receives a hold / open / close / modify proposal.
- AI gate: AI entries execute only when they agree with the rules trend. SL/TP are re-placed at the same ATR-relative distance the rules use. The same direction is blocked for a while after a stop-loss.
- Monthly cap: set a monthly API budget in USD. Near the cap the decision interval widens; at the cap API calls stop. Trading continues on the rules engine.
- Backtesting: live responses are recorded, and the tester replays the recording for the same situation. Where no recording exists, the rules engine decides. The tester shows the share of exact / approximate / rules decisions.
- Terminal-side safety limits: open positions, max lot, executions per day, cooldown, retreat on daily loss and drawdown, sessions, weekend stop, spread cap, pause around news, max holding time, break-even, trailing, partial close. It keeps running without the AI.
- Approval mode: instead of auto-execution, review each proposal on the panel before it executes.
- On-chart panel in 30 languages. Your API key is stored only on your terminal.
PANEL
Panel




Four tabs: LIVE / Profile / Rules / Connection.
STRATEGY TESTER
About the Strategy Tester
The tester cannot call external APIs. With a recording it replays; without one it runs the rules engine. Tester results are the rules engine plus your own recordings, not the future performance of the AI.
⚠ What it does not do or promise
- No profit promise. Rules and AI are tools; results depend on the market, the model, the profile and your settings.
- Your API key, the content sent to the AI and your trading data go to no one except the API provider you choose. No telemetry, no auto-update. Only the free edition from this site sends the account number and server name to fxea365.com to check the licence. The MQL5 Market edition sends nothing to this site.
- We do not claim that AI reduces risk. Risk limits are enforced by the terminal-side rules.
REQUIREMENTS
Requirements
MT5 (build 4000 or later). To use the AI: an OpenAI or Anthropic API key, and api.openai.com or api.anthropic.com added to the allowed WebRequest URLs in MT5. A VPS if you want it running around the clock.
FIRST SETUP
First setup
- Attach to one chart (for example XAUUSD M5). Keep the default inputs.
- On the Connection tab pick the provider and model, paste your key, set the monthly cap and save.
- For the first few days, set Autonomy to "Propose only" on the Profile tab and review each proposal by hand. The default is "Full auto" (orders and closes execute without approval).
- Once recordings accumulate, replay them in the tester.
MANUAL
Manual
How to set up the AI and what to do when the panel shows red text. Without the AI there is nothing to set up: the rules engine runs on its own.
1. Allowed WebRequest URLs (required for the AI)
- In MT5 open Tools > Options (Ctrl+O) and select the Expert Advisors tab.
- Tick "Allow WebRequest for listed URL".
- Double-click the empty row and add your provider: https://api.openai.com for OpenAI, https://api.anthropic.com for Anthropic. Add both if you switch.
- Click OK. No EA reload is needed.
The list is per terminal. On a VPS repeat this in the VPS's MT5. The Strategy Tester cannot use WebRequest at all (MT5 design).
2. Entering the API key (Connection tab on the panel)
- Click Provider to switch between OpenAI and Anthropic, and pick the model marked ★ recommended. For gpt-5 models set Reasoning to minimal.
- Keys are 100–160 characters and one MT5 field holds at most 63. Paste the key into up to three fields in order, or save it as one line in MQL5/Files/aifw/api_key.txt and click Load from file.
- Set the monthly budget (USD) and click Apply & Save. Keys are stored per provider, so switching does not require re-entering them.
- Click Test. A green "Connection OK · model · ms" in the footer means you are done. If it is red, use the table below.
Trading style, settings evaluation and Find by target (MT5 v1.21 / v1.22)
- Open the ENGINE tab and press "Trading style & evaluate".
- TRADING STYLE: choose Custom, Scalp, Day or Swing. The style fills in the timeframes, SL/TP distances (ATR multiples), break-even and maximum holding time. Every value can still be edited.
- EVALUATE SETTINGS: pick 1, 3, 6 or 12 months and press "Evaluate" to simulate the current fields on recent history (trades, profit, profit factor, maximum drawdown). "Compare styles" shows the four styles side by side.
- FIND BY TARGET: enter "Target profit per month (%)" and "Max drawdown (%)", then press "Find". Up to 144 variations are tried on the first 75% of the period and checked on the last 25%. The 3 closest candidates are shown with a suggested risk size; if none reaches the target, the panel says so.
- Press #1-#3 to load a candidate into the fields. Nothing changes until you press "Apply & Save" (the risk size is saved too). With the minimum lot, the risk cannot be made smaller, so a low drawdown target may be out of reach.
Rules engine only (no AI, commissions or swaps), based on past data. Not a forecast. The MT4 edition (v1.20) does not have these functions.
3. Where settings and recordings live (File > Open Data Folder)
- MQL5/Files/aifw/panel_settings_<SYMBOL>.txt: panel settings (key in plain text). Terminal-local.
- Common/Files/aifw/budget_state.csv: this month's spend. Survives restarts.
- Common/Files/aifw/: recorded live replies. The tester replays from here. Copy the folder when you move terminals.
4. Red panel messages and fixes
| Panel text | Fix |
|---|---|
| key not set | Enter the key on the Connection tab and Apply & Save. Rules trading continues meanwhile. |
| URL not allowed · check terminal options | The host in brackets is missing from the allowed list (error 4060). Add it as in step 1. |
| key rejected · update on Connection tab | HTTP 401/403. Paste the key again and check that provider and key match. |
| no credit · check billing | HTTP 402 or billing not set up. Check payment settings and balance in the provider console. |
| rate limited · retrying | HTTP 429. Retries automatically. If frequent, widen the interval. |
| model unknown · change on Connection tab | HTTP 404 / invalid model name. Switch back to the ★ recommended model. |
| network failed N times | Host unreachable, timeout or another HTTP error. Read the AIFW: log line for the code. Check the VPS firewall. |
| bad reply N times | Reply not parseable. Change the model. For gpt-5 set Reasoning to minimal. |
| budget cap · resumes on the 1st | Monthly cap reached. By design. Raise it on the Connection tab and save if you want. |
| pricing not set · set in inputs | Enter your provider's published prices (USD per 1M tokens) in the inputs InpPriceInPerMTok / InpPriceOutPerMTok. While 0, AI calls stay disabled. |
| Apply & Save first, then test. | Unsaved changes. Click Apply & Save, then Test. |
| Test failed · … | Host unreachable, timeout or another HTTP error. Read the AIFW: log line for the code. Check the VPS firewall. |
| Connection OK · … | Click Test. A green "Connection OK · model · ms" in the footer means you are done. If it is red, use the table below. |
Details are printed in MT5's Toolbox > Experts tab as lines starting with AIFW: (keys are masked). Include that line when asking for support.
Free download (register your account number)
The free edition is tied to your MT5 / MT4 account number. It has the same features as the MQL5 Market edition. It checks the account licence on start-up, so add https://fxea365.com to the terminal's allowed WebRequest URLs before first use.
STEP 1 Prepare your account
Using the EA requires an MT5 account opened through our referral link. If you already have an account, please create an additional account.
No account yet — open a new account via the links below
Adding an account — create an additional account in your member pageSee how →
Buy the paid version (MQL5 Market, no account registration)
The paid edition is sold on MQL5 Market. Payment, licensing and updates are handled by MetaQuotes, and no account registration with this site is needed.
Buy AIFW
Buy on the official MetaQuotes Market (MQL5 Market). Payment, licensing and automatic updates are all handled inside the MT5 app.
Check the MQL5 product listing for current pricing, rental terms and availability.
Buy on MQL5 Market (MT5) →Buy on MQL5 Market (MT4) →Buy on the official MetaQuotes Market — install directly in MT5 with automatic updates. No account registration needed.
Compare the available free distribution first
The free distribution may have separate eligibility and registration requirements. Review those terms before choosing the MQL5 edition.
Review free-download requirements →Before you buy
- Check MT4/MT5 compatibility and the current price on the MQL5 product page.
- Free-distribution and MQL5 editions may have different license terms; verify before purchase.
- Backtest results do not guarantee live returns. Review maximum drawdown and the test period.
An MT4 version is also sold on MQL5 Market as a separate product. Its decision logic is the same as the MT5 version. Its pause around news follows a fixed schedule instead of the economic calendar.
FAQ
FAQ
- Does it work without a key?
- Yes. It decides on the rules engine alone.
- How much does the API cost?
- You set the cap. The default is small. Calls stop once it is reached.
- Which models?
- The main OpenAI and Anthropic models. The recommended model is shown on the panel.
- Are backtest numbers the AI's skill?
- No. They come from replayed recordings and the rules engine.
This page explains how the product works and is not an indication of future returns. Tester results come from replayed recordings and the rules engine, not from the AI.
Articles about this EA
Best MT5 EAs Compared (2026): Gold, Yen, Crypto
All fxea365 MT5 Expert Advisors in one table: XAUUSD, USDJPY, EURJPY, GBPJPY, BTCUSD and ETHUSD EAs ranked by PF, max drawdown and test period.
XAUUSD (Gold) EAs for MT5 in 2026: Current Lineup Compared
Compare the current XAUUSD (gold) Expert Advisors for MT5 on fxea365: profit factor, max drawdown, trade count and test period. All gold EAs are free with live-account registration (paid versions on the MQL5 Market).
How Much Capital Do You Need to Run an EA?
Learn the minimum capital needed to safely run an MT5 EA. Covers XAUUSD margin calculations, the rationale behind a recommended starting balance of $1,000–$3,000, and a balance-by-balance lot table built from the max drawdowns of real EAs.
Forward Results Sep 2026: Profit Came from 3 BTC Trades
September 2026 results for the FXEA365 forward test accounts (all demo accounts). The 12 accounts totaled +$2,714, but most of that came from one trade each on 3 BTC accounts. Excluding them, the total is -$915. We also disclose the version swaps made on almost every account at the end of September.
Gold EA (XAUUSD) Comparison 2026: MT5 Risk Checklist
Compare Gold trading EAs for MT5 by drawdown, test quality and execution costs. A practical XAUUSD checklist with links to current verification and forward evidence.