A TradingView webhook is an HTTP POST request sent to a URL you choose, and anyone who learns that URL may be able to send your bot orders. Securing it comes down to five habits: keep secrets out of the alert message, make sure the receiver can tell your alerts from anyone else’s, limit what a stray or repeated alert can do, restrict what the connected exchange keys can do, and test the whole chain before real money flows through it.
This guide walks through each habit in the order a request travels: from the alert, across the network, into the receiver, and out to your exchange.
TL;DR
- Never put passwords, login credentials or exchange API secrets in the webhook URL or message. TradingView says this directly, and so do we.
- Turn on two-factor authentication, and treat whatever identifies your account as a secret: the token in your own receiver’s URL or message, or the pointer in a Tickerly alert.
- If you run your own receiver, serve it over HTTPS, allowlist TradingView’s published IPs, validate every payload, rate limit, and make processing idempotent.
- On Tickerly, the alert carries no credentials and Tickerly does not deduplicate, so send exits with
prev_position(a repeated exit can only flatten a position) and keep one alert per strategy and connection. - Give exchange API keys trade-only permission, with withdrawals disabled, and size positions so one bad signal cannot hurt much.
- Test with a testnet or tiny size, and check the Webhook status column in the alert log.
Table of Contents
- How a TradingView webhook actually works
- What can go wrong
- Step 1: Keep secrets out of the alert
- Step 2: Lock down your TradingView account and alert settings
- Step 3: Make the transport and the receiver trustworthy
- Step 4: Limit what a compromised signal can do
- Step 5: Test and monitor before you trust it
- Our perspective: what we have learned about webhook security
- Put these habits into practice with Tickerly
- A short pre-launch security checklist
- FAQ
- Sources
How a TradingView webhook actually works
When a webhook alert fires, TradingView sends an HTTP POST to the URL configured on that alert, with your alert message in the body. That is the whole mechanism. There is no login, no handshake with your bot and no built-in signature on the message. Whatever authentication exists has to be built into the URL, the message or the receiving service.
That design explains most of the risk. The receiver sees a request and has to decide whether it really came from your alert and whether acting on it is safe. If the receiver says yes to anything that looks right, then anyone who finds the URL and the message format can place trades on your behalf.
TradingView also states that its alerts are not designed for automated trading. That is a useful framing: TradingView is the signal source, and the security of the order path is your responsibility, or your automation provider’s.
If you want the full path from alert to live order, see our guide to TradingView strategy automation.

What can go wrong
The realistic threats for a trader are less exotic than they sound:
- Leaked credentials in the message. Someone pastes an API secret or password into the alert body. Alerts get screenshotted, shared in Discord, or visible to anyone with access to your account or a shared layout.
- A guessable or exposed receiver URL. If the endpoint accepts any POST, a stranger who finds it can send “buy” or “close all”.
- Replayed or duplicated requests. Networks retry. A forged or repeated callback can trigger the same order twice.
- Malformed input. A receiver that trusts the payload blindly can be fed oversized, malicious or unexpected fields.
- Over-privileged exchange keys. If a key can withdraw funds, any compromise of your automation stack becomes a theft rather than a bad trade.
- Silent failure. A webhook that never arrives is a security problem too: a stop-loss or close signal that goes missing leaves a position open.
Webhooks are also attractive to attackers generally. CISA describes how adversaries use webhooks for automated data exfiltration, linking victim services to attacker-controlled endpoints or posting staged data directly. The lesson for traders: never point an alert at a URL you do not control or fully trust, and never put anything in the message you would not want a third party to read.
Step 1: Keep secrets out of the alert
TradingView’s guidance is explicit: do not include sensitive information such as login credentials or passwords in the webhook URL or the webhook message, because transmitting it can expose it to unauthorized parties. It recommends secure, authenticated endpoints.
In practice that means:
- No exchange API secret in the message. Your alert should carry intent (symbol, side, size or a strategy identifier), not the means to execute it. The secret belongs on the receiving platform, stored once, server-side.
- No account passwords, ever.
- A random identifier is not a password, but it is better than nothing. If your receiver uses a token in the URL or message to identify you, generate it randomly, keep it long, and rotate it if you ever paste it somewhere public.
- Check what you share. Screenshots of the alert dialog, public Pine Script publications and shared chart layouts can all expose a URL or token.
This is the core design choice behind a managed bridge: you store exchange keys in one authenticated place, and your TradingView alert carries only a trigger. Our walkthrough on how to secure trading accounts covers the account side in more depth.
Step 2: Lock down your TradingView account and alert settings
TradingView requires two-factor authentication to use webhooks. Its webhook configuration page lists the other documented constraints worth knowing before you build:
| Requirement or limit | What it means for you |
|---|---|
| 2FA required | Webhooks will not work without it, and it protects the account that owns your alerts |
| Ports 80 and 443 only | Requests to other ports are rejected, so you cannot hide a receiver on an unusual port |
| No IPv6 | Your receiver must be reachable over IPv4 |
| Three-second cutoff | Requests taking longer than three seconds are cancelled, so respond fast and process after |
| Occasional delivery failures | Do not assume every alert arrives; check the alert log |
| JSON vs text | Valid JSON is sent as application/json, anything else as text/plain |
Two habits follow from this. First, use an authenticator app rather than SMS for 2FA where you can, and keep your backup codes offline. Reddit threads show traders hitting 2FA errors even with it enabled and fixing them by logging out and back in, so set this up well before you need a live alert. Second, match the message format to what the receiver expects: if your receiver parses JSON, make sure the message is valid JSON, or it will arrive as plain text.
Step 3: Make the transport and the receiver trustworthy
Most of this step applies when you run your own receiver. With a managed bridge, the transport and the receiver are the provider’s side, and the questions become what the alert carries and what it can do if someone else sees it.
Use HTTPS on your own receiver
OWASP’s webhook guidance recommends HTTPS for every webhook endpoint, rejecting plain HTTP, and using TLS 1.2 or higher with a certificate from a trusted certificate authority. OWASP also notes that signatures prove origin and body integrity but do not encrypt the payload, so TLS is still needed even when you sign messages.
HTTPS protects what travels in the request, which matters most when the URL or message carries something worth stealing. Tickerly takes a different route: its endpoint, http://alerts.tickerly.net, is plain HTTP by design, because the alert carries no credentials, only the ticker, the order and your private pointer. Your API keys stay in your Tickerly connection, need no withdrawal permission, and can be whitelisted to the single IP Tickerly trades from, 217.160.238.76. Two-factor authentication on TradingView protects the account that holds the alerts.
Verify who is calling
There are two layers you can use if you run your own receiver.
Certificate identity. TradingView says its webhook server sends an SSL certificate with HTTPS requests, and that certificate verification must be configured by the recipient application. It identifies the certificate as belonging to TradingView, Inc., with the Common Name and Subject Alternative Name webhook-server@tradingview.com.
IP allowlisting. TradingView publishes the addresses it sends webhooks from. At the time of writing, its page lists four: 52.89.214.238, 34.212.75.30, 54.218.53.128 and 52.32.178.7, in case they need to be allowlisted. Put a reverse proxy or firewall rule in front of your receiver that drops everything else. Check that page periodically, because the list can change.
An allowlist is a strong filter, but not a full defense. Anyone using TradingView can trigger a request from those same addresses, so an attacker could in theory point their own alert at your URL. That is why the next layer matters.

Authenticate the message itself
Add a long random token that your receiver checks before doing anything. Compare it in constant time, reject on mismatch, and return a generic response so you do not teach an attacker what failed. Because TradingView cannot sign the message for you, this shared token is the practical equivalent. It is not a password to your exchange, so a leak is recoverable: rotate it and update the alert. On Tickerly, the private pointer in the alert is what ties a message to your connection, so give it the same care.
Validate, de-duplicate and rate limit
OWASP’s guidance for callbacks stresses that authenticity alone is not enough. The receiver should verify state server-side, match identifiers and expected values, use idempotency and log every attempt, because callbacks can be forged, repeated, delayed or reordered. For a trading receiver, that translates to:
- Strict schema validation. Accept only the fields and values you expect: a known symbol list, a side of buy or sell, a size within a ceiling. OWASP’s serverless guidance recommends authenticating every trigger and strongly validating event data against injection-style attacks.
- Idempotency. Give each signal a unique ID or time bucket so a repeated request cannot open a second position.
- State checks. Before a “close” order, confirm a position exists. Before a “buy”, confirm you are not already at your maximum exposure.
- Rate limits. OWASP recommends layered quotas, preferably token-bucket or sliding-window, with generic 429 responses, and more than one limiting dimension rather than IP address alone. A strategy that suddenly fires 200 alerts in a minute should hit a wall.
- Logging. Record every attempt, accepted or rejected, with a timestamp. You will want it the first time something looks off.
- Respond quickly. With the three-second cutoff, acknowledge the request fast and do the heavy work asynchronously.
If building and maintaining all of this sounds like a second job, that is the point of using a managed platform instead of a home-built Flask endpoint, a pattern you will see suggested in forum threads. A DIY script works, but every item above becomes your code to write, patch and monitor. A managed platform won’t mirror every item, though, so check how it handles each concern. On Tickerly:
- The alert follows Tickerly’s own JSON format. Tickerly reads the fields it defines (ticker, action, previous position, quantity and pointer, plus a few more for special alert types) and ignores any field it does not know.
- Closing orders are sent reduce-only through
prev_position, so a stray or repeated exit can only flatten a position, never open one in the other direction. - Tickerly does not deduplicate alerts. Stop repeats at the source: one alert per strategy and connection, using the strategy’s own order-fill alerts.
- Size and exposure limits live in your strategy, which sends the quantity Tickerly executes.
- The alert log records each alert and the exchange’s response, accepted or rejected.
Step 4: Limit what a compromised signal can do
Assume that one day a signal will be wrong, duplicated or forged. Design so that the worst case is small.
- Trade-only API keys. Create exchange keys with permission to read and trade, and nothing else. Disable withdrawals. If your exchange offers IP restrictions on keys, bind the key to the IPs of your automation provider.
- A dedicated sub-account. Fund it only with what the strategy needs. Your main holdings stay out of reach.
- Position caps. Cap position size in the strategy, set leverage on the exchange account, and keep the sub-account balance small so the exchange itself limits what any order can do. If you run your own receiver, add a size ceiling there too; Tickerly sends the size your strategy calculates and has no position cap of its own.
- Stop-loss on the exchange. Where possible, let a protective order sit on the exchange so it survives a missed webhook.
- Separate keys per strategy or venue. Revoking one key should not stop everything.
- Rotate on suspicion. If a URL, token or key may have been exposed, revoke and replace it first and investigate second.
Venue-specific setup matters here, because each exchange has its own permission model. We cover the details in our guides for connecting TradingView to Binance with testnet validation, Bybit with a safety checklist and KuCoin. For forex and CFD brokers, see the MT4 and MT5 guides.
Step 5: Test and monitor before you trust it
Security is not only keeping attackers out. It is knowing that your own alerts did what you intended.
- Test on a testnet or demo account first. Send every message type you plan to use: entry, exit, reduce, reverse.
- Then go live at the smallest size the exchange allows. Real fills, fees and slippage differ from a sandbox.
- Check delivery status. TradingView shows a Webhook status column in the alert log, and notes that delivery may occasionally fail. Look at it after your first alerts and periodically afterwards.
- Compare three records. The TradingView alert log, your receiver’s log and the exchange order history should agree. A green delivery status does not prove an order was placed, so confirm the last link too.
- Test failure. On your own receiver, send a request with a wrong token, a malformed body and a duplicate, and confirm each is rejected or ignored and logged. On Tickerly, which does not deduplicate, test the exit side instead: on a demo connection, send the same exit twice and confirm the second cannot open a position in the opposite direction.
- Watch alert limits. An alert that silently stops because you ran out of slots is a failure mode of its own. Our note on getting more usable TradingView alerts explains how to plan for it.
On Tickerly you can see every incoming signal and its outcome in the alert log, and you can verify your setup with a manual test alert from Tickerly or a demo connection (any connection with “test” in its name routes to the exchange’s demo account, where the exchange has one) before any live order.
Our perspective: what we have learned about webhook security
We built Tickerly because most traders should not have to run their own server just to turn a Pine Script alert into an order. Our view comes from that design choice.
First, the safest secret is the one that never travels. In our setup your exchange API keys are stored on the platform, and the TradingView alert carries only a structured instruction. That keeps credentials out of alert messages, screenshots and shared layouts, which is where we think most real-world leaks begin. Our alert message structure and advanced alert messages are built around that idea.
Second, speed and safety are not opposites. We place each order within a fraction of a second of the alert, and we do not think you should trade safety for it. Fast execution matters because fleeting opportunities close quickly, but a fast order from a forged or duplicated signal is just a fast loss. So the safeguards sit where they hold up: credentials stay out of the alert, keys cannot withdraw and can be locked to our IP, closing orders go out reduce-only, and repeats are stopped at the source with one alert per strategy.
Third, you should not need a VPS or code to get a secure setup on a direct exchange connection. Every extra machine you maintain is another thing to patch and another port to expose. A no-code setup with trade-only keys, a dedicated sub-account and a testnet run first gets most traders further than a clever self-built script.
Finally, test as if it were production. Most disasters we hear about are not hackers, they are untested alerts, wrong sizes or a missed close signal. Treat your first week of automation as a security exercise.
— Jay
Put these habits into practice with Tickerly
If you would rather not build and maintain your own receiver, Tickerly connects your TradingView alerts to your exchange or broker account with no coding, and no VPS for direct connections (MetaTrader 4 and 5 run through the Tickerly TV Connector inside your own terminal, which has to stay running). You can run multiple strategies at once, start with a 30-day free trial, and choose a plan that fits your asset classes and alert needs: Level 2 is 19 USD per month, Level 3 is 29 USD per month, Level 4, which adds MetaTrader 4 and 5, is 39 USD per month, and Level 4 Ultra raises the limit to 2,500 alerts a day. Details are on the automated trading plans page.
New to the workflow? Start with the set-alerts guide or our overview of TradingView alerts for trading bots, and then connect your exchange from the supported exchanges list.
A short pre-launch security checklist
- 2FA is on for your TradingView account.
- No password, login or API secret appears in any alert URL or message.
- The webhook URL points at a service you control or trust: your own receiver served over HTTPS, or a managed bridge whose alert carries no credentials, such as Tickerly’s
http://alerts.tickerly.net. - The message includes a private identifier the receiver checks (your own random token, or your Tickerly pointer), and it never appears in screenshots or shared layouts.
- If self-hosted: TradingView’s IPs are allowlisted, input is validated, requests are rate limited and processing is idempotent.
- On Tickerly: one alert per strategy and connection, and exits sent with
prev_position, so a repeated exit can only flatten a position. - Exchange keys are trade-only, with withdrawals disabled and IP restrictions where available.
- The strategy runs on a dedicated sub-account with capped size and leverage.
- You tested on a testnet, then at minimum size, and compared all three logs.
- You know how to revoke every key and token in under five minutes.
FAQ
Is a TradingView webhook secure by default?
Not on its own. TradingView sends an HTTP POST with your message to the URL you set, and it requires 2FA on the account, but it does not sign the message for you. Security depends on keeping secrets out of the message, a receiver that can tell your alerts from anyone else’s, and exchange keys that cannot withdraw. On your own receiver that means HTTPS and a checked token; on Tickerly, the alert carries no credentials, only a private pointer, and orders reach the exchange from one IP you can whitelist.
Should I put my exchange API key in the alert message?
No. TradingView advises against including credentials or passwords in the webhook URL or body, because the data can be exposed to unauthorized parties. Store the key on the receiving platform and let the alert carry only the trade instruction.
Can I restrict webhooks to TradingView’s IP addresses?
Yes, if you run your own receiver. TradingView lists the IPs it sends from so you can allowlist them at a firewall or reverse proxy. Because other TradingView users share those addresses, also require a secret token in the message and validate the payload.
Why did my webhook alert not trigger an order?
Common causes are a missing 2FA setup, a receiver that took longer than three seconds to respond, a message that is not valid JSON when the receiver expects it, or an occasional delivery failure. Check the Webhook status column in the TradingView alert log first, then your receiver’s log and the exchange order history.
What API permissions should a trading bot key have?
Read and trade permissions only, with withdrawals disabled. Where the exchange allows it, restrict the key to your automation provider’s IP addresses and use a dedicated sub-account holding only the capital the strategy needs.
Sources
- How to configure webhook alerts, TradingView
- Using credentials for webhooks, TradingView
- Webhook authentication, TradingView
- Webhook Security Cheat Sheet, OWASP
- Third Party Payment Gateway Integration Cheat Sheet, OWASP
- Serverless FaaS Security Cheat Sheet, OWASP
- Bot Management and Anti-Automation Cheat Sheet, OWASP
- Exfiltration Over Webhook, CISA
- 2FA error with webhooks, r/TradingView
- TradingView alerts to trigger buy/sell actions, r/TradingView
Recommended
- Build a Secure TradingView to Bybit Bridge with a Safety Checklist
- Securely Connect TradingView to Binance with Testnet Validation
- How to Build a Step-by-Step Trading Bot on TradingView
- How to Build a Step-by-Step Trading Bot on TradingView with Tickerly: A Complete Guide
This article was produced with Al assistance and reviewed for accuracy. It is provided for general information only and is not professional or financial advice.

