Automate your own Pine Script on MT5.

Everything you need to self-administer the DarkSignum relay: credentials, the EA, the code snippet, and the TradingView alert. Fifteen minutes, no support ticket.

How it works

TradingView alert
your script + snippet
→DarkSignum relay
your webhook URL
→MT5 relay EA
polls every second
→Your broker
order executed

Your Pine Script fires an alert() carrying a small JSON message. TradingView POSTs it to your private webhook URL, the relay fans it out to every connected MT5 terminal, and the EA executes the order — usually within a second or two of the bar closing.

What you need

  • Starter subscription — unlocks the EA download, your webhook URL, and license keys. Choose Starter →
  • TradingView Essential or higher — webhook alerts are a paid TradingView feature. The free TradingView plan cannot send webhooks; no tool can change that.
  • MetaTrader 5 running while you trade — a Windows VPS or an always-on machine. The EA polls the relay once per second; if MT5 is closed, signals wait (and expire after 60 seconds by default).

Your credentials

There are two separate credentials, and they live on opposite ends of the pipeline. Mixing them up is the #1 setup mistake.

CredentialLooks likeGoes in
Webhook URL + passcode…/api/relay/webhook/ds_whk_…The TradingView alert (URL) and the Pine snippet (passcode)
License keyds_live_…The EA input in MT5 — one key per MT5 terminal/account

Both are in your dashboard with copy buttons. Keep them private — anyone with both can trade your account.

Install the EA

  1. In your dashboard, download darksignum-relay.ex5 and create a license key for the MT5 terminal you're setting up.
  2. In MT5: File → Open Data Folder, then navigate to MQL5 → Experts and paste the file there.
  3. Restart MT5 (or right-click → Refresh in the Navigator), then drag darksignum-relay onto any chart.
  4. In the EA inputs: leave Hosted Mode on, paste your license key (ds_live_…), and leave the relay URL as https://relay.darksignum.com.
  5. Under Tools → Options → Expert Advisors: enable algo trading, allow DLL imports, and add https://relay.darksignum.com to the WebRequest allowlist.
  6. Turn on the Algo Trading button in the toolbar. The EA logs its connection status in the Experts tab — you should see it polling within a second.

One EA instance per MT5 terminal covers every symbol — the alert's symbol field decides what gets traded. Lot size comes from the alert by default (Lot Type: from TradingView); the EA inputs also support fixed lots, multipliers, max-lot caps, spread filters, and symbol mapping for brokers with non-standard names.

Add the relay snippet to your script

Paste this directly below your strategy() or indicator() line — it works in both. Set your passcode in the script's settings panel afterward.

relay-snippet.pine
// ── DarkSignum relay ──
relayPasscode = input.string("REPLACE_WITH_PASSCODE", "Relay Passcode", inline="Relay")
relaySymbol   = input.string("", "Relay Symbol (blank = chart symbol)", inline="Relay")
relayLot      = input.float(0.01, "Relay Lot Size", inline="Relay")
relayLabel    = input.string("", "Signal Label (dashboard)", inline="Relay")
relayMsg(action, slPrice, tpPrice) =>
    '{"passcode":"' + relayPasscode + '","action":"' + action + '","symbol":"' + (relaySymbol == "" ? syminfo.ticker : relaySymbol) + '","price":0,"lot":' + str.tostring(relayLot) + ',"sl":' + str.tostring(slPrice, format.mintick) + ',"tp":' + str.tostring(tpPrice, format.mintick) + ',"label":"' + relayLabel + '"}'

// Wire your own signals to the relay (works in indicators AND strategies).
// Replace the example conditions with your script's signal booleans:
// if myLongCondition
//     alert(relayMsg("buy", 0, 0), alert.freq_once_per_bar_close)
// if myShortCondition
//     alert(relayMsg("sell", 0, 0), alert.freq_once_per_bar_close)
// if myCloseLongCondition
//     alert(relayMsg("closelong", 0, 0), alert.freq_once_per_bar_close)
// if myCloseShortCondition
//     alert(relayMsg("closeshort", 0, 0), alert.freq_once_per_bar_close)
//
// sl/tp are prices — pass 0 for none and manage exits with close alerts.
// With a stop/target: alert(relayMsg("buy", myStopPrice, myTargetPrice), ...)
// Set Signal Label to name this strategy — your dashboard breaks performance down by label.
  • Replace the example conditions (myLongCondition etc.) with your script's own signal booleans, and uncomment the lines.
  • Actions: buy, sell, closelong, closeshort. Cover every exit path your logic has — the relay only knows what you tell it.
  • sl/tp are absolute prices. Pass 0 for none and manage exits with close alerts — or compute prices (ATR-based, fixed ticks, whatever your strategy uses) and pass them in.
  • Leave Relay Symbol blank to trade whatever chart the script is attached to. Set it only when your broker's symbol differs from the TradingView ticker (e.g. GOLD vs XAUUSD) — or use the EA's symbol mapping instead.
  • Prefer not to hand-wire anything? The EA-ify converter does this automatically and verifies the result against TradingView's compiler.

Create the TradingView alert

  1. Add your script to the chart and confirm your passcode is set in the script inputs.
  2. Click the Alert button (clock icon) in the right panel.
  3. Under Condition, select your script, then choose "alert() function calls only" — the snippet's JSON is sent automatically; leave the message box as-is.
  4. Under Notifications, enable Webhook URL and paste your webhook URL from the dashboard (…/api/relay/webhook/ds_whk_…).
  5. Create the alert. One alert covers all four actions — buy, sell, and both closes.

Every received alert appears in your dashboard's event log within seconds, so you can watch the first one land end-to-end.

Message format reference

The snippet builds this for you — documented here for custom integrations (Telegram parsers, other charting tools, your own code):

example payload
{"passcode":"YOUR_PASSCODE","action":"buy","symbol":"XAUUSD","price":0,"lot":0.01,"sl":0,"tp":0}
FieldValuesNotes
passcodestring, requiredMust match your dashboard passcode exactly — mismatches are rejected and logged
actionbuy · sell · closelong · closeshortClose actions only touch trades this EA opened (by default)
symbolbroker symbolMapped via EA symbol mapping if your broker uses a different name
pricenumber0 = market order
lotnumberUsed when the EA's Lot Type is "from TradingView"
sl / tpprice0 = no stop/target — manage exits with close alerts

Troubleshooting

SymptomLikely cause → fix
Alert fired, nothing in the dashboard event logTradingView plan below Essential (no webhooks), or the alert isn't set to "alert() function calls only"
Event log shows alert_rejected — bad passcodePasscode in the script inputs doesn't match the dashboard — re-copy it
Event log shows alert_dropped — no active licensesCreate a license key in the dashboard and put it in the EA
alert_received but MT5 does nothingEA offline or misconfigured — check the Experts tab log, the WebRequest allowlist, and that Algo Trading is on
EA receives the order but the trade failsSymbol mismatch — set the snippet's Relay Symbol input or the EA's symbol mapping to your broker's exact symbol name
Signals arrive late or get skippedMT5 was offline — signals expire after 60s (adjustable in the EA inputs)

Still stuck? hello@darksignum.com — include your tenant slug and a timestamp of a failing alert.