This guide walks you through how to take a TradingView strategy and connect it to an automation platform so trades execute automatically — no manual clicking required.
How It Works (The Big Picture)
TradingView strategies generate alerts when buy or sell conditions are met. Those alerts can send a message (called a webhook) to an automation platform, which then places the actual trade on your exchange.
The flow looks like this:
TradingView Strategy
↓
Alert fires
↓
Webhook message sent
↓
Automation Platform receives it
↓
Trade placed on your exchange
You don't need to write code to set this up — just follow the steps for whichever platform you're using.
Step 1: Set Up Alerts in TradingView
Before connecting any platform, you need to configure your TradingView alerts correctly. This is the same starting point for all platforms.
Add the Strategy to Your Chart
Open TradingView and load the chart for the asset you want to trade.Click Indicators at the top of the chart.Search for the strategy by name and add it to your chart.Confirm you can see the strategy's signals (buy/sell arrows or highlighted bars) on the chart.Create an Alert
Right-click anywhere on the chart and select Add Alert, or press Alt + A.In the Condition dropdown, select your strategy from the list.Set the condition to Order fills (this fires the alert when the strategy would place a trade).Under Actions, check Webhook URL.Paste your webhook URL into the field (you'll get this from your automation platform — see each section below).In the Message box, paste the message template provided by your platform (covered in each section below).Give your alert a name, then click Create.💡Important: TradingView alerts expire after a set period on free accounts. A Pro plan or higher is required to keep alerts running continuously without manual renewal.
Platform Guides
3Commas
3Commas is a popular bot platform with a straightforward interface. It connects to most major exchanges and supports TradingView alerts out of the box.
What You'll Need
A 3Commas account (paid plan required for TradingView integration)An exchange connected to 3Commas via API keysA TradingView Pro account or higherStep-by-Step
1. Create a Bot in 3Commas
Log in to 3Commas and go to Trading Bots → Create Bot.Choose Simple Bot for straightforward long/short entries.Select your exchange, trading pair (e.g. BTC/USDT), and configure your position size.Under Start Condition, select TradingView Custom Signal.Save the bot — do not start it yet.2. Get Your Webhook URL and Message
After saving, open the bot settings and scroll to the TradingView signals section.Copy the Webhook URL — it will look something like:https://3commas.io/trade_signal/trading_view
3Commas also provides the exact message templates you need to paste into your TradingView alert. They look like this:For a buy/long signal:
{
"message_type": "bot",
"bot_id": 12345,
"email_token": "your-token-here",
"delay_seconds": 0,
"pair": "USDT_BTC"
}
Copy these exactly as provided — your bot ID and token will already be filled in.
3. Set Up the TradingView Alert
Follow Step 1 above to create your alert.Paste the 3Commas webhook URL into the Webhook URL field.Paste the message template into the Message field.Create a separate alert for buy signals and another for sell signals using the respective message templates.4. Activate Your Bot
Return to 3Commas and start your bot.It will now wait for signals from TradingView to open and close positions.Tips for 3Commas
Use paper trading mode first to verify signals are arriving correctly before going live.Check the Signal log inside your bot to confirm TradingView alerts are being received.Set a stop loss directly in the 3Commas bot settings as a safety net.
Alertatron
Alertatron is designed specifically for TradingView webhook automation and gives you fine-grained control over order types and execution.
What You'll Need
An Alertatron accountAn exchange connected via API keysA TradingView Pro account or higherStep-by-Step
1. Connect Your Exchange
Log in to Alertatron and go to Exchanges → Add Exchange.Select your exchange (e.g. Binance, Bybit, Kraken).Enter your API key and secret from your exchange account.Save and confirm the connection shows as Active.2. Get Your Webhook URL
In Alertatron, navigate to Webhooks or API in the sidebar.Copy your unique webhook URL. It will look like:https://alertatron.com/v1/alert/your-unique-key
3. Write Your Alert Message
Alertatron uses a simple command-based message format. Here are the templates for common actions:
Buy (long entry):
binance(BTCUSDT) {
market(side=buy, amount=100%);
}
Sell (close long):
binance(BTCUSDT) {
market(side=sell, amount=100%);
}
Replace binance with your exchange name and BTCUSDT with your trading pair.
4. Set Up the TradingView Alert
Follow Step 1 to create your alert.Paste your Alertatron webhook URL into the Webhook URL field.Paste the appropriate message template (buy or sell) into the Message field.Create separate alerts for entry and exit signals.Tips for Alertatron
Alertatron has a log under Recent Alerts — check it after your first alert fires to confirm it was received and processed.You can add delay(5s) inside your message to add a brief pause before execution if you're experiencing timing issues.Alertatron supports limit orders as well — contact us for updated templates if you prefer limit over market orders.
Generic Webhook
If you're using a custom server or a platform not listed here, TradingView can send a raw webhook to any URL you provide. This is the most flexible option.
What You'll Need
A publicly accessible URL that can receive HTTP POST requestsA TradingView Pro account or higherHow Webhooks Work
When your TradingView alert fires, it sends an HTTP POST request to your webhook URL. The body of that request is the Message text you set in the alert. Your server or platform receives this and acts on it.
Setting Up the Alert
Follow Step 1 to create your alert.Check Webhook URL under Actions.Paste your webhook endpoint URL.In the Message field, use TradingView's built-in placeholder variables to include dynamic data:{
"ticker": "{{ticker}}",
"action": "{{strategy.order.action}}",
"price": "{{close}}",
"time": "{{time}}"
}
TradingView will automatically replace {{ticker}}, {{close}}, etc. with real values when the alert fires.
Common Placeholder Variables
| Variable | What It Returns |
| {{ticker}} | The trading pair (e.g. BTCUSDT) |
| {{close}} | The closing price of the bar |
| {{strategy.order.action}} | buy or sell |
| {{strategy.order.price}} | The price the strategy ordered at |
| {{time}} | Timestamp of the alert |
| {{exchange}} | The exchange name |
Tips for Generic Webhooks
Your server must respond with a 200 OK status within a few seconds or TradingView will mark the delivery as failed.TradingView does not retry failed webhooks, so make sure your endpoint is reliable.Use a service like webhook.site to inspect incoming payloads while testing.
TradingView Alerts → Custom Server
This option is for setups where you want to receive TradingView signals on your own server and control execution logic yourself. It builds on the Generic Webhook setup but gives you a dedicated endpoint you manage.
Overview
Your server sits between TradingView and your exchange. TradingView sends an alert to your server, your server interprets it, and your server places the order on the exchange.
TradingView Alert
↓
Your Server
(receives & processes)
↓
Exchange API
(order placed)
What Your Server Needs to Do
Listen for incoming POST requests on a public URL.Parse the JSON message body from TradingView.Authenticate the request (check for a secret token in the message).Place the trade using the exchange's API.Recommended Message Format
Include a secret token in your alert message to verify the request came from TradingView and not somewhere else:
{
"token": "YOUR_SECRET_TOKEN",
"ticker": "{{ticker}}",
"action": "{{strategy.order.action}}",
"price": "{{close}}",
"quantity": "0.01"
}
Set YOUR_SECRET_TOKEN to a long random string. Your server checks this token before doing anything with the message.
Security Checklist
Always validate the secret token before processing any tradeUse HTTPS on your server endpoint — never plain HTTPLog every incoming request for debuggingSet strict position size limits on the exchange API key (not full account access)Restrict your exchange API key to your server's IP address if your exchange supports itTips for Custom Servers
Start with a simple setup that just logs incoming messages before you wire in any exchange logic.Keep your exchange API key permissions minimal — trade only, no withdrawal permissions.Monitor your server logs regularly, especially when first going live.
Troubleshooting
| Problem | Likely Cause | Fix |
| Alert fires but no trade placed | Webhook URL is wrong | Double-check the URL in your alert settings |
| Alert isn't firing at all | Alert expired or strategy has no signals | Check alert status in TradingView; renew if expired |
| Trades going the wrong direction | Buy/sell messages are swapped | Verify the message in each alert matches the correct action |
| Position size is wrong | Amount not configured correctly | Review position size settings in your bot or message template |
| "Webhook delivery failed" in TradingView | Server not responding in time | Check if your server/platform is online and responding |
Before You Go Live
Test on paper trading first. Most platforms and exchanges offer a sandbox or paper trading mode. Use it.Start small. When you do go live, use a fraction of your intended position size until you've confirmed everything is working correctly.Monitor the first few trades manually. Watch the first several signals execute in real time before walking away.Set a hard stop loss. Configure a maximum loss limit on your exchange or bot platform as a safety backstop — independent of your strategy signals.
💡For questions about our specific strategies and the signals they generate, reach out to our support team.