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

Last updated · By the TradingView Link team
Short answer

OANDA connects to TradingView's trading panel for manual trades, but alerts can't place trades on their own. To automate them, send each alert as a webhook to a bridge, and an EA in your OANDA MT4 or MT5 terminal places the order. US accounts get MT4 for forex, and the FIFO rule means trades with stops need unique sizes.

We make TradingView Link, an EA bridge. We aren't affiliated with OANDA and earn nothing from the links on this page. Every OANDA detail below comes from OANDA's own websites and help centre, checked December 2026. OANDA runs several companies with different offers, so check which one holds your account.

Which OANDA entity gives you MT4 or MT5?

OANDA's division page assigns clients by residence. Your entity decides which MetaTrader version you can automate:

OANDA entities, MetaTrader and TradingView (checked December 2026)
EntityMetaTraderTradingView
US: OANDA CorporationMT4, forexSame account
UK: OANDA EuropeMT4 or MT5Yes
EU: OANDA TMSMT5CFDs account
Select countries: OANDA Global MarketsMT5 onlySame account

Can one OANDA account trade from TradingView and run an EA?

In the US, yes. OANDA's sub-account page lists where a v20 MT4 sub-account takes orders: "OANDA mobile, OANDA web, OANDA desktop*, MT4 desktop, MT4 web, MT4 mobile, TradingView". It adds that "the definitive system of record" is "the v20 account", "not the MT4 account that is linked to the v20 account". So an EA in MT4 and your clicks on TradingView's panel trade the same balance.

OANDA Global Markets says the same about MT5: it "connects to OANDA's own proprietary mobile app and TradingView, giving you a unified trading experience". On TradingView, its symbols carry suffixes such as EURUSD.ONE or EURUSD.SML.ONE, depending on the account type.

TradingView's panel is for placing trades by hand, and an alert only sends a message, so automating alerts still needs a bridge. Give your alert trades their own magic number to keep them apart from manual ones.

What does the FIFO rule mean for US accounts?

US accounts follow OANDA's FIFO requirement, which requires "all trades that have a take profit (TP), stop loss (SL), or trailing stop (TS) to be a unique size". Two open EURUSD trades of 0.10 lots, both with a stop loss, aren't allowed: the second is cancelled.

The FIFO rule applies only to OANDA Corporation. In the UK, OANDA One with MT5 has "Hedging is always enabled", while v20 accounts net by default and can open a sub-account with hedging enabled.

How do you write the alert for an OANDA account?

Line 1 is your webhook password, and each line after it is one command:

YourWebhookPassword
long EURUSD q=0.11 sl=300 tp=600 m=4101

sl and tp are distances in points, your broker's smallest price step, so on a 5-digit EURUSD quote sl=300 is a 30-pip stop. The odd size, 0.11 lots, leaves room for other trades on the pair under FIFO. The numbers are only an example, not a recommendation. To close the strategy's trades:

YourWebhookPassword
flat EURUSD m=4101

Copy each symbol exactly as your MT4 or MT5 Market Watch shows it. OANDA's MT4 guide says to right-click Market Watch and choose Show All to see every pair. Our symbol mapping guide covers names that differ between TradingView and your broker.

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

  1. Get a TradingView plan with webhooks, which start at Essential, and turn on 2-factor authentication. Our plan comparison has the details.
  2. Open an OANDA account with MetaTrader: a v20 MT4 sub-account in the US, MT4 or OANDA One with MT5 in the UK, or MT5 at OANDA Global Markets.
  3. Log in to it in the MT4 or MT5 desktop terminal. OANDA says the login ID and server are in its HUB.
  4. Create a webhook in TradingView Link, then install the EA, allow WebRequest and DLL imports, and attach it to one chart, as in the MT4 guide or the MT5 guide.
  5. Keep the terminal running on a PC or a Windows VPS. Our VPS guide explains when you need one.
  6. Send a test alert on an OANDA demo account, with the same symbols and sizes, before you go live.

Will OANDA pay for your VPS or TradingView plan?

What does it cost?

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

Test your OANDA 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 OANDA?

Yes, in two ways. OANDA's own connection lets you trade from TradingView's charts by hand. To have alerts place trades automatically, send them as webhooks to a bridge, and an EA in your OANDA MT4 or MT5 terminal places the orders.

Is my OANDA TradingView account the same as my MT4 account?

In the US, yes. OANDA's v20 MT4 sub-account takes orders from MT4 and from TradingView, and OANDA says the v20 account, not the linked MT4 account, is the system of record. OANDA Global Markets also connects one MT5 account to its app and TradingView.

Can US traders automate TradingView alerts on OANDA?

Yes, on MT4, which OANDA Corporation offers for forex. Mind the FIFO rule: every trade with a stop loss, take profit or trailing stop must be a unique size, and OANDA can't warn an EA when it cancels one. Crypto can't be traded on OANDA's US MT4.

Does OANDA offer MT5?

Not in the US. OANDA's UK entity offers MT5 on its OANDA One account, its EU entity offers MT5, and OANDA Global Markets offers MT5 only, having stopped supporting MT4 on 7 October 2024.

Does OANDA allow EAs?

Yes. OANDA says MT4 lets you build your own expert advisors or buy them from third parties, and its global entity calls MT5 an "ideal environment for EA traders". US accounts must still follow the FIFO rule.

Will OANDA pay for my VPS or TradingView plan?

A VPS only for very active traders: OANDA covers the VPS of US Elite Traders, which needs $10 million of volume a month. In the US, OANDA also offers three months of TradingView Essential, Plus or Pro for trading volume, to clients who haven't traded in 4 months, until 31 December 2026.

Sources

All checked December 2026.

Related guides