Skip to content

Trading9 min read

How to automate TradingView alerts on Hyperliquid with webhooks

Step by step: turn a TradingView alert into an order on your own Hyperliquid account with a webhook, a trade-only key, your own limits and a dry run first.

, Founder of Hypr Markets

Published

On this page

A TradingView webhook for Hyperliquid is a URL that receives your alert message and turns it into an order on your own Hyperliquid account. On a Hypr Markets terminal with Webhooks for TradingView switched on, setup takes 4 steps: approve a trade-only key named hypr-tv, create a webhook, generate the alert message, and paste the URL and the message into a TradingView alert. TradingView sends each alert from its own servers, so nothing has to run on your computer.

This guide is for traders who already chart on TradingView and want their alerts to trade on Hyperliquid without writing or hosting any code. It walks through each step in the order you do it, then covers how to test a webhook before it trades, what happens when an alert fires, and how to stop everything in one step. Nothing here is financial advice, and an automated alert can lose money as fast as one you place by hand.

What do you need before you start?

Webhooks for TradingView needs three things: a TradingView account with webhook notifications and two-factor authentication, a terminal whose operator has switched the feature on, and a wallet connected to that terminal with USDC on your Hyperliquid account. TradingView's webhook help page states that "webhook alerts are only allowed when 2-factor authentication is enabled". Its plan comparison lists webhook notifications, so check that your plan includes them.

On the terminal side, look for "TradingView webhooks" in the account menu. If the page says the feature is not switched on for the site, the operator has not turned it on yet, and your trading on the terminal is not affected. Operators switch it on in their console; it is on every plan, Free included. The Webhooks for TradingView page explains the operator side.

You do not need a server, a script, a Hyperliquid API wallet you made yourself, or any code. Everything happens on the terminal's TradingView page and in TradingView's own alert dialog.

Step 1: approve the TradingView key

The TradingView key is a Hyperliquid API wallet (also called an agent) that the terminal creates for your webhooks and that you approve once with your wallet. It is named hypr-tv, it is valid for up to 180 days, and it can place and cancel orders and set leverage. It can never withdraw, send or move money. Hyperliquid's docs on nonces and API wallets describe how a main wallet approves an API wallet to trade on its behalf.

  1. Open the TradingView page in the terminal's account menu.
  2. Press "Approve in my wallet". Your wallet shows a request called Approve agent; check the name starts with hypr-tv, then sign.
  3. If you have not approved the terminal's trading fee yet, your wallet asks for that next. Orders from webhooks carry the fee (the builder fee), so they are refused until it is approved.

Hyperliquid limits how many API wallets one account holds. If every slot is in use, the page lists your keys and lets you pick one you no longer use; the TradingView key takes its place in the same signature. The TradingView key never replaces the key of a MetaTrader 5 setup on the same terminal.

Step 2: create a webhook and copy its URL

A webhook is one URL with its own limits and its own log, so one webhook per strategy or per group of alerts is easiest to follow. Press "Create webhook", give it a name such as "BTC trend strategy", and optionally set a passphrase of at least 8 characters that every message must then carry.

The URL appears once. Copy it straight away: for your safety only a fingerprint of it is stored, so it cannot be shown again. If you lose it, press "New URL", and the old one stops working at once.

Each webhook starts with these limits, which you can lower or raise up to the terminal's own:

LimitStarting value
Largest single order$100, or the terminal's limit if lower
Total per day$1,000, or the terminal's limit if lower
Orders per minute5
Highest slippage on market orders50 bps
Accept only TradingView's serversOn
Ignore identical alerts within10 seconds
Refuse alerts older than60 seconds

The "TradingView's servers" switch accepts alerts only from the four IP addresses TradingView publishes on its webhook page. Leave it on.

Step 3: generate the alert message

An alert message is a short JSON object that says what the alert should do. The generator on the TradingView page writes it for you: choose the alert type, the action, the size, and optionally a stop-loss, a take-profit and leverage. A message for a market buy of $100 with a 2% stop and a 4% target looks like this:

{
  "id": "{{ticker}}-{{interval}}-{{timenow}}",
  "ts": "{{timenow}}",
  "action": "buy",
  "symbol": "{{ticker}}",
  "size_usd": 100,
  "sl_pct": 2,
  "tp_pct": 4
}

TradingView replaces the parts in double braces before it sends the alert: {{ticker}} becomes the chart's ticker, such as BTCUSDT.P, and the terminal maps it to Hyperliquid's BTC market. The generator offers three templates: an indicator or price alert with a fixed action, a strategy that follows each order, and a strategy that matches the position. The alert message reference lists every field and action, and the free alert message generator lets you build and check messages before you have a webhook.

Step 4: create the alert in TradingView

TradingView's alert dialog is where the webhook and the message meet. On your chart, open the alert dialog and pick the condition: a price level, an indicator crossing, an alert() call in your script, or your strategy's order fills.

  1. Paste the generated message into the Message box. Delete anything that was there.
  2. Open Notifications, tick Webhook URL and paste the URL from step 2.
  3. Create the alert.

From now on, each time the condition is met, TradingView sends the message to your webhook. If TradingView's server does not get an answer within three seconds it cancels the request; the terminal answers as soon as the alert is accepted and places the order after that, so the order itself is never rushed to meet that limit.

How do you test a webhook before it trades?

The Test button runs a dry run: it reads the message, fills in TradingView's placeholders with sample values, maps the ticker, works out the size against the live price and checks it against the webhook's limits and the terminal's limits. It shows each step it would take, such as a leverage change, the order and the stop and target, and whether each would be allowed or refused. Nothing is signed or sent.

Run it every time you change a message. Then, for the first live alerts, keep the webhook's limits small, watch the alert log, and only raise the limits once fills look the way you expected. If the page shows Test mode at the top, alerts are checked and recorded with a test badge but no order is sent yet.

What happens when the alert fires?

When TradingView sends an alert, the terminal checks it in a fixed order before anything is signed:

  1. The request comes from one of TradingView's addresses, if the webhook requires it.
  2. The webhook is active and the passphrase matches, if it has one.
  3. The alert is not older than the webhook's maximum age and is not a repeat of an alert already seen.
  4. The ticker maps to a Hyperliquid market the webhook and the terminal allow.
  5. The order fits the per-order, daily and per-minute limits. An order above a limit is refused, never shrunk.

Then each step passes the policy signer, which checks the terminal's limits again and writes a signed receipt before it signs with the hypr-tv key. Hyperliquid matches and settles the order on your account. An alert that cannot be executed within 20 seconds of arriving is marked failed and never retried later, because a late trading signal is a bad one.

The alert log shows every alert with a status: Done, Partly done, Refused, Failed, Nothing to do or Tested, with each step and the reason for any refusal. TradingView also keeps its own alert log with a delivery status for each webhook, which is the place to look when an alert never appears.

How do you stop or change a webhook?

A webhook can be paused, given a new URL, deleted, or revoked together with the TradingView key, and each of these controls takes effect at once from the terminal's TradingView page. None of them needs a change in TradingView: an alert that arrives afterwards is simply refused, and the alert log records why.

  • Pause a webhook: its alerts are refused until you resume it.
  • New URL: the old URL stops working; update it in every TradingView alert that used it.
  • Delete a webhook: its URL stops working and its log is kept.
  • Stop everything: revoke the TradingView key and delete every webhook in one step.

None of these closes your positions or cancels your open orders, because some of them may be your stops. Close or cancel them in the terminal as usual. The terminal's panic button in Agent Safety halts every key you have approved there, and the operator can pause any webhook on the site.

Frequently asked questions

Can a TradingView webhook withdraw my funds?

No. The hypr-tv key can place and cancel orders and set leverage. Hyperliquid does not let an API wallet withdraw, and the terminal's policy signer never lets it transfer or approve anything. Someone who learns a webhook URL can only send alerts inside that webhook's limits, which is why a passphrase and the TradingView-only switch are worth keeping on.

Do I need a server or a relay script?

No. The terminal runs the receiver, the key and the receipts. You create the webhook and the message in the terminal and paste them into a TradingView alert. There is no code to host and no key to copy into a file.

Why was my alert refused?

The alert log gives the reason. Common ones are a message field the receiver does not know, a size above the webhook's per-order limit, a ticker with no Hyperliquid market, a missing passphrase, or an alert older than the webhook's maximum age. Fix the message, run Test, and the next alert uses the change.

Which markets can a webhook trade?

The main Hyperliquid perpetuals that the terminal and the webhook allow. HIP-3 markets such as stock perps and spot markets are not offered to webhooks yet. An opening order must be worth at least $10, the same minimum Hyperliquid sets.

What does a webhook order cost?

The same as any order on the terminal: Hyperliquid's own trading fee plus the terminal's trading fee, which is at most 0.1% per fill on perps. The fee calculator shows a round trip with both, and funding applies while a position is open.

All articles