How to Automate TradingView Alerts on XM (MT4 and MT5)

Last updated · By the TradingView Link team
Short answer

To trade an XM account from TradingView alerts, send each alert as a webhook to a bridge, and an EA in your XM MT4 or MT5 terminal places the order. The XM-specific step is the symbol name: XM calls gold GOLD, not XAUUSD, and XM's EU site lists forex pairs with a #.

We make TradingView Link, an EA bridge. We aren't affiliated with XM and earn nothing from the XM links on this page. Every XM detail below comes from XM's own website, checked November 2026. XM runs separate sites for different regions, and this one showed us both XM Global and its EU site, so confirm the details in your own Members Area.

Can you trade XM directly from TradingView?

Not as far as XM's own help pages show. We found no XM article about placing XM trades from TradingView's trading panel. Either way, automation needs a bridge, because an alert only sends a message and can't place an order by itself.

The bridge needs somewhere to run an EA, and XM is clear that you can. XM's help centre says "both the MT4 and MT5 platforms allow you to trade using EAs or trading robots". So the account that trades your alerts is an XM MT4 or MT5 account, with the terminal running on a PC or VPS.

Which XM account should you use?

Any XM account you trade on MT4 or MT5. Which accounts you can open depends on the XM company that serves your country:

XM account types (checked November 2026)
AccountOffered byMinimum deposit
StandardXM Global (xmglobal.com)USD 5
Ultra LowXM Global and XM's EU siteUSD 5
ZeroXM's EU site (xm.com)USD 5
SharesXM Global, for buying sharesUSD 10,000

Sources: XM Global's account types and XM's EU account types. Both say all accounts offer negative balance protection, hedging and an Islamic option as standard. Ultra Low is the one XM describes as "the ideal choice for trading high volumes".

Which symbol names does an XM account use?

XM uses its own names for some markets, and an alert must use the exact name your account shows. This is the most common reason an XM alert reaches the EA but places nothing.

TradingView symbols and XM's names (checked November 2026)
MarketTradingView symbolXM's name
GoldXAUUSDGOLD
S&P 500SPXUS500
EUR/USDEURUSDEURUSD, or EURUSD# on XM's EU site

How do you write the alert for an XM symbol?

The message is the same as for any broker, with your XM symbol in it. Line 1 is your webhook password, and each line after it is one command:

YourWebhookPassword
long EURUSD q=0.01 sl=300 tp=600

sl and tp are distances in points, your broker's smallest price step. On a 5-digit EURUSD quote, 10 points make one pip, so sl=300 is a 30-pip stop. Gold and indices use a different step, so check the digits in Market Watch before you set a stop on them. To close the position:

YourWebhookPassword
flat EURUSD

The numbers above are only an example, not a recommendation. For a Pine Script strategy, make the XM symbol an input, so the chart can stay on any feed's XAUUSD while the order goes to GOLD:

//@version=6
strategy("EMA cross to XM", overlay = true)

// Your XM symbol, copied from Market Watch
brokerSymbol = input.string("GOLD", "XM symbol")

fast = ta.ema(close, 9)
slow = ta.ema(close, 21)

if ta.crossover(fast, slow)
    strategy.entry("Long", strategy.long, alert_message = "long " + brokerSymbol + " q=0.01")
if ta.crossunder(fast, slow)
    strategy.close("Long", alert_message = "flat " + brokerSymbol)

Then create one alert on the strategy, with this message:

YourWebhookPassword
{{strategy.order.alert_message}}

Check gold's minimum volume in Specification before you use a size like q=0.01. How to automate a TradingView strategy explains the alert_message pattern and the mistakes that stop it working.

How do you connect TradingView to XM, step by step?

  1. Get a TradingView plan with webhooks, which start at Essential, and turn on 2-factor authentication, which TradingView requires for webhook alerts. Our plan comparison has the details.
  2. Log in to your XM account in the MT4 or MT5 desktop terminal. XM separates two passwords: the trading account password logs in to MT5 with your account ID, while the profile password is for XM's website and app. XM says the ID, password and server must "perfectly match" the ones you received after registering.
  3. Create a webhook in TradingView Link, then install the EA, allow WebRequest and DLL imports, and attach it to one chart, as in the MT5 guide or the MT4 guide.
  4. Turn on trading for EAs. XM's own checklist: allow real trading under Tools, Options, Experts, and make sure the Expert Advisors button on the toolbar is on.
  5. Copy your symbol names from Market Watch into your alerts, suffix included.
  6. Keep the terminal running on a PC or VPS. XM's VPS, below, is one option.
  7. Send a test alert on a demo account, with the same symbols and sizes, before you go live.

Can you get XM's VPS for free?

Yes, and the bar is low. XM's help centre says the VPS is free for MT4 and MT5 "as long as you have a minimum balance of 500 USD", provided you trade at least 2 standard round lots or 200 micro round lots a month. If you don't, it costs USD 25 a month, taken from your trading account on the first day of each month.

What else should you check before automating on XM?

What does it cost?

Trading leveraged products is risky. This page summarizes XM's public pages as of 11 November 2026, and it isn't financial advice. TradingView Link isn't affiliated with XM, TradingView or MetaQuotes.

Test your XM setup on demo first
Connect TradingView to MT4 or MT5 with 5 free alerts a month. No credit card.

Frequently asked questions

Can I connect TradingView to XM?

Yes, through a webhook bridge. A TradingView alert sends a message, the bridge passes it on, and an EA in your XM MT4 or MT5 terminal places the order. XM says both platforms allow you to trade using EAs or trading robots.

Does XM have a TradingView integration?

XM's help centre has no article about placing XM trades from TradingView's own trading panel (checked November 2026). Automating alerts needs a bridge either way, because an alert can't place an order by itself.

What symbol is gold on XM?

GOLD. XM's own market list shows gold as GOLD rather than XAUUSD, and the S&P 500 as US500. An alert that says XAUUSD won't find the symbol, so copy the exact name from Market Watch.

Why do my XM symbols end in #?

XM's EU site lists its forex pairs with a # suffix, such as EURUSD#, while XM Global lists EURUSD. The name depends on which XM company and account you have, so use the name your own Market Watch shows, suffix included.

Does XM allow EAs and hedging?

Yes. XM's help centre says both MT4 and MT5 allow you to trade using EAs or trading robots, and its account pages say all accounts offer hedging as standard.

Is XM's VPS free?

It is if you keep a balance of at least USD 500 and trade at least 2 standard round lots, or 200 micro round lots, a month. Otherwise XM charges USD 25 a month, taken from your trading account on the first day of the month.

Which password logs in to XM MT5?

Your trading account password, with the account ID XM sent you. XM's profile password is a different one, for its website and app. Use the server named in your registration details too.

Why isn't my EA trading on XM?

XM's checklist: allow real trading under Tools, Options, Experts; make sure the Expert Advisors button is on and the EA shows as running on the chart; then check the Experts tab for errors. The EA's log names the problem, such as a symbol that doesn't exist.

Sources

All checked November 2026.

Related guides