Forex Brokers
MetaTrader 5
MetaTrader 5 integration · forex, gold and indices

Automate Forex and Gold Trading on MetaTrader 5

Connect any MetaTrader 5 account through a small Expert Advisor in your own terminal: no password and no API key. Then build a bot that trades forex, gold and indices from your signals, with take profit, stop loss and a stop that steps up in points. Seven steps, no code.

Any MT5 broker
Demo or live
No password shared
A MetaTrader 5 account connected through the TDF_Forex Expert Advisor, a TradingView buy alert opening 0.01 lot of XAUUSD with take profit, stop loss and a stop that steps up in points, and the trade landing in the list
The XAUUSD buy rising while the EA moves its stop up in points at each step, then closing the trade 750 points up

Top forex brokers

If your broker offers a MetaTrader 5 account, the bot can trade it.

Exness
IC Markets
Pepperstone
OANDA
Ultima Markets
IG
Saxo
Tickmill
FOREX.com
BlackBull Markets
Interactive Brokers
Swissquote
Axi
CMC Markets
FXCM
Darwinex
Capital.com
GO Markets

Before you start

What you need, and nothing to share

MetaTrader 5 connects through an Expert Advisor running in your own terminal. There is no API key, and your broker login never leaves your machine.

An MT5 account

Demo or live, at any broker that offers MetaTrader 5, including cent accounts.

MT5 running

The desktop terminal on a computer or a VPS, open with the EA attached. The bot trades while it runs.

A signal source

TradingView or MetaTrader alerts, Telegram, Discord, Copy Trader, or Pip, the AI Trade Agent.

Nothing to share

No password and no API key: the EA signs in with a token that works for one account only.

What happens to every signal
Your signal
Says buy or sell, and the symbol
Trader Frame
Lot size and exits from your bot
MetaTrader 5
MetaTrader 5
The EA places the order with its stop and target

Your bot decides the lot size and the exits. The EA in your terminal places the order with its stop and target, and moves the stop up in steps.

Step by step

From a MetaTrader 5 account to a bot trading XAUUSD

Steps 2 to 4 happen in MetaTrader 5, with the connect sheet open beside it. Demo and live accounts connect the same way.

01
Step 1 of 7

Pick MetaTrader 5 in the connect sheet

  • Open Brokers and press + Connect broker.
  • Pick Forex & stock, then MetaTrader 5, and press Continue.
  • Your EA token appears: it is what the EA signs in with.

Treat the token like a password. It works for one MT5 account only, and stays the same until you disconnect that account.

Opening the connect sheet from the Brokers page, picking Forex and stock, then MetaTrader 5, pressing Continue, and the EA token appearing
02
Step 2 of 7

Download the EA and allow its two addresses

  • Press Download for TDF_Forex.ex5.
  • In MT5, open Tools ▸ Options ▸ Expert Advisors and tick Allow WebRequest for listed URL.
  • Add https://api.traderframe.io, then a second line, https://api.traderframe.io:9002.

Without the first line MT5 blocks the EA from reaching Trader Frame. Without the second, the EA shows Connected but trades fail with error 4014.

Downloading TDF_Forex.ex5 and copying the two addresses to allow in MetaTrader 5
03
Step 3 of 7

Install the EA in MetaTrader 5

  • Open File ▸ Open Data Folder ▸ MQL5 ▸ Experts, copy TDF_Forex.ex5 in, then refresh Expert Advisors in the Navigator.
  • Drag TDF_Forex onto any chart and paste your EA token in the Inputs tab.
  • Turn AutoTrading on, so the button goes green.
  • A smiley face in the chart’s corner means the EA is running.

The chart and symbol don’t matter: from one chart, the EA manages every trade on the account.

The connect sheet’s MetaTrader 5 steps: copying the EA into MQL5 Experts, attaching it with the token, turning AutoTrading on and checking the smiley face
04
Step 4 of 7

Check the connection

  • Back in Trader Frame, press I’ve done this.
  • Trader Frame listens for the EA’s first check-in.
  • The account appears connected, with its balance.

Nothing after a minute? Open the Experts tab at the bottom of MT5: the message there names the missing step.

Pressing I’ve done this, Trader Frame listening for the EA, and MetaTrader 5 appearing connected with its balance
05
Step 5 of 7

Build a forex bot

  • Create a bot and pick your MT5 account under Brokers.
  • In Position size, pick the symbol the way your broker names it, for example XAUUSD or XAUUSD.sc.
  • Set the lot size placed per signal.

A lot means different amounts on different symbols. If your lot is below the symbol’s minimum, the EA raises it to that minimum.

Picking the MetaTrader 5 account for a bot, then the XAUUSD symbol and a 0.01 lot in the Position size panel
06
Step 6 of 7

Set the exits in points

  • In Exit rule, choose how positions close: Auto close at your target or stop, or follow the signal.
  • Set take profit and stop loss in points.
  • Turn on the trailing stop and add steps: at 500 points move the stop to 450, and so on.
  • Check the market move: take profit and stop loss against the live spread.
  • Press Save.

Points are your broker’s: on a 2-digit gold quote 300 points is $3.00, on a 3-digit quote it is $0.30. A stop inside the spread is refused as invalid.

The Exit rule panel: auto close, take profit and stop loss in points, a six-step trailing ladder, the market move against the spread, then Save
07
Step 7 of 7

Add a signal and switch it on

  • Under Signal sources, add Trading View for your alerts.
  • Or add Meta Trader alerts, Telegram, Discord or Trade Agent.
  • Press Activate.

Keep MT5 open with the EA attached: the bot trades through your terminal, so it trades only while the terminal runs.

Opening the signal source menu with Meta Trader, Copy Trader, Telegram and Discord, and pressing Activate

The alert message

The message only says buy or sell. The bot decides the lot size and the exits.

TradingView
TradingView alert message · strategy
Copy it from the bot’s Trading View panel
{ "symbol": "{{ticker}}", "side": "{{strategy.order.action}}" }
TradingView
Indicator alerts · one per side
Buy opens a long · Sell opens a short
{ "symbol": "{{ticker}}", "side": "BUY" }
{ "symbol": "{{ticker}}", "side": "SELL" }

The alert names the symbol the way your chart does, for example XAUUSD. The bot trades the symbol it is set to, with its own lot size and exits.

AI trading agent for MetaTrader 5

Meet Pip: an AI trading agent that trades MetaTrader 5 inside your limits

Pip is Trader Frame’s Trade Agent. Add it to an MT5 bot instead of an alert: Pip reads the XAUUSD market, decides when to go long or short, and explains every decision. Your bot still sets the lot size and the exits.

Suggest
Pip proposes the trade and you place it or skip it. A proposal expires after 5 minutes.
Enter
Pip places the trade itself, inside your bot’s limits: lot size, trading hours and plan.
Manage
While its own position is open, Pip can move the stop closer (never wider) or close the trade.
Add Pip to an MT5 bot
Pick Trade Agent under Signal sources

Can an AI agent trade MetaTrader 5 for me?

Yes. Add Pip, the Trade Agent, to an MT5 bot as its signal source. Pip decides when to buy or sell; the EA places the order with your lot size and exits.

What does Pip read before a trade?

The symbol’s candles on several timeframes and the spread your broker quotes, and it explains every decision.

Does Pip use my exits?

Yes. Take profit, stop loss and the steps come from the bot’s Exit rule, in points, and the EA places them with the order.

How is Pip paid for?

Each look Pip takes uses agent credits from your plan. The Free plan has no agent.

Demo or live

Same EA, two ways in

Your broker gives you the demo and the live MT5 account; Trader Frame connects either one the same way, each with its own token. A bot proven on demo moves to live by changing its broker.

Demo
Live
How it connects
The EA in your terminal, with its token
The EA in your terminal, with its token
Funds
Your broker’s demo funds
Your account balance
Account check
The EA reports a demo account
The EA reports a live account
Per broker
One demo account
One live account
Your password
Never shared
Never shared

Keeping it running

Day to day on MetaTrader 5

Keep the terminal running

The EA trades only while MT5 is open. A VPS keeps it going when your computer sleeps. If the EA is quiet for 90 seconds the account shows disconnected, and it recovers on the next check-in.

Exits travel with the order

The EA places take profit and stop loss with the order, so they hold at your broker. The trailing steps are moved by the EA while it runs.

Points and lots are the broker’s

Take profit, stop loss and steps are in your broker’s points, and a lot means different amounts on different symbols. Check the market move before you save.

Updating the EA

When a new EA version is out, the account card says so. Download it, replace the file in MQL5 ▸ Experts and attach it to the chart again.

Troubleshooting

What a message means, and what to do

Every refusal and skip is written to the bot’s Signals tab with its reason. The Experts tab in MT5 shows the EA’s side.

What you see
Why
What to do
Frowny face on the chart
AutoTrading is off, so the EA can see the account but cannot trade.
Turn AutoTrading on, so the button goes green.
Connected, but trades fail (error 4014)
The second WebRequest line, the trade channel on port 9002, is missing.
Add https://api.traderframe.io:9002 under Tools ▸ Options ▸ Expert Advisors.
Account card: “EA is not connected”
MT5 is logged into a different account than the token’s, or the terminal is closed.
Log MT5 into the account you connected, or connect this account for its own token.
Broker refused: “Invalid stops”
The stop sits inside the spread, often because the broker quotes with one more digit.
Raise the points: on a 3-digit gold quote, multiply them by ten.
Skipped: “Symbol mismatch”
The alert named a different symbol than the bot trades.
Use the symbol your broker uses, or change the bot’s symbol.

FAQ

MetaTrader 5 questions

Does Trader Frame see my MT5 password?

No. The EA runs in your own terminal and signs in with a token. Your broker login never leaves your machine.

Which brokers work?

Any broker that offers MetaTrader 5, demo or live. The EA works with your account as the broker set it up, including cent accounts.

Does my computer need to stay on?

MetaTrader 5 has to stay open with the EA attached. Many traders run it on a VPS so it keeps going around the clock.

What can the bot trade?

Whatever your MT5 account offers: forex pairs, gold, indices and more, using the symbol name your broker uses.

Why points instead of pips?

MetaTrader prices move in points, the smallest step for each symbol. The Exit panel shows the market move against the spread, so you can check the distance before you save.

Can MetaTrader alerts send the signals?

Yes. Add Meta Trader under Signal sources for alerts from your MT5 indicators, or use TradingView, Telegram, Discord or Pip.

Start on demo

Prove it on demo. Go live with the same EA.

Connect your broker’s MT5 demo first. When the bot has earned it, connect your live account with its own token and point the same bot at it.