FOREX & CFD EXECUTION

TradingView to MT5: from chart signal to broker order

MetaTrader 5 is not a webhook receiver. AlgoWay bridges TradingView strategies and indicators to an MT5 terminal through its Expert Advisor, where broker symbol rules, position size and execution permissions decide the actual result.

A real integration guide, with execution rules and test scenarios.

Why MT5 requires a connected Expert Advisor

An MT5 terminal cannot receive a TradingView webhook as an order on its own. AlgoWay receives the alert and passes the trading instruction to the Expert Advisor connected to your broker account. The EA must remain online for execution, and the broker ultimately decides whether the lot size and order parameters are valid.

Execution path for mt5TradingView alert then AlgoWay webhook then MT5 Expert Advisor then Broker account. Terminal and EA must remain connected; broker volume and stop rules still apply.TradingView alertAlgoWay webhookMT5 Expert AdvisorBroker accountTerminal and EA must remain connected; broker volume and stop rules still apply.
How the alert reaches the execution account. Each connector has its own authentication and sizing rules.

AlgoWay gives each MT5 route a webhook identifier, while the AlgoWayWS-MT5 Expert Advisor handles execution inside the terminal. The EA connection, symbol mapping, trade mode and safety settings matter just as much as the alert itself.

Execution through the terminal

MT5 orders are placed by the EA under the broker account logged into the terminal. The terminal and EA must remain running and connected.

Lot sizing is explicit

TradingView contracts do not automatically equal MT5 lots. Set the EA Lot Multiplier for the intended units, then check broker minimum and step size.

Position controls at destination

Reverse, Hedge and Opposite behavior, session limits, SL/TP, trailing and drawdown protections are configured for the MT5 execution workflow.

Install the AlgoWay MT5 bridge and test execution

The connection has two parts: an AlgoWay webhook destination and an Expert Advisor running in the trading terminal. Treat the UUID, the logged-in broker account and the EA status as a single configuration that must agree.

Create an MT5 destination

In AlgoWay, add a TradingView source and MetaTrader 5 destination. Copy the unique webhook UUID from the route.

Install the appropriate EA

Use AlgoWayWS-MT5 on supported Windows terminals or the Ubuntu/Wine native-socket build where appropriate. Attach it to a chart in the correct logged-in MT5 terminal.

Connect the same UUID

Set the UUID inside EA Inputs and confirm the connected state in MT5 Experts logs before sending any order.

Match contract sizing

Inspect the broker symbol volume_min, volume_step and volume_max. Set Lot Multiplier and the desired sizing model; do not assume a TradingView quantity means lots.

Create and test the alert

Paste the AlgoWay webhook URL into TradingView, add structured JSON to Message and test a minimal order in a demo account. Verify both AlgoWay logs and the MT5 Trade/History tabs.

TradingView strategy alert JSON for MT5

A TradingView strategy can supply its chart symbol, order direction and strategy quantity. The example intentionally contains no hard-coded order ID; order matching requires identifiers generated by the strategy and handled consistently by entries and exits.

Example message sent by TradingView
{
  "ticker": "{{ticker}}",
  "order_action": "{{strategy.order.action}}",
  "order_contracts": "{{strategy.order.contracts}}"
}
TradingView replaces the double-brace variables when a strategy alert fires. This is a routing example, not a guarantee that one TradingView contract equals one broker lot.

TradingView substitutes the placeholders when the alert fires. The EA receives quantity through the route but interprets it according to its Lot Multiplier and broker contract settings. Validate the resulting MT5 lot volume in a demo terminal.

MT5 lot sizing, broker symbols and position modes

Why a 10,000-unit strategy order is not 10,000 lots

MT5 uses lots, and the contract size varies by instrument and broker. A forex strategy may express quantity in units while the EA expects a volume after applying Lot Multiplier. For an account where 100,000 units represent 1 lot, a multiplier of 0.00001 converts 10,000 units into 0.10 lots. This example is meaningful only with that instrument specification and configured EA multiplier; test actual volume in demo.

The symbol is not merely a string

A TradingView alert for EURUSD may need to reach EURUSD.a, EURUSDm or another broker-specific instrument. Symbol Mapping prevents silent mismatches. The final broker symbol still needs to be visible and tradeable in Market Watch.

Hedge, reverse and opposite are different instructions

In Reverse/Netting, an opposite signal closes or reverses existing exposure under the selected rules. Hedge can preserve separately directed positions on accounts that support hedging. Opposite/Flip intentionally changes how the incoming direction is interpreted. Test entry, opposite entry, partial close and flat independently.

Stops are checked against live broker prices

An SL drawn correctly on TradingView can violate MT5 Stops Level, Freeze Level or Bid/Ask distance requirements at execution time. Distinguish error 10016 (invalid stops) from error 10015 (invalid price); review the broker return code instead of blindly changing the JSON.

MT5 configuration checklist: alert to broker position

SettingPurposeVerification
Webhook UUIDSame ID in the AlgoWay route and EA InputsEA connects to the intended webhook, not another route
EA buildWindows WS or Ubuntu/Wine native-socket EA as applicableTerminal connectivity and Experts log
Lot MultiplierConverts strategy quantity into broker lot volumeFor a units-based forex strategy, 10,000 × 0.00001 = 0.10 lots before broker rounding
Broker symbolMaps chart symbol to the broker catalogueEURUSD and broker suffixes are not assumed interchangeable
Trade modeHedge, Reverse or Opposite behaviorSend entry and exit tests, then inspect actual position state

One TradingView strategy routed to two MT5 brokers

A strategy emits a EURUSD long alert using a single TradingView contract-size convention. Account A is a small retail account with a conservative lot multiplier and a tighter daily loss limit; Account B uses a different broker suffix and smaller position size. Configure independent AlgoWay routes and EA settings for each account instead of sending one fixed lot value everywhere.

First verify that both terminals are connected, then send a demo entry followed by a flat alert. Only after those two actions agree with your intended exposure should you test absolute SL/TP, trailing, sessions and clone routing. Clone Mode distributes a signal; it does not remove broker-specific volume or execution rules.

Diagnosing MT5 connection, volume and stop errors

Alert received, no MT5 position

Check EA connection, Algo Trading permission, the UUID and Experts log before changing the strategy.

Wrong size or unexpected lot

Review Lot Multiplier, strategy units, broker contract size and volume step. Never correct this by guessing.

Trade opens without expected SL/TP

Review absolute versus relative exit fields, EA Inputs and the broker retcode; invalid stops can be rejected.

Terminal on another machine

The EA must run in the MT5 instance connected to the actual broker account. A local install cannot execute in an unrelated VPS terminal.

Compare the AlgoWay webhook log with the MT5 Experts and Journal tabs, then the broker order history. A successful HTTP delivery without a connected EA cannot prove that the broker executed a position.

MT5 Expert Advisor and webhook questions

Can TradingView send orders directly to MetaTrader 5?

MT5 does not receive TradingView webhooks natively. AlgoWay receives the alert and sends it to the connected MT5 EA for broker execution.

Do I need a VPS?

You need a running, connected MT5 terminal. A VPS is useful for unattended operation, but an already reliable always-on terminal also works.

Does AlgoWay support MT5 on Ubuntu?

AlgoWay offers an Ubuntu/Wine-oriented MT5 EA build with native socket/TLS transport. Use the compatible build for that environment.

Why do my lots differ from TradingView contracts?

The EA applies sizing and multiplier rules while the broker enforces volume steps and contract specifications. Validate the conversion using a small demo order.

Can I automate Telegram signals to the same MT5 platform?

Yes. Telegram is a separate signal source in AlgoWay, with its own parsing and route settings; MT5 remains the execution destination.

MT5 manuals for terminal and broker-specific problems

The MT5 EA guides cover connection and sizing; the invalid-stops article explains why correct TradingView prices can still fail at a broker.

Try an MT5 demo trade before using live lots

Start with a single strategy order and check its resulting lots, broker symbol and SL/TP inside MT5. Only then enable other accounts and additional risk controls.