# How to Track MT5 Trades Automatically in 2026

> MT5 has a real-time trade event system that makes automatic tracking more powerful than MT4. Here is how to use it.

**Tags:** mt5, automatic-tracking, expert-advisor, mql5
**URL:** https://traderjournal.app/metatrader/how-to-track-mt5-trades-automatically

---


# How to Track MT5 Trades Automatically in 2026

MT5 has an architecture advantage over MT4 when it comes to automatic trade tracking. It includes a real-time trade event handler called OnTradeTransaction that fires immediately when a trade closes. This means MT5 sync can be near-instantaneous rather than polling-based.

Here is how automatic MT5 tracking works and how to set it up.

---

## The OnTradeTransaction Advantage

In MT4, EAs that track trades use a polling approach: every 30 seconds, the EA checks whether any new trades have closed and pushes them if so. This means there is up to a 30-second delay between a trade closing and it appearing in your journal.

In MT5, the OnTradeTransaction function fires as a callback when trade events occur - including when a trade closes. An EA using this function can push the trade data to the server almost immediately after close, rather than waiting for the next poll cycle.

Trader Journal's MT5 EA uses OnTradeTransaction as the primary sync trigger, with a periodic fallback to catch any transactions that the event handler might miss. In practice, most trade closes appear in your journal within seconds.

---

## Hedging vs Netting - The MT5 Distinction

MT5 supports two account modes:

**Hedging accounts** - work like MT4. You can hold multiple positions in the same symbol simultaneously. Buy and sell EURUSD at the same time if you choose. Each position has its own ticket and closes independently.

**Netting accounts** - one position per symbol at a time. If you are long 0.5 lots of EURUSD and open another buy of 0.3 lots, your position becomes 0.8 lots. If you open a sell of 0.5 lots, your long position reduces to 0 (breakeven net). There is no separate "close" transaction in the traditional sense.

The Trader Journal MT5 EA detects your account mode automatically and handles both correctly. For netting accounts, it reconstructs meaningful position entries and exits from the sequence of orders.

---

## What the MT5 Sync Captures

The MT5 EA captures the same data as the MT4 EA plus MT5-specific fields:

- All fields from MT4 (symbol, direction, prices, times, lot size, commission, swap, P&L)
- Position identifier (separate from order identifier in MT5)
- Deal type (entry, exit, partial close)

For traders on netting accounts, the journaling is slightly different: each reduction or close of a position is recorded as a trade, allowing you to track partial exit performance.

---

## Setup Process for MT5

1. Install Trader Journal on your phone (android.traderjournal.app or ios.traderjournal.app)
2. Add your MT5 account in the Accounts tab, select MT5 as platform
3. Copy the API key
4. Download the MT5 EA (.ex5 file) from the setup walkthrough
5. Place it in your MT5 Experts folder (File > Open Data Folder > MQL5 > Experts)
6. Refresh Navigator (Ctrl+R, right-click Experts > Refresh)
7. Drag EA onto any chart, configure ApiUrl and ApiKey
8. Enable algo trading and add the API URL to the WebRequest list (Tools > Options > Expert Advisors)

The setup takes 10-15 minutes. After that, tracking is fully automatic.

---

## Verifying the MT5 Sync

After setup, open the MT5 Toolbox (Ctrl+T) and go to the Experts tab. Within 30 seconds of the EA starting, you should see log messages showing successful pushes.

In the Trader Journal app, pull to refresh on the Dashboard. Your balance and recent trades should appear.

If you close a demo trade immediately after setup, it should appear in the app within seconds via the OnTradeTransaction handler.