TradingView · Webhooks · MetaTrader

TradingView–MetaTrader Integration — Webhook Alerts That Place Real Trades

We build the missing bridge: a secure server that receives TradingView webhook alerts, validates them, applies your risk rules and executes the order on MetaTrader 4/5 or a crypto exchange.

10–15
Days typical delivery
HTTPS
Secure webhook
MT4·MT5
Order execution
24/7
Hosted bridge
Quick answer

TradingView cannot place trades on MetaTrader by itself, but its alerts can send a webhook, an HTTP POST, to a server you control. ExpertNevees builds that server and the MetaTrader-side executor: it authenticates each alert, checks duplicates and risk rules, and sends the order to MT4/MT5 or an exchange. Typical delivery is 10–15 days, including hosting guidance.

How the Bridge Works

📈

TradingView Alert

Webhook URL
Your strategy or indicator fires an alert whose message is a JSON payload such as symbol, action and volume.
🌐

Webhook Server

HTTPS endpoint
Receives the POST, verifies it, rejects duplicates and puts the order intent in a queue. It must answer quickly.
🧩

Executor

MT4 / MT5 EA
An Expert Advisor on your terminal pulls queued orders and trades with your risk rules applied.
📬

Feedback

Logs & alerts
Every alert, decision and fill is logged, with Telegram notification for rejections and errors.

TradingView Webhook Requirements You Must Design Around

RequirementWhat TradingView documentsWhat it means for the build
Plan and securityWebhook alerts need a paid plan and two-factor authentication enabled on the accountConfirm your TradingView plan before starting
PortsWebhooks are sent to ports 80 and 443 onlyThe server must listen on standard HTTP/HTTPS ports behind a reverse proxy
TimeoutTradingView cancels a request that takes longer than about 3 secondsThe server acknowledges immediately and processes the order asynchronously
Content typeValid JSON is sent as application/json, anything else as text/plainThe parser must tolerate both content types
Sensitive dataDo not put credentials in the alert messageAuthentication uses an unguessable URL token, never account passwords

Always check TradingView’s current webhook documentation, because plan requirements and limits can change. Source: TradingView webhook guide.

A Webhook Receiver That Acknowledges Fast and Rejects Bad Requests

Python · FastAPI
import asyncio
import hmac
import json
import os
from fastapi import FastAPI, HTTPException, Request

app = FastAPI()
URL_TOKEN = os.environ["WEBHOOK_URL_TOKEN"]          # long random string, part of the URL
orders: asyncio.Queue = asyncio.Queue()
seen_ids: set[str] = set()                           # simple replay / duplicate guard

@app.post("/webhook/{token}")
async def webhook(token: str, request: Request):
    if not hmac.compare_digest(token, URL_TOKEN):
        raise HTTPException(status_code=404)         # do not reveal that the endpoint exists

    raw = await request.body()                       # TradingView may send text/plain
    try:
        data = json.loads(raw)
    except json.JSONDecodeError:
        raise HTTPException(status_code=400, detail="payload must be JSON")

    alert_id = str(data.get("id", ""))
    if alert_id and alert_id in seen_ids:
        return {"status": "duplicate"}               # same alert delivered twice: ignore
    seen_ids.add(alert_id)

    intent = {k: data.get(k) for k in ("symbol", "action", "volume", "sl", "tp")}
    await orders.put(intent)                         # a worker validates and executes later
    return {"status": "queued"}                      # answer well inside the ~3 s limit

The matching TradingView alert message could be: {"id":"{{ticker}}-{{time}}","symbol":"{{ticker}}","action":"buy","volume":0.1}. Placeholders such as {{ticker}} are filled in by TradingView when the alert fires.

Safeguards Built Into Every Bridge

Why a webhook bridge needs more than a script
  • ●
    Authentication by secret URL token and optional IP allow-listing of TradingView’s published addresses.
  • ●
    Idempotency: the same alert delivered twice never opens two trades.
  • ●
    Symbol mapping: TradingView ticker names are mapped to your broker’s symbol names (suffixes, prefixes, CFD naming).
  • ●
    Pre-trade checks: spread, trading hours, max exposure and daily-loss limits are applied before every order. See Capital & Risk Management.
  • ●
    Dead-letter log and alerts: any rejected or failed order is recorded and sent to your Telegram.
  • ●
    Heartbeat: the executor reports that it is alive, so you notice a disconnected terminal immediately.

Delivery Steps

  1. Review your TradingView strategy

    We check that alerts fire at the moments you intend. Strategy logic that repaints or acts on unconfirmed bars is flagged first.

  2. Design the alert payload

    A JSON schema for actions such as buy, sell, close, move stop, with symbol, size and optional stop and target.

  3. Build server and executor

    Webhook server, queue, and the MT4/MT5 Expert Advisor or exchange connector.

  4. Test on demo

    End-to-end tests with real TradingView alerts on a demo account, including failure scenarios.

  5. Deploy and hand over

    Hosting on a VPS with auto-restart, documentation and monitoring. See VPS Setup & Bot Infrastructure.

Delivery, Support & Guarantee

10–15 days
Typical delivery
MT4 · MT5 · Exchanges
Targets
Setup guidance included
Hosting
30-day technical
Guarantee

Timelines are indicative. The exact price and delivery date are confirmed in writing before work starts, with no hidden costs. Payment: 50% advance, 50% after your approval (USDT or bank wire).

Frequently Asked Questions

Can TradingView trade directly on MetaTrader?

Not by itself. TradingView alerts can send a webhook, and a bridge such as the one we build receives it and sends the order to MetaTrader 4/5 or an exchange.

Do I need a paid TradingView plan?

Yes. TradingView documents that webhook alerts require a paid plan and two-factor authentication on your account. Check TradingView’s current plan details before starting.

Is the connection fast enough for trading?

The webhook hop typically adds a small delay to a trade placed at bar close, which suits most swing and intraday strategies. It is not intended for latency-critical scalping.

What if TradingView sends the same alert twice?

The bridge uses an alert ID to detect duplicates, so a repeated delivery never opens a second trade.

Does the bridge work with a Pine strategy as well as an indicator?

Yes. Both can fire alerts. Strategy alerts follow the order logic of the Pine script. We review them for repainting and bar-close behaviour first.

Can the same bridge send orders to a crypto exchange?

Yes. The executor can be an exchange connector instead of, or in addition to, MetaTrader. See Crypto Trading Bot Development.

Should I instead convert my Pine script to an Expert Advisor?

If you want full independence from TradingView and tick-level control, conversion is better. See TradingView to MetaTrader Conversion.

Official Documentation & Sources

  • TradingViewHow to Configure Webhook AlertsTradingView Support
    View Docs ↗
  • FastAPIFastAPI Documentationfastapi.tiangolo.com
    View Docs ↗

Automate Your TradingView Alerts Into Real Orders

Send your TradingView script or alert idea. We confirm what is feasible and quote it in writing.