Install the VEXA Sync Expert Advisor
Put the VEXA Sync EA into your desktop MetaTrader 4 or 5 terminal so closed trades reach VEXA on their own.
What this does
The VEXA Sync Expert Advisor is a small program you drop into your desktop MetaTrader terminal. It reads your closed trades and posts them to VEXA. MetaTrader 5 sends each trade as it closes. MetaTrader 4 checks every 60 seconds.
The EA is read-only. It never places, modifies or closes an order. It only reads deals that have already happened.
Before you start
- You need MetaTrader running on a Windows desktop. The mobile MetaTrader apps cannot run Expert Advisors at all, which is a MetaQuotes limitation rather than a VEXA one. If you only have MetaTrader on a phone, see Why MetaTrader setup cannot be done on a phone.
- Set up the EA from the VEXA web app on the same computer as MetaTrader, so you can copy the key straight across.
- Broker connections need the Edge tier or above.
- The EA only runs while MetaTrader is open. Trades closed while the terminal is shut sync the next time you launch it.
- Know which terminal you are on. MT4 and MT5 use different files and different wording for the same checkbox.
Steps
Web only
Get your key and the file
- Open Profile from the sidebar card that shows your name with View Profile under it.
- Open Connected Brokers and choose MetaTrader 4 or MetaTrader 5.
- On the VEXA Sync API Key card, press Generate API Key.
- Copy the key. It begins
vxa_and is shown once, for 60 seconds. Use the eye toggle to reveal it and the copy button to take it. If you lose it you have to rotate to a new one. - On the Download card, download the EA file for your terminal.
Install it in MetaTrader 5
- In MT5, open File, then Open Data Folder.
- Open the MQL5 folder, then Experts.
- Move the downloaded file into that folder.
- Back in MT5, open Tools, then Options, then the Expert Advisors tab.
- Tick Allow WebRequest for listed URL.
- Add
https://mt-sync.vexatrade.aito the list, then press OK. - Press
Ctrl+Nto refresh the Navigator panel. - Expand Expert Advisors and find VEXA Sync.
- Drag VEXA Sync onto any open chart. The symbol does not matter, because the EA reads your whole closed history rather than the chart it sits on.
- In the dialog that opens, go to the Inputs tab and paste your key into VexaApiKey.
- Check that Allow Algorithmic Trading is ticked, then press OK.
Install it in MetaTrader 4
MT4 follows the same shape with three differences.
- In MT4, press
Ctrl+Tto open the Terminal panel and open the Account History tab. - Right-click inside Account History and choose All History. Without this, MT4 shows the EA only about a month of trades.
- Open File, then Open Data Folder, then MQL4, then Experts, and move the downloaded file in.
- Open Tools, then Options, then Expert Advisors.
- Tick Allow WebRequest for listed URL and add
https://mt-sync.vexatrade.ai. - Press
Ctrl+N, expand Expert Advisors, and drag VEXA Sync onto any chart. - On the Inputs tab, paste your key into VexaApiKey.
- Check that Allow live trading is ticked. MT4 uses this wording where MT5 says Allow Algorithmic Trading.
- Press OK.
What you should see
Three things confirm it worked.
- A smiley face in the top right corner of the chart you dropped the EA onto. A sad face means the EA is loaded but a setting is blocking it.
VEXA Sync: connectedin the Experts tab of the Terminal panel (Ctrl+T), within about five to ten seconds.- The EA Connection card in VEXA turning green and reading “Connected”, with the time of the last sync. That card refreshes every 15 seconds on its own.
There is no Sync Now button for MetaTrader accounts, and that is deliberate. Nothing is pulled from your terminal. The EA pushes, so there is nothing to trigger from VEXA’s side.
Your first sync backfills your closed history. After that, MT5 sends each trade as it closes and MT4 sends a batch every 60 seconds.
How the EA behaves once it is running
- It reads closed deals and orders only. It never trades.
- It sends up to 500 deals per batch and keeps an outbox file on disk, so a failed send is retried rather than lost.
- MT5 runs a full reconciliation sweep every six hours to pick up anything a busy period missed.
- Broker symbol suffixes are stripped, so
EURUSD.mandEURUSDland as one symbol rather than two.
Running it around the clock
The EA only runs while MetaTrader is open, so a laptop that sleeps overnight syncs in bursts. If you want continuous sync, run MetaTrader on a forex VPS. Most cost 10 to 20 US dollars a month. This matters more on MT4, which polls on a timer rather than reacting to each close.
If it doesn’t work
- Sad face on the chart, or no journal line. Work through MetaTrader EA troubleshooting.
- You lost the key before pasting it. Rotate to a new one. See Your VEXA Sync API key.
- MT4 is only sending recent trades. Account History was left on a short period. Go back to step 7 and set All History.
Related
Related
Still stuck? Email support@vexatrade.ai.