TradingView to MT5: send alerts to your own MT5 — no EA, no VPS
TradingView can send an alert to a web address (a webhook), but MetaTrader 5 has no address that can receive one. Valuera fills that gap: it hosts an isolated MT5 slot for your account, checks every order against its gate — a set of rules an order must pass before it reaches the market — and executes on the MT5 account you already own, at your own broker. There is no Expert Advisor to install and no Windows VPS to rent.
How to connect TradingView to MT5 with Valuera (step by step)
You need three things: an active MT5 account with your broker, the TradingView alerts you already use, and a Valuera subscription. The steps below follow the Valuera webhook API documentation.
- Connect your MT5 account, starting with a demo account. In the Valuera console, add the account with its trading credentials and the broker server name, exactly as shown on the MT5 login screen. Valuera hosts the terminal for that account in its own slot. Setup is identical for demo and live accounts.
- Create the webhook endpoint in the panel. Copy two values: the TradingView URL, which looks like
https://valuera.cloud/tv/{id}, and the fixedrequest_idshown next to it. The request_id is a stable identifier that Valuera assigns to that endpoint. - In TradingView, open the alert, go to Notifications and paste the URL into the Webhook URL field. The authentication token is added on the Valuera side, so TradingView needs no custom headers.
- Paste a compact JSON message into the alert's Message box (about 4,096 characters at most), with your endpoint id and the panel's request_id. Never change request_id between alerts: it identifies the endpoint. A ready-made example is in the next section.
- Link the source to your MT5 account in the console. An unlinked connector receives the message but opens no trade: for an OPEN with no account routing enabled, the API answers 409 no-dispatch.
- Test with the PING action. PING checks the connection and authentication and opens no trade. When PING works, try a real OPEN on your demo account before you move to a live one.
TradingView alert message example (JSON)
Every message is a small JSON object that the docs call the envelope: it always carries id, request_id and action, followed by the fields that action needs. Here is an OPEN that buys gold with a stop loss and two take-profit levels. {{close}} is a TradingView placeholder: when the alert fires, TradingView replaces it with the close price of the bar.
{"id":"YOUR_ENDPOINT_KEY","request_id":"YOUR_STABLE_REQUEST_ID","action":"OPEN","symbol":"XAUUSD","side":"BUY","entry":{{close}},"sl":2640,"tp":[2660,2670]}
Replace YOUR_ENDPOINT_KEY with the {id} part of your webhook URL, and YOUR_STABLE_REQUEST_ID with the request_id from the panel. The id in the message must match the id in the URL. To close every open position on a symbol, send CLOSE_SYMBOL:
{"id":"YOUR_ENDPOINT_KEY","request_id":"YOUR_STABLE_REQUEST_ID","action":"CLOSE_SYMBOL","symbol":"XAUUSD"}
To check the connection without trading, send PING. A successful reply reports "ping": true and "dispatched": 0:
{"id":"YOUR_ENDPOINT_KEY","request_id":"YOUR_STABLE_REQUEST_ID","action":"PING"}
These are the fields of an OPEN message, as documented:
| Field | Required for OPEN | What it means |
|---|---|---|
id | Yes | Endpoint key. Must match the {id} in the URL. |
request_id | Yes | Stable ID assigned by Valuera to the endpoint, shown in the panel. |
action | Yes | What to do: OPEN, CLOSE_SYMBOL, PING and the other documented actions. |
symbol | Yes | MT5 symbol, for example XAUUSD. |
side | Yes | BUY or SELL. |
entry | Yes | Entry price: a number, a {min,max} range or a [lo,hi] array. |
sl | Yes | Stop loss. |
tp | Yes | Take profit: a number or an array of numbers. |
order_type | No | market, limit or stop. Default: market. |
market_price | No | Market price used to resolve an entry zone. |
pip_size | No | Overrides the pip size for the symbol. |
Lot size is not part of the message. Volume is never sent nor copied: the lot size is decided by the strategy of the receiving account, which you configure in Valuera. With order_type limit or stop, Valuera places a real pending order on your account instead of converting it to a market order. Use entry for the price: the alias entry_price is rejected.
Frequently asked questions
Can TradingView send alerts directly to MT5?
No. A TradingView alert can call a webhook URL, but MT5 has no web address that can receive it. You need a hosted endpoint in between. With Valuera, that endpoint is your /tv/ URL, and the order is executed on your own MT5 account at your broker.
Do I need an Expert Advisor or a VPS?
No. Valuera hosts the MT5 terminal for your account in an isolated instance slot. There is no Expert Advisor to install and no Windows VPS to rent.
Which brokers work?
Any broker that offers MetaTrader 5 accounts. You choose the broker, open the account and connect it with its trading credentials. We always recommend regulated brokers in reliable jurisdictions.
Can Valuera withdraw my funds?
No. Valuera works with MT5 trading credentials, which can open and close positions but cannot make withdrawals, wire transfers or capital movements. Your funds stay in your account at your broker.
What happens if an alert has no stop loss or is malformed?
It is rejected and logged with the reason, and it never reaches the market. The gate blocks any OPEN without a stop loss. A message with missing or wrong fields gets an error code such as missing-open-fields or id-mismatch.
Can an alert close or modify a position?
Yes, with the actions listed in the webhook docs: CLOSE_SYMBOL closes all open positions on a symbol, CLOSE_TICKET closes the position opened by a specific earlier OPEN, MOVE_SL_BE moves the stop loss to break-even, MODIFY updates stop loss and take profit together, and PARTIALS closes a percentage of a position.
Can I test on a demo account first?
Yes, and we recommend it. Connect a demo MT5 account first, check for a few weeks that the alert, validation and order flow behaves as you expect, then move to a live account. Setup is identical in both cases.
Do I put the lot size in the alert?
No. Volume is never sent in the message. The lot size is decided by the strategy of the receiving account, which you set in Valuera.
Why TradingView can't reach MT5 on its own
A TradingView webhook is a message sent to a web address at the moment an alert fires. Something must be listening at that address to receive it. MT5 is a trading terminal that connects to your broker; it does not offer an address that TradingView can call. That is why the traditional route asks you to rent a Windows VPS, keep MT5 running on it and install an Expert Advisor (EA) or a bridge that receives the alert and places the order.
Valuera replaces that stack with a hosted MT5 instance slot. The alert goes to your Valuera endpoint, passes the gate and is sent to the terminal that runs your account.
| Traditional route: your VPS + EA | Valuera | |
|---|---|---|
| Where MT5 runs | On a Windows VPS you rent and maintain | On an isolated instance slot that Valuera hosts |
| What you install | An Expert Advisor or a bridge on the terminal | Nothing: no EA to download |
| Where the alert goes | A receiver you set up yourself | Your endpoint: https://valuera.cloud/tv/{id} |
| Order without a stop loss | Depends on how the EA is written | Rejected and logged with the reason |
| Record of decisions | Whatever your setup logs | Panel actions and routing decisions kept for 730 days |
| Your funds | At your broker | At your broker; the credentials cannot withdraw |
To be clear about what Valuera is not: it is not a broker, not a signal vendor, not a strategy marketplace and not a hosted Pine runtime. It does not give investment advice and does not custody funds. It is the software between the alerts you already have and the MT5 account you already own. The full pipeline is explained in how Valuera works.
What the gate blocks — and what gets logged
The gate is the set of checks every order must pass before Valuera sends it to your MT5 account. It is the same gate on every source: TradingView, Telegram and custom webhooks.
- Opening orders without a stop loss are rejected. An OPEN with no stop does not reach the market.
- Symbol and routing checks use the same reason codes on every source, so a blocked order always comes with the reason it was blocked.
- A stop loss or take profit too close to the price is moved to the first level your broker allows, instead of making the order fail.
- Panel actions and routing decisions are kept in the log for 730 days. A signal that fails the gate stays in the log with the reason.
Failures are visible, not silent: what fails the gate does not reach the market, and the log shows what was blocked and why. Risk rules stay yours: you choose the source, the broker and the risk settings.
Troubleshooting: common webhook errors
If an alert does not open a trade, the error code tells you which part to fix. These are the most common codes from the webhook docs:
| Error | What it means | How to fix it |
|---|---|---|
| 400 id-mismatch | The id in the message is not the {id} in the URL. | Copy the id from your webhook URL into the message. |
| 400 request-id-mismatch | The request_id is not the one assigned to this endpoint. | Paste the request_id from the panel again and never edit it. |
| 400 missing-open-fields | An OPEN is missing entry, sl or tp. | Add all three fields, for example entry as {{close}}. |
| 404 endpoint-not-found | The endpoint is disabled or does not exist. | Check that the endpoint is enabled and the URL is complete. |
| 429 rate-limited | Too many requests from the same IP or endpoint. | Make the alert fire less often, then try again. |
| 409 no-dispatch | The message is valid, but no account routing is enabled for OPEN. | Link the webhook source to your MT5 account in the console. |
Two more codes to know: invalid-side means side is not BUY or SELL, and missing-symbol means the symbol is missing or empty. The complete list is in the webhook API docs.
Security: your account, your broker
- Encrypted credentials: trading passwords are stored encrypted, with a master key kept separate from the database.
- No withdrawals: the credentials you connect are MetaTrader trading credentials. They can open and close positions; they cannot withdraw funds, send wires or move capital out of your broker account.
- One slot per account: each connected MT5 account is its own instance slot, with its own terminal, directory and order queue. Accounts do not share a book.
- 2FA on the console: the Valuera console supports two-factor authentication and a confirmation step when a new device signs in.
- EU servers: the control plane and the nodes run in the EU.
- No custody: Valuera does not custody client funds and does not log into your broker's web portal. Funds stay at the broker you chose.
Read the full security model, the answers in the FAQ and the plans on the pricing page. For the alert side, the guide on how to structure a TradingView webhook payload goes deeper.
Related guides
- How Valuera works
- Security & trust
- FAQ
- View pricing
- Webhook API v2 documentation
- Connecting TradingView via webhook: how to structure the payload
- Signals via Telegram or webhook? Differences, limits, and use cases
- Risk management in copy trading: the five rules that matter
- Choosing a regulated broker for automated trading