How to Auto Sync MetaTrader 5 Trades with the FxJournalStats EA
Updated: September 18, 2026
Auto Sync runs a small Expert Advisor (EA) inside your MT5 terminal. When a position closes, the EA sends it straight to FxJournalStats over HTTPS — no manual exports, no FTP server. Import stays available for history older than the EA's backfill window or for accounts you can't attach an EA to (MT5 web/mobile).
Requirements #
- Desktop MetaTrader 5 (Windows, or Wine/CrossOver on Mac/Linux). MT5 web and mobile can't run EAs — use file import for those.
- A Pro, Lifetime, or one-time (Basic/Standard) FxJournalStats plan.
- The terminal needs to stay running to sync in real time — a VPS is recommended if you don't leave your computer on.
Step 1: Set the account's timezone #
Open Add Trades → MetaTrader 5 → Auto Sync for the journal account you want to sync. If the account has no timezone set yet, you'll be asked for one first — this is the timezone your broker's server uses, and it's what keeps synced trades lined up with anything you've already imported. If you don't know it, MT5's Market Watch → right-click a symbol → Specification usually shows the server's GMT offset.
Step 2: Download the EA #
Click Download to get FxJournalStatsSync.ex5 (or use the source .mq5 link if you'd rather compile it yourself). Copy the file into your terminal's MQL5/Experts folder — in MT5, go to File → Open Data Folder, then MQL5/Experts.
Restart MT5, or right-click Expert Advisors in the Navigator panel and choose Refresh, so the new EA shows up.
Step 3: Allow the connection #
MT5 blocks EAs from making web requests to any URL you haven't explicitly allowed. Go to Tools → Options → Expert Advisors, tick Allow WebRequest for listed URL, and add:
https://www.fxjournalstats.com
If you skip this step, the EA will print an error (usually 4014) and the chart will show a message telling you exactly which URL to add.
Step 4: Copy your API key and account ID #
Back in the Auto Sync tab:
- Generate an API key (or copy your existing one — the same key you may have used with the older FTP-based Auto Sync still works).
- Copy your account ID — this tells the EA which journal account to sync into.
One journal account per MT5 login. The first MT5 account that checks in with an account ID becomes linked to it, and the journal account only accepts that login from then on. To sync several MT5 accounts, create a journal account for each and use its own account ID.
Anyone with your API key can add trades to your journal, so treat it like a password. You can revoke and regenerate it any time from the same tab.
Step 5: Attach the EA #
Drag FxJournalStatsSync from the Navigator onto any chart (the symbol/timeframe don't matter — the EA reads your account's trade history, not the chart). In the inputs dialog:
- Paste your API key into
InpApiKey. - Paste your account ID into
InpAccountId. - Make sure Algo Trading is enabled (the button in the toolbar should be green).
Step 6: Confirm it's connected #
Back in FxJournalStats, the Auto Sync tab polls for the EA's first check-in and flips to Connected automatically — you don't need to refresh or leave the modal. Once connected, closed trades typically appear in your journal within a few seconds of the position closing; anything closed since the terminal was last off is picked up on the next check-in.
Troubleshooting #
The EA prints a one-line status to the chart (Comment()) so you don't have to read the Experts log:
| What the chart says | What it means | Fix |
|---|---|---|
| "allow WebRequest for …" | The URL isn't whitelisted (error 4014) | Repeat Step 3 with the exact URL shown |
| "API key rejected — open Add Trades > Auto Sync" | The key was revoked, or your plan no longer includes Auto Sync | Generate a new key, or check your plan |
| "paused — account ID is linked to MT5 login …" | You switched the terminal to a different MT5 account; this journal account only accepts the login it was first linked to | Switch back to the linked account, or (to link the new one instead) open Add Trades → Auto Sync and click Reset link. Nothing from the other account was synced |
| "already running on another chart" | The EA is attached to more than one chart | Remove the extra instance — one is enough |
| No message / nothing happens | Algo Trading is off, or the EA isn't attached | Check the toolbar's Algo Trading button is green |
If a trade appears twice (once from a prior HTML import, once from Auto Sync), it's safe to delete either copy — the two paths use the same trade data, so this is rare and cosmetic.
FAQ #
I deleted some synced trades. Will the EA send them again? No. Deleted trades stay deleted, even if you reinstall MetaTrader, move to a new VPS, or upload a report that includes them. To bring one back, open the account menu → Deleted trades.
I switched an existing account to MT5 and some trades now appear twice. Trades you added before (from a CSV or by hand) and the ones the EA sends are stored separately, so the same trade can show up twice. Delete the copies you don't want to keep, or select both and choose Merge → The same trade, recorded twice to keep one copy's numbers along with both journals. Either way they won't come back.
Disconnecting #
- Stop syncing from this terminal: remove the EA from the chart. Nothing changes server-side.
- Point a journal account at a different MT5 account: click Reset link in the Auto Sync tab. The next MT5 account that checks in with that account ID becomes the linked one. Already-synced trades are not touched.
- Stop syncing everywhere / your key leaked: click Revoke key in the Auto Sync tab. Every EA using that key will stop immediately. Your already-synced trades are never affected.