7 platforms

how to

How to Automate TradingView Alerts on MT5, MT4, cTrader & TradeLocker

Your TradingView strategy fires an alert — then nothing happens. Here is the complete guide to the ConnectXCopy TradingView integration: webhook setup, the full alert payload reference, multi-account fan-out, symbol mapping, duplicate protection, equity protection and the activity log. No VPS, no EA, no bridge software.

ConnectXCopyJuly 21, 202614 min read

You have spent weeks refining a Pine Script strategy. The backtest looks good, the alerts fire exactly when they should — and then they land in your inbox while you are asleep and the move happens without you. TradingView is superb at finding signals and, by design, does not place trades on your broker account for you.

This is the complete guide to closing that gap with the ConnectXCopy TradingView integration — from your first webhook through to multi-account fan-out, symbol mapping, duplicate protection and equity limits.

Why TradingView Alerts Stop at the Chart

TradingView is a charting and analysis platform, not a broker. When your strategy triggers, TradingView can email you, pop a notification, or send an HTTP webhook to a URL you nominate. That webhook is the escape hatch — but on its own it is just a JSON message arriving somewhere. Something has to receive it, authenticate it, decide which accounts it applies to, size the position, translate the symbol, place the order, and then remember enough to close that position when the exit alert arrives.

Traditionally traders solved this with a VPS running MetaTrader plus a bridge EA listening on a local port. That works until the VPS reboots, the EA detaches, MetaQuotes pushes an update, or the terminal silently logs out. ConnectXCopy replaces that entire stack with a hosted endpoint.

What You Get

Each signal source is one TradingView webhook. You point one or more alerts at it, then attach the broker accounts it should trade on. Everything below is included with your plan — there is no separate TradingView add-on to buy.

  • Up to 10 signal sources — Run separate strategies, separate risk profiles, or separate instruments side by side.
  • Multi-account fan-out — One alert can open the same position on several accounts at once, each with its own lot size.
  • Five broker platforms — MT5, MT4, cTrader, TradeLocker and DXtrade.
  • Per-target symbol mapping — Reconcile TradingView tickers with your broker's own symbol names.
  • Four alert types — Entry, exit, reverse and modify, including partial closes for scaling out.
  • Duplicate protection — Retries and double-deliveries collapse to a single execution.
  • Rate limiting and auto-pause — A runaway strategy cannot machine-gun your account.
  • Equity protection — Drawdown limits apply to accounts trading purely from alerts.
  • Full activity log — Every alert, its outcome, and the resulting broker ticket per account.

Setting It Up: Four Steps

  1. Create a signal source — In your dashboard, open TradingView and click New source. You get a unique webhook URL and a separate secret.
  2. Add your targets — Choose which connected accounts this source trades on, and set the lot size for each. A source with no targets accepts alerts but places no orders.
  3. Create the TradingView alert — In TradingView, open your strategy or indicator, create an alert, and under Notifications enable Webhook URL. Paste your source's URL there.
  4. Paste the message body — In the alert's Message box, paste the JSON payload described below.

The webhook URL looks like this, with your own source token on the end:

https://www.connectxcopy.com/api/tv/webhook/YOUR-SOURCE-TOKEN

Why there are two credentials

The URL identifies the source; the secret inside the message body authenticates it. Both are required. This means a leaked webhook URL on its own cannot be used to trade your account — an attacker would also need the secret, which never appears in the URL, in browser history, or in server access logs.

You can rotate the secret at any time from the Setup tab. The old secret stops working immediately, so update the message in every alert that uses the source.

The Alert Payload

The message body is JSON. TradingView placeholders such as {{ticker}} are substituted before the alert is sent. Note that TradingView validates this box as JSON: a placeholder works on its own ("{{ticker}}") but not joined to other text inside a string, and a message it will not parse is sent as plain text, which cannot be read.

Opening a position

{ "secret": "your-secret", "type": "entry", "symbol": "{{ticker}}", "side": "buy" }

Closing a position

An exit alert does not need a side — it closes whatever that source has open on that symbol:

{ "secret": "your-secret", "type": "exit", "symbol": "{{ticker}}" }

Closing part of a position

Add closePercent to scale out. This closes half and leaves the rest running:

{ "secret": "your-secret", "type": "exit", "symbol": "{{ticker}}", "closePercent": 50 }

The percent is of the currently open lot, not the original entry — the same rule TradingView's own strategy.close(qty_percent=...) follows. So two successive 50% exits leave you a quarter, not flat.

Two edges are worth knowing, because both protect you from a partial that cannot be placed. If the slice works out smaller than your broker's minimum lot, the alert is rejected with an error rather than quietly closing everything. And if closing your slice would leave a remainder below the minimum lot, the position is closed out in full instead — otherwise you would be left holding a fragment no later exit could close.

Flipping direction

A reverse alert closes the open position and opens the opposite one in a single message, which is what you want for an always-in-the-market strategy:

{ "secret": "your-secret", "type": "reverse", "symbol": "{{ticker}}", "side": "sell" }

Moving your stops

A modify alert updates the stop loss or take profit on an open position — the basis of a trailing-stop strategy driven from Pine Script:

{ "secret": "your-secret", "type": "modify", "symbol": "{{ticker}}", "sl": 2380.5 }

Full field reference

FieldRequiredWhat it does
secretYesAuthenticates the alert. Rotatable from the Setup tab.
typeYesOne of entry, exit, modify or reverse.
symbolYesThe instrument. Use {{ticker}} to have TradingView fill it in.
sideFor entry / reversebuy or sell. Not needed on an exit.
sl / tpNoStop loss and take profit prices. Not every platform accepts these on entry — see the table below.
closePercentNoPartial close, 1 to 100, taken of the currently open lot. Omit to close the whole position.
positionIdNoTies an exit to a specific entry. Omit it and ConnectXCopy matches on the symbol instead.
clientOrderIdNoSharpens duplicate detection. Worth sending only when a Pine script builds the message and can generate a unique value; duplicates are still caught without it.
orderTypeNoCurrently market only.
price, time, commentNoRecorded against the alert for your own audit trail.

Pro tip — Market orders only for now. A price in the payload is stored for reference; it does not become a limit order.

One Alert, Many Accounts

A source's targets decide where its alerts land. Each target is one of your connected broker accounts, and each carries its own settings — so a single TradingView strategy can drive very different accounts without touching your Pine Script.

  • Independent lot sizes — A 0.01 lot target and a 1.00 lot target can sit on the same source, fed by the same alert.
  • Mixed platforms — One alert can hit an MT5 account, a cTrader account and a TradeLocker account simultaneously.
  • Individually switchable — Disable a single target to take one account out of rotation while the others keep trading.
  • Per-account results — Every alert records its outcome for each target separately, so a failure on one account is visible and does not hide the others.

Position Sizing

Sizing is configured per target rather than in the alert, which keeps risk decisions in your dashboard instead of scattered through your strategy code.

  • Fixed lot — Every alert from this source opens the same lot size on this account. Predictable, and the right default when you are starting out.
  • A hard per-order cap — Each source can carry a maximum lot per order. If a target is configured larger than the cap, the order is clamped down to it. This is your backstop against a fat-fingered target setting.

Symbol Mapping

Your TradingView chart and your broker rarely agree on what an instrument is called. A Nasdaq future might be MNQU2026 on TradingView and #US100_U26 at your broker; gold might be XAUUSD on one account and GOLD on another.

Each target carries its own symbol map. The alert arrives with one ticker, and each target translates it independently before the order goes out — so the same alert can trade #US100_U26 on one account and a differently-named equivalent on another. Symbols with no mapping pass through unchanged, so you only need to map the ones that actually differ.

Supported Platforms

Capabilities differ because the underlying broker APIs differ. ConnectXCopy rejects an alert it cannot honour rather than half-executing it — so a stop-carrying alert sent to a platform that cannot set stops is refused outright, instead of quietly opening a naked position.

PlatformEntry & exitSL / TP on entryModify stops later
MetaTrader 5YesYesYes
MetaTrader 4YesYesYes
cTraderYesYesNo
TradeLockerYesYesNo
DXtradeYesNot yetNo

Match-Trader is not currently available as a TradingView execution target.

How Positions Are Tracked

For an exit to close the position its entry opened, the two alerts have to be tied together. ConnectXCopy does this in one of two ways:

  • By symbol, automatically — By default, an exit means "close whatever this source has open on this symbol". This is why an exit alert does not need to repeat the side, and why a reverse cleanly flips one position rather than leaving two.
  • By explicit ID — If your strategy tracks its own position identity, send positionId on both the entry and the exit. An explicit ID always wins over symbol matching, which is what you want when one source runs several concurrent positions on the same instrument.

Built-in Safety Rails

Automated execution fails in ways manual trading does not, so several guards run before an order is ever placed:

  • Duplicate protection — Alerts are de-duplicated on their content as well as their id. A genuine TradingView retry resends an identical payload and collapses to one execution, while two genuinely different alerts that happen to share an id both get through. You cannot be double-filled by a network retry.
  • Rate limiting — Each source has a per-minute alert ceiling. Bursts above it are rejected rather than queued.
  • Automatic pause — A source that keeps hammering the limit is paused outright and flagged with the reason. A broken strategy stops itself instead of grinding through your balance.
  • Manual pause and disable — Sources can be paused or disabled at will. Paused sources keep their configuration and history; nothing is lost by switching one off while you investigate.
  • Origin filtering — The webhook endpoint only accepts requests from TradingView's own alert servers at the network edge.

Equity Protection

An account trading purely from TradingView alerts runs no copier, so the normal copier drawdown checks never see it. ConnectXCopy runs a dedicated monitor for exactly this case: it polls such accounts roughly every 45 seconds and, when the account's equity protector is breached, closes its open TradingView positions by ticket.

To use it, enable the equity protector on the account with Close All Trades turned on. The same drawdown thresholds you already use for copy trading then apply to alert-driven trading too.

The Activity Log

Every alert that reaches your source is recorded — including the ones that did not execute, which are usually the ones you actually want to see. Each entry carries the raw payload it arrived with, so you can compare what TradingView sent against what you thought you configured.

StatusWhat it means
EXECUTEDPlaced successfully on every target.
PARTIALSome targets filled and some did not — check the per-account results.
FAILEDNo target executed. The reason is recorded.
REJECTEDRefused before execution — bad secret, malformed payload, unsupported platform or rate limit.
DUPLICATERecognised as a repeat of an alert already processed, and discarded.
ACCEPTEDReceived and queued, execution still in flight.

Combining Alerts With Copy Trading

This is where the two halves of ConnectXCopy meet. The account your TradingView alerts trade on can itself be the master account of a copier — so a Pine Script signal opens a position on your main account, and that position is then mirrored out to every other account you have connected, at any broker, on any of the six supported broker platforms.

One strategy on a chart, one execution, many accounts, one dashboard — without a VPS anywhere in the chain.

Five Mistakes Worth Avoiding

These are the issues that actually come up, drawn from live setups:

  • Duplicate alerts from TradingView — TradingView will happily fire two alerts for one signal if your strategy is configured to. Content-based de-duplication catches identical retries, but two genuinely distinct alerts are both honoured by design — so a strategy that emits two entries really will open two positions. Check how many alerts yours emits per bar before going live.
  • Alerts that fire on every bar — An alert set on Once Per Bar against a condition that stays true will keep re-entering. Use Once Per Bar Close, or gate the condition on a crossover rather than a state.
  • Symbol names that do not match — Especially for futures and indices. Set an explicit mapping on the target rather than assuming the names line up.
  • Expecting stops you never sent — ConnectXCopy attaches a stop loss or take profit only when your alert includes sl or tp. If your strategy draws stop levels on the chart, those levels live in Pine Script until you put them in the payload.
  • Forgetting to update alerts after rotating the secret — Rotation is instant. Every alert still carrying the old secret will be rejected until you paste the new one in.

Testing Before You Go Live

Point your first source at a demo account and fire a manual alert from TradingView. The Activity tab shows every alert that arrived, whether it executed, and the resulting broker ticket per account.

Confirm both halves of the round trip — an entry that fills, and an exit that actually closes it, leaving the account flat — before you attach anything live. An entry working tells you very little on its own; it is the exit that proves the position was tracked correctly.

Crypto symbols are useful here, since they trade at weekends when the FX market is shut.

Getting Started

The TradingView integration is included with every ConnectXCopy plan, with up to 10 signal sources. If you already have an account, open TradingView in your dashboard and create your first source — setup takes a couple of minutes. If you do not, every plan starts with a free trial.

Tags
tradingview alertstradingview automated tradingtradingview webhooktradingview to mt5tradingview to mt4pine script automationtradingview alerts to brokerautomate tradingview strategy

Related Articles

Ready to Start Copy Trading?

Copy trades across MT4, MT5, cTrader, Match-Trader, DXtrade, and TradeLocker in real-time — and trade your TradingView alerts automatically. Start your free trial today.

Start Free Trial