TradingView Webhook Bot: Send Alerts Straight to Your Exchange
You've built an alert on TradingView that fires exactly when you'd want to enter a trade. The problem: an alert is just a notification. By the time you see it and place the order, the price has moved — or you were asleep and missed it entirely.
A TradingView webhook bot closes that gap. Instead of notifying you, the alert notifies a webhook URL — a private web address that belongs to your bot. Freya's signal bot listens at that address, and the moment your alert fires, it places the trade on your exchange automatically. Your chart logic stays on TradingView; Freya handles the execution.
This guide covers the concepts, the step-by-step setup, and the reliability, security, and troubleshooting knowledge that keeps the connection working when it matters.
Key Takeaways
- A TradingView alert with a webhook sends an automatic message to a URL the instant your chart condition triggers — Freya's signal bot turns that message into a real trade on your exchange.
- In Custom Signal mode your bot has an Open Webhook URL and a separate Close Webhook URL; in Risk Ratio mode it has a single webhook URL and the alert message carries your take-profit and stop-loss.
- Webhook notifications are not included in every TradingView plan — confirm your plan supports them before building your setup around alerts.
- Your webhook URLs are secrets: anyone who has one can trigger that action on your bot, so never share them and regenerate immediately if one is exposed.
- External signals can be delayed or interrupted; Freya executes what arrives, but the timing and accuracy of the signal itself depend on your source.
The dollar amounts and percentages in this guide are worked examples, not recommendations. Crypto trading can lose money — size every bot with funds you can afford to lose, and read the full Risk Disclosure before going live.
How TradingView Alerts and Webhooks Work
Three pieces make up the pipeline.
The alert is a condition you define on a TradingView chart: price crossing a level, an indicator flipping, a custom script firing. On its own it can pop up on screen, email you, or push to your phone — all of which still require you to act.
The webhook is the automation option. When you enable it, TradingView sends a small message over the internet to a URL of your choosing the instant the alert triggers — the alert makes a phone call instead of leaving you a note.
The bot is the receiving end. Freya's signal bot exposes a private webhook URL; when the message arrives, the bot executes the action it's configured for on your connected exchange account.
The full chain:
- Your chart condition becomes true on TradingView
- The alert fires and TradingView calls your bot's webhook URL
- Freya receives the signal and your bot places the order on your exchange
- Your bot then manages the position per its settings
The key mental model: your strategy lives on TradingView; Freya is the execution layer — the timing logic is entirely inside your alert.
What Freya's Webhook Trigger Does
On Freya, webhook execution is handled by the signal bot — the bot type described in the create-bot flow as "Execute trades based on webhook signals." Unlike an indicator-based trigger (RSI, EMA, and so on), the webhook trigger has no timeframe and no condition configured inside Freya — the decision of when to fire belongs entirely to your TradingView alert. Freya's job is what happens next.
There are two webhook modes, and a bot uses one or the other — they can't be combined:
-
TradingView Webhook (Custom Signal mode). Your bot gets two URLs: an Open Webhook URL and a Close Webhook URL. A message to the Open URL opens a position using the order settings you configured in Freya — the trade amount and your take-profit and stop-loss; a message to the Close URL closes it.
-
Risk Ratio mode. Your bot gets one URL. The alert message is a small JSON payload carrying your take-profit and stop-loss prices; the entry is taken at market when the signal arrives. Instead of a trade amount, you set a fixed risk amount (anchored to the stop-loss, or optionally the take-profit), and Freya sizes the position automatically from the entry-to-stop distance. There's no Close URL because the exits handle themselves: the take-profit is placed as a limit order at the exact price from your signal, and the stop-loss executes as a market order when triggered.
| Custom Signal | Risk Ratio | |
|---|---|---|
| Webhook URLs | Two: Open + Close | One |
| Entry | On Open signal, per your order settings | At market when the signal arrives |
| Take-profit / stop-loss | You set them in Freya | Carried in the webhook message |
| Position size | You set the trade amount | Auto-calculated from your fixed risk amount |
| Exit | Close signal (plus any TP/SL you set) | TP limit order + SL market order, placed automatically |
| Best for | Alerts that control both entry and exit | Strategies with per-trade TP/SL levels and consistent risk |
Step-by-Step: Connect TradingView to Your Bot
Step 1: Create a Signal Bot
In Freya's Create Bot flow, choose the Signal Bot type, then select your exchange account, trading pair, and direction — the same as any other bot. The full walkthrough in How to Create a Signal Bot on Freya Finance covers every screen in detail.
Step 2: Choose Your Signal Mode
Pick Custom Signal if you want to configure the trade amount, take-profit, and stop-loss inside Freya and let your alerts simply say "open now" and "close now." Pick Risk Ratio if your strategy produces a take-profit and stop-loss per trade and you want sizing handled automatically from a fixed risk amount.
Step 3: Copy Your Webhook URL(s)
On the strategy step, Freya generates your webhook URL(s). Use the copy button — a single missing character makes the URL useless. You can regenerate any URL later, which creates a fresh one and immediately invalidates the old one.
Step 4: Create the TradingView Alert
On your TradingView chart, create an alert with the condition that represents your entry. In the alert's notification settings, enable the Webhook URL option and paste your bot's URL — the Open URL in Custom Signal mode, or the single URL in Risk Ratio mode. For alert-driven exits in Custom Signal mode, create a second alert for your exit condition and point it at the Close URL.
Step 5: Set the Alert Message
The alert message is the payload TradingView delivers to your bot. Use exactly the format your bot's setup screen provides — in Risk Ratio mode, Freya shows a JSON Body Template with a one-click copy button; your alert should send that structure with your take-profit and stop-loss values filled in. Don't improvise: if the message doesn't match what the bot expects, the signal is ignored rather than guessed at.
Step 6: Test Before Going Live
Never connect a webhook and walk away. Run at least one complete round trip with a small amount:
- Set an alert condition you know will trigger quickly (price crossing a level it's about to touch)
- Let it fire, then check your bot's activity log for the incoming signal event
- Confirm the position opened on your exchange with the size you expected
- Trigger the close (Close URL signal, or the take-profit/stop-loss in Risk Ratio mode) and confirm the position actually closed
Only after a clean round trip should you attach your real strategy and real size.
A Worked Example: Risk Ratio Sizing
Say you set a fixed risk of $20 per trade, anchored to the stop-loss. Your TradingView alert fires with BTC at $100,000, carrying a stop-loss of $98,000 and a take-profit of $104,000 in its message.
- Entry: market, filled at $100,000
- Distance to stop-loss: $2,000 per BTC (2%)
- Position size: $20 risk ÷ $2,000 per BTC = 0.01 BTC (about $1,000 of exposure)
- Take-profit: limit order at $104,000 — if it fills, profit is 0.01 × $4,000 = $40, a 2:1 reward for the $20 risked
- Stop-loss: market order if $98,000 triggers — roughly the $20 you chose, plus fees, and possibly a little more in a fast move since a triggered stop executes at market
Whether your stop is 1% or 5% away, the dollar amount at risk stays $20 because the size adjusts — that consistency is the entire point of Risk Ratio mode.
Reliability: What You Can and Can't Count On
Automation is only as reliable as its weakest link, and with webhook bots that link is usually outside Freya.
TradingView plan requirements. Webhook notifications are not included in every TradingView plan, and alert limits and expiration also vary by tier. An alert that can't send webhooks fails silently from the bot's perspective — check your plan's alert options before building your setup around them.
Delays and outages happen. Freya's marketplace labels webhook-driven strategies with an external-signal warning: trades are triggered by TradingView or webhook signals, and delays or outages at the source are possible. If TradingView has an incident, your alert never fires and the bot — correctly — does nothing. Freya executes what arrives; it cannot execute what never arrives.
Missed close signals are the sharpest edge. In Custom Signal mode, if your open signal arrives but your close signal never does, the position stays open. A stop-loss configured in your bot's order settings is a backstop that doesn't depend on a second webhook arriving — worth having in most setups.
One-shot alerts stop firing. A TradingView alert set to trigger "Only Once" is done after one signal until you recreate it. For a recurring strategy, choose a repeating trigger option and check the alert's expiration date.
Security: Your Webhook URL Is a Secret
A webhook URL is the key to triggering your bot. There is no password on top of it — possession of the URL is the credential:
- Never share or post a webhook URL — not in a screenshot of alert settings, a shared chart layout, or a chat message asking for help. Blur or crop it first.
- Only paste it into tools you control, like your own TradingView alerts.
- Regenerate immediately if you suspect exposure — the old URL stops working at once. Then update your alerts with the fresh one.
Anyone who has your webhook URL can trigger that action on your bot. Keep the URLs private, and if one ever leaks, regenerate it first and investigate second.
Troubleshooting: The Alert Fired but Nothing Traded
The cause is almost always one of a short list — work through it in order:
- Is the bot running? A paused or stopped bot ignores incoming signals — the most frequent culprit.
- Right URL, right slot? An entry alert pointed at the Close URL will never open a position. Confirm Open vs Close, and confirm the URL was pasted completely.
- Did you regenerate recently? Regenerating invalidates the old URL instantly. If your alert still holds the old one, its messages go nowhere.
- Does the message format match? Especially in Risk Ratio mode, the message must match the JSON structure from your bot's setup screen. A malformed message is ignored.
- Can your TradingView plan send webhooks at all? If not, the alert triggers visually but no message is sent. Also check whether the alert expired or was set to "Only Once."
- Exchange minimums. If your configured amount — or the auto-calculated Risk Ratio size — falls below the pair's minimum order size, the exchange rejects the order.
If a signal appears in your bot's activity log but no trade followed, the problem is on the execution side (bot status, order settings, exchange minimums). If nothing appears at all, the problem is upstream — the alert, the message, the URL, or your TradingView plan.
For bot-status issues beyond webhooks, see Why Is My Bot Not Trading?
Frequently Asked Questions
Do I need a paid TradingView plan to use webhook bots?
If TradingView is your signal source, plan tier matters: webhook notifications are not part of every plan, and free-tier alerts have tighter limits and expiration rules. Before building your automation around alerts, open TradingView's plan comparison and confirm that webhook notifications are included in yours — and check your alert allowance if you run multiple pairs. That said, the bot side doesn't care who sends the message. Freya's signal bot responds to webhook calls from any source — a different charting platform, your own script, or any tool capable of sending a webhook. So a paid TradingView plan is a requirement of TradingView's webhook feature, not of Freya. If your plan doesn't include webhooks, your alternatives are upgrading, switching signal sources, or building the logic inside Freya with indicator-based triggers instead of external signals.
What is the difference between the Open and Close webhook URLs?
In Custom Signal mode, your bot exposes two separate URLs with two distinct jobs. A message to the Open Webhook URL opens a position using the order settings you configured in Freya — the trade amount plus any take-profit and stop-loss you set. A message to the Close Webhook URL closes the position the bot has open. They are not interchangeable — an entry alert pointed at the Close URL will never open a trade. Risk Ratio mode works differently — there is only one URL, used for the entry signal, and no Close URL exists because the exit is handled automatically by the take-profit and stop-loss carried in the webhook message. Both URLs can be copied and regenerated independently; regenerating creates a fresh URL and immediately invalidates the old one, so update the matching TradingView alert afterward.
Can my TradingView alert set the take-profit and stop-loss?
Yes — that's exactly what Risk Ratio mode is for. In that mode, your alert message is a small JSON payload that carries the take-profit and stop-loss prices, and Freya's setup screen provides the JSON Body Template to copy into your alert. When the signal arrives, the entry is taken at the market price, and the exits are placed from your signal's values: the take-profit as a limit order at the exact price you sent, and the stop-loss as a market order when its trigger price is hit. Because the stop executes at market, it can experience slippage in a fast move — like any stop order. In Custom Signal mode, the webhook cannot set exit levels; the take-profit and stop-loss come from the order settings you configure inside Freya, and your alerts are limited to saying when to open and when to close.
Is it safe to paste my webhook URL into TradingView?
Pasting the URL into your own TradingView alert is the intended use — that's the integration working as designed. The real risk is exposure, not the paste itself. A webhook URL has no password on top of it: whoever holds the URL can trigger that action on your bot. The common leak paths are mundane: a screenshot of alert settings shared in a chat, a public post asking for help, or a shared chart layout. Treat every URL like a password: keep it out of screenshots, share it with no one, and only paste it into tools you personally control. If you ever suspect a URL has been seen by someone else, regenerate it immediately — the old URL stops working the moment the new one is created — then update your alert with the replacement before your next signal fires.
Why did my alert fire but no trade happened?
Start with the bot itself: a paused or stopped bot ignores signals entirely — the most common cause. Next, verify the plumbing: the alert must hold the correct, complete URL (Open, not Close, for entries) — and if you regenerated recently, the alert may still point at the dead one. Then check the message: particularly in Risk Ratio mode, the payload has to match the JSON template from your bot's setup screen, or the signal is ignored. On the TradingView side, confirm your plan actually sends webhooks and that the alert hasn't expired or fired its single "Only Once" shot. Finally, if your amount — or the auto-calculated Risk Ratio size — is below the exchange's minimum for the pair, the order is rejected. Your bot's activity log tells you which side failed: a logged signal means an execution issue; no log entry means the signal never arrived.
Do my signals have to come from TradingView?
No. TradingView is the most popular source because its alert system is flexible and chart-driven, but Freya's signal bot responds to webhook calls regardless of origin. Any tool that can send a webhook works: another charting platform, a custom script, a screener with webhook notifications, or an in-house signal system. The contract is the same in every case — call the Open or Close URL in Custom Signal mode, or send the expected JSON payload with take-profit and stop-loss values to the single URL in Risk Ratio mode. Two cautions apply to any source. First, the reliability question doesn't go away: your bot can only execute signals that actually arrive, so your source's uptime is your strategy's uptime. Second, the security rule is universal — whatever tool you use, the webhook URL goes only into systems you control and trust.
Where to Go Next
A webhook bot is only as good as the strategy feeding it. Pressure-test your signal logic against history with How to Backtest Your Crypto Trading Strategy, and read the full walkthrough in How to Create a Signal Bot on Freya Finance if you skipped any setup detail. If you'd rather build the entry logic inside Freya instead, the DCA Bot Strategy Guide covers that approach in depth. And for questions about custody and API-key permissions, see Is My Money Safe on Freya Finance?
