Use a TradingView webhook automation JSON template for crypto alerts with side, symbol, size, TP/SL, and strategy IDs. Review payload and execution boundaries.
Most traders start with TradingView alerts as notifications.
Price crosses a level. An indicator flips. A Pine Script strategy prints a signal.
TradingView sends a push notification, and the trader still has to open the exchange, choose the pair, set size, place the order, and manage the exit manually.
That is useful, but it is not automation.
TradingView webhook automation is what happens when that alert sends a structured message to an execution system instead. Instead of saying "BTC long now" in a phone notification, the alert sends a JSON payload that a system like Crodl can read, validate, route, and execute.
This guide shows a practical TradingView webhook JSON template for crypto trading, how to use it, and what to avoid before you let any alert touch real capital.
How does TradingView Webhook Automation work?
A TradingView webhook sends an HTTP POST request to a webhook URL when an alert fires. That URL can belong to a trading automation platform, a custom server, a logging system, or a workflow tool.
For crypto traders, the common flow is:
Your TradingView indicator or strategy creates an alert.
TradingView sends a webhook request to your automation URL.
The automation system reads the alert message.
The system decides what action to take.
The trade is routed to the connected exchange account.
TradingView supports alert messages as plain text or JSON. If the alert message is valid JSON, TradingView sends it with a JSON content type. That matters because structured JSON is much easier for automation software to validate than a sentence like "buy BTC now".
Configure symbol, side, size, TP/SL, and journal settings in Crodl.
Copy the trigger JSON payload from Crodl.
In TradingView, set the webhook URL to https://api.crodl.com/webhooks/trading.
Paste the trigger JSON into the alert Message field.
In that setup, the JSON payload contains the execution rules. Crodl validates the payload, resolves the connected exchange API key through your security_token, and queues the trade asynchronously.
Use the full JSON payload when you want reusable Pine scripts, TradingView alerts, strategy-level journaling, or alert payloads copied from Crodl's Pine library.
TradingView Webhook JSON Template
Start with a small, explicit payload. Do not try to make your first automated alert handle every edge case.
The important part is not the exact 2% take profit or 0.8% stop loss. Those are examples. The important part is that the alert sends a complete trade intent:
direction
size
risk controls
journal grouping
signal metadata
If your strategy has not been tested, do not automate it with meaningful size. Start with demo trading or the smallest live size your exchange allows.
Short Entry Template
Short entries use the same structure, but the side changes.
Keep long and short alerts separate when you are starting out. It is easier to audit two simple alerts than one complex alert that tries to infer too much.
Close Position Template
Closing risk should be explicit. If your alert is meant to close a long, send a close-long instruction. If it is meant to close a short, send a close-short instruction.
For a short close, change side to close_short and reuse the matching strategy_dashboard_id.
That ID matters. If your entry and exit use different strategy IDs, your journal may split one trade into two unrelated events. We covered why this matters in why most trading journals break.
TradingView Placeholders Worth Using
TradingView placeholders are variables that get replaced when the alert fires.
The most useful ones for webhook automation are:
Placeholder
What it sends
{{ticker}}
The chart symbol
{{exchange}}
The TradingView data exchange
{{interval}}
The chart timeframe where the alert was created
{{close}}
The close price of the triggering bar
{{time}}
The triggering bar time
{{timenow}}
The time the alert fired
{{volume}}
Volume on the triggering bar
Use placeholders carefully. Crodl expects exchange-native symbols, so {{ticker}} is only safe when the TradingView ticker already matches the target exchange symbol format. For example, OKX perpetuals should use the full instId format such as BTC-USDT-SWAP.
Do not rely on placeholders to fix bad risk settings. Position size, leverage, stop loss, and take profit rules should be deliberate.
Pine Script Strategy Alerts
If you are using a Pine Script strategy instead of a basic indicator alert, TradingView also supports strategy placeholders such as order action, order size, and order price.
Be careful with this pattern. TradingView strategy placeholders may send values like buy or sell, while Crodl expects long, short, close_long, or close_short. Do not paste {{strategy.order.action}} directly into side unless your Pine Script maps it to Crodl's side values first.
For most traders, separate long, short, close-long, and close-short alerts are easier to reason about.
If your strategy does not have this wiring yet, use our copy-ready Pine Script strategy alert template. It includes four editable message inputs, order-fill wiring for entries and exits, and a prompt you can give to an AI coding assistant to update your existing strategy without changing its trading logic.
For a Pine indicator() script, use the Pine Script indicator alert template. It includes separately named stop-loss and take-profit conditions, correct placeholder usage, and an AI prompt that preserves the indicator's existing logic.
What Not to Put in a Webhook Message
Crodl's webhook payload requires a security_token. That token is not your exchange API secret, but it does grant trading access through Crodl, so treat it like a password and paste it only into your private TradingView alert.
Do not add any extra credentials beyond the Crodl security_token.
Do not include:
exchange API key
exchange API secret
exchange passphrase
Crodl password
email password
seed phrase
private key
personal login credentials
TradingView also warns against sending credentials through webhook messages. Treat the copied Crodl payload as execution-capable material. If someone has your security_token and a valid payload, they may be able to create unwanted orders.
The safe pattern is:
store exchange credentials inside Crodl
paste only the Crodl security_token into the private TradingView alert payload
use API keys with the minimum permissions needed
avoid withdrawal permissions on trading API keys
keep copied payloads private
rotate your security token or exchange API key if either is exposed
Common Webhook Automation Mistakes
Mistake 1: Starting with too much size
Automation removes hesitation. That is good when the system is tested and bad when the logic is wrong.
Start with demo trading or tiny live size. Verify the first several alerts manually before scaling.
Mistake 2: Letting one alert do everything
One mega-alert that can open long, open short, close long, close short, reverse, pyramid, and resize sounds efficient. It is usually harder to debug.
Start with one alert per action.
Mistake 3: No strategy ID
Without a stable strategy_dashboard_id, your journal has to infer which entry and exit belong together.
That breaks down quickly when you run multiple strategies on the same symbol or trade across multiple exchanges.
Mistake 4: No TP/SL plan
An automated entry without an exit plan is only half a system.
If the setup needs a stop loss, define it before the alert goes live. If the setup needs manual review, do not pretend it is fully automated.
Mistake 5: Forgetting exchange differences
Symbols, minimum order sizes, leverage limits, margin modes, and liquidity differ by exchange. A payload that works on one exchange may need adjustment on another.
Before you let a TradingView webhook trade with real size, check:
The JSON is valid.
The security_token is present and private.
The exchange API key has no withdrawal permission.
The symbol maps correctly on the target exchange.
Long alerts open long positions.
Short alerts open short positions.
Close-long alerts close long positions.
Close-short alerts close short positions.
Position size is correct.
Leverage is correct.
TP/SL rules behave as expected.
The trade lands in the correct strategy journal.
Errors are visible in your execution history.
Only increase size after the workflow has produced the expected orders under real market conditions.
Frequently Asked Questions
Do I need JSON for TradingView webhook automation?
Yes for Crodl's documented TradingView endpoint. Set TradingView's Webhook URL to https://api.crodl.com/webhooks/trading, then paste the Crodl trigger JSON into the alert Message field. You do not have to write the JSON by hand if you copy the payload from Crodl.
Does TradingView send JSON automatically?
TradingView sends the alert message you enter. If that message is valid JSON, TradingView sends it as JSON. If the message is plain text, it is sent as plain text.
Can I use {{ticker}} for every exchange?
Use it carefully. {{ticker}} comes from the TradingView chart symbol, and your execution exchange may use a slightly different symbol format. Test symbol mapping before going live.
Should I include my exchange API key secret in the webhook?
No. Never put exchange API keys, exchange secrets, passwords, passphrases, seed phrases, or private keys in a webhook message. Crodl's security_token is the only secret-like value the documented webhook payload needs, and it should be kept private.
Should one alert open and close trades?
Usually not at first. Separate alerts for long entry, short entry, long close, and short close are easier to test and audit. Combine logic only after the simple version works reliably.
Final Thought
TradingView webhook automation is not just about sending an alert to a bot.
The quality of the payload matters.
A good webhook message tells the execution system exactly what to do, how much risk to take, how to group the trade in the journal, and enough context to debug the signal later.
Start simple. Keep the JSON explicit. Use stable strategy IDs.
This content is for educational purposes only and does not constitute financial advice. Cryptocurrency trading involves significant risk of loss. Past performance does not guarantee future results.
Share this article
Ready to automate your trading?
Connect your exchange, set up automations, and start trading smarter — all from one platform.