# How to Set Up the Trader Journal Expert Advisor

> A detailed look at the Trader Journal EA - what it does, how to configure it, and how to troubleshoot common installation issues.

**Tags:** expert-advisor, ea, setup, mt4, mt5
**URL:** https://traderjournal.app/app-guide/setup-trader-journal-expert-advisor

---


# How to Set Up the Trader Journal Expert Advisor

The Expert Advisor is the bridge between your MetaTrader terminal and the Trader Journal app. Understanding how it works makes installation straightforward and troubleshooting easy.

---

## What the EA Does

The Trader Journal EA is a lightweight script that runs inside your MetaTrader terminal alongside your other EAs or manual trading. It does not place trades. It does not modify orders. It only reads data and sends it to the journal server.

Every 30 seconds (configurable), it:

1. Checks for closed trades since the last sync timestamp
2. Packages that trade data as JSON
3. Sends it to the Trader Journal API endpoint via WebRequest
4. Updates the last-sync timestamp in MetaTrader's GlobalVariables

It also sends:
- A snapshot of all currently open positions
- Your current balance and equity (which powers the equity curve in the app)

All three data types push on the same interval.

---

## Installation - MT4

1. Download the .ex4 file from your account setup walkthrough in the Trader Journal app
2. Place it in: `[MT4 Data Folder]\MQL4\Experts\`
3. Refresh the Navigator panel (F5 or right-click > Refresh)
4. Drag the EA onto any chart (it does not need to be a chart you are actively trading)

**Inputs to configure:**

| Parameter | Value | Notes |
|---|---|---|
| ApiUrl | From app setup | Copy exactly as shown |
| ApiKey | Your account API key | Paste from app |
| PushIntervalSec | 30 | Can increase to 60 to reduce server calls |

---

## Installation - MT5

1. Download the .ex5 file
2. Place it in: `[MT5 Data Folder]\MQL5\Experts\`
3. Refresh via Navigator > Expert Advisors > right-click > Refresh
4. Attach to any chart with the same input parameters

The MT5 EA additionally uses OnTradeTransaction to push immediately on trade close. This means trade data often appears in the app within seconds of a close, not waiting for the next 30-second cycle.

---

## Enabling WebRequest

This step is required and commonly missed. MT4 and MT5 block HTTP requests from EAs by default for security reasons.

**MT4:** Tools > Options > Expert Advisors tab > Allow WebRequest for listed URL > add the API endpoint

**MT5:** Tools > Options > Expert Advisors > Allow WebRequest > add the API endpoint

The API endpoint is shown in the app's setup walkthrough. It looks something like `https://api.traderjournal.app/ingest/trades`.

---

## Checking the EA is Running

After attaching the EA, look at:

- **Top-right corner of the chart:** EA name with a smiley face icon means it is running. An angry face means it has an error.
- **MT4/MT5 terminal Experts tab:** Log messages appear here. A successful push shows the number of trades synced and your current equity. An error shows the reason.

---

## Common Issues and Fixes

**"URL not allowed" in Experts log**
- WebRequest not enabled. Go to Tools > Options > Expert Advisors and add the URL.

**"EA is not trading" / angry face on chart**
- Auto trading is disabled. Click the Auto Trading button in the MT4/MT5 toolbar.

**EA running but no data in app**
- Check the API key is correct. In the app, go to Account Settings and check the key prefix matches what you entered in the EA.

**Trades missing from journal**
- If you closed trades while the terminal was offline, the EA catches up on the next session. The timestamp stored in GlobalVariables ensures historical trades are not missed.

---

## Running Multiple EAs

The Trader Journal EA runs independently of any other EAs you have installed. It does not interfere with strategy EAs because it only reads data - it never opens, modifies, or closes trades.

You can run it on any open chart, including charts you are already using for other EAs.