Documentation

Set up MetaSync in minutes

Everything you need to connect TradingView to MetaTrader 5 — from installation to alert syntax and troubleshooting.

Getting started

1. Install MetaSync

  1. Download the installer from the download section.
  2. Run MetaSync_Setup.exe and follow the steps. A desktop shortcut is created by default.
  3. Launch MetaSync from the desktop or Start menu.
Seeing "Windows protected your PC"? Windows SmartScreen shows this for new apps. Click More info → Run anyway to continue. See Troubleshooting if antivirus removes the app.

2. Activate your license

Enter the license key from your welcome email when prompted. Each license is bound to your computer's hardware ID on first activation.

3. Connect your MT5 account

  1. Open MetaTrader 5 and make sure you're logged in with Algo Trading enabled.
  2. In MetaSync, go to Settings → Add Account.
  3. Enter your MT5 login, password, broker server name and terminal path (usually C:\Program Files\MetaTrader 5\terminal64.exe).
  4. Click Test Connection, then save.

Your credentials are stored only on your computer and are never sent to MetaSync's servers.

4. Start the server & copy your webhook

  1. Click ▶ Start Server in the top-right of the app.
  2. Your personal webhook URL appears on the Dashboard, in the form https://api.metasync.trade/webhook/<your-id>.
  3. Click Copy — you'll paste this into TradingView next.

TradingView alerts

  1. On your TradingView chart, create an alert (from your strategy or indicator condition).
  2. In the alert's Notifications tab, enable Webhook URL and paste your MetaSync URL.
  3. In the Message box, paste the JSON from MetaSync's JSON Generator tab.
  4. Save the alert. Keep MetaSync running — when the alert fires, the order is placed in MT5.
Webhooks require a paid TradingView plan (Essential or higher).

Alert syntax

MetaSync reads a JSON message from each alert. Only action is required — any field you leave out uses the defaults from Settings.

{
  "action": "buy",
  "symbol": "XAUUSD",
  "lot_size": 0.10,
  "sl_percent": 1.0,
  "tp_percent": 2.0,
  "expiry_hours": 2,
  "sl_mode": "hybrid",
  "trailing_trigger": 0.6,
  "secret": "YOUR_SECRET"
}

Actions

ActionWhat it does
buyOpens a market buy order on symbol.
sellOpens a market sell order on symbol.
closeCloses all open positions on symbol.
close_allCloses every open position on all connected accounts.

Fields

FieldDescription
symbolInstrument, e.g. EURUSD. Required for buy, sell and close.
lot_sizeTrade volume in lots.
sl_percentStop-loss distance as a % of the entry price.
tp_percentTake-profit distance as a % of the entry price.
expiry_hoursAuto-close the trade after this many hours if SL/TP hasn't been hit.
sl_modenone, breakeven, trail or hybrid. Default: none.
trailing_triggerBreakeven/hybrid trigger as a fraction of the TP distance. 0.6 = when 60% of the way to TP. Default: 0.6.
trail_stepTrail/hybrid: how far price must move (in %) before the SL is moved again. Default: 3.0.
trail_distanceTrail/hybrid: how far the SL moves each step, as a % of entry. Default: 2.0.
secretMust match the webhook secret in Settings, if you've set one.

Example exit alert:

{ "action": "close", "symbol": "XAUUSD" }

Tip: use the built-in JSON Generator tab to build valid messages without typing them by hand.

Stop-loss modes

ModeBehaviour
noneFixed SL and TP. Only the expiry timer applies.
breakevenMoves the SL to the entry price once profit reaches trailing_trigger × the TP distance.
trailEach time price advances trail_step%, the SL moves up by trail_distance% of entry. It never moves backwards.
hybridBreakeven first; once that triggers, trailing takes over.

Trailing example — buy at 100, initial SL 95, trail_step 3, trail_distance 2:

price 103 (+3%)  → SL 95 → 97
price 106 (+3%)  → SL 97 → 99
price 102 (drop) → SL stays 99
price 109 (+3%)  → SL 99 → 101

MetaSync saves the trades it's managing, so these rules resume automatically if the app or your PC restarts.

Accounts & settings

Multiple MT5 accounts (Premium)

Add as many accounts as you like under Settings → Add Account. Every alert is executed on all active accounts in parallel. Per account you can set:

The Basic plan executes on one account.

Webhook secret

Optional. If you set a secret in Settings, alerts must include a matching "secret" field or they're rejected.

Trade defaults

Default lot size, SL %, TP % and expiry hours are used whenever an alert doesn't specify its own value.

Troubleshooting

MT5 connection fails

Alerts aren't arriving

MetaSync disappeared after a restart

Some antivirus tools, including Windows Defender, can mistakenly quarantine new apps. Open Windows Security → Virus & threat protection → Protection history and restore MetaSync. Then add an exclusion for C:\Program Files\MetaSync under Manage settings → Exclusions.

Still stuck?

Submit a support ticket and include your MetaSync version, broker and any error message.