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.
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 |
| "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.
Disconnecting #
- Stop syncing from this terminal: remove the EA from the chart. Nothing changes server-side.
- 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.