Webhooks (TradingView โ Bot)¶
Webhooks allow TradingView alerts to be sent to external services, bots, or APIs for automation. This guide covers how webhooks can be configured and used with Signal Pilot indicators.
Educational Purpose
This guide presents webhook integration for educational and automation purposes. Automated trading carries significant risks. This is not financial advice.
๐ก What Are Webhooks?¶
Webhooks are automated HTTP POST requests sent from TradingView to a URL you specify when an alert triggers. Common uses include:
- Notifications: Send alerts to Discord, Telegram, or Slack
- Logging: Record alerts in a database or spreadsheet
- Automation: Trigger actions through custom APIs
- Testing: Monitor alert frequency and conditions
โ Prerequisites¶
Before configuring webhooks, the following items are typically needed:
- TradingView Pro, Pro+, or Premium: Free accounts do not have webhook access
- Webhook endpoint URL: A service that receives HTTP POST requests (e.g., Discord webhook, custom server, automation platform)
- Signal Pilot indicator: Configured and added to your chart
- Basic JSON knowledge: Helpful for customizing message payloads (optional)
๐ง Step-by-Step Setup¶
Step 1: Get Your Webhook URL¶
The webhook URL depends on where alerts are being sent:
Discord Webhook
- In Discord, go to Server Settings โ Integrations โ Webhooks
- Click "New Webhook"
- Configure name and channel
- Copy the webhook URL (format:
https://discord.com/api/webhooks/...)
๐ธ Screenshot Coming Soon
Discord Webhook Creation Interface
We'll add a screenshot of Discord's webhook creation interface showing the integration panel and webhook setup steps.
Telegram Bot
- Search for "@BotFather" in Telegram
- Send
/newbotand follow prompts - Get bot token
- Use a webhook bridge service or custom server to forward TradingView webhooks to Telegram
Custom Server/API
Custom endpoints can be created using platforms like:
- Webhook.site: For testing (receives and displays webhook payloads)
- Make.com (Integromat): For connecting to multiple services
- Zapier: For workflow automation
- Custom server: Python Flask, Node.js Express, etc.
Step 2: Configure TradingView Alert¶
- On your chart with Signal Pilot indicator, click the Alert icon (clock with +)
- In the alert dialog:
- Condition: Select your Signal Pilot indicator and desired alert condition
- Options: Set "Once Per Bar Close" to avoid intrabar repaints
- Expiration: Set according to your needs (commonly "Open-ended")
- Scroll down to "Notifications" tab
- Check the "Webhook URL" box
- Paste your webhook endpoint URL
๐ธ Screenshot Coming Soon
TradingView Alert Dialog - Webhook URL Field
We'll add a screenshot of TradingView's alert configuration dialog showing the Webhook URL input field in the Notifications section.
Step 3: Customize Alert Message (Optional)¶
In the "Message" field, you can customize what data is sent. TradingView supports placeholders:
{
"indicator": "{{ticker}}",
"price": "{{close}}",
"time": "{{time}}",
"signal": "Pentarch Reversal Detected",
"timeframe": "{{interval}}"
}Common TradingView Placeholders:
{{ticker}}: Symbol name (e.g., "BTCUSDT"){{close}}: Current close price{{time}}: Alert trigger time{{interval}}: Timeframe (e.g., "15", "1D"){{exchange}}: Exchange name
Step 4: Test the Webhook¶
- After creating the alert, click "Test" button in alert settings
- Check your webhook destination (Discord channel, webhook.site, etc.)
- Verify the message appears with correct formatting
- If nothing appears, check:
- Webhook URL is correct
- TradingView account has webhook access (Pro+ or Premium)
- Endpoint is accessible (not blocked by firewall)
๐ธ Screenshot Coming Soon
Discord Webhook Test Message Success
We'll add a screenshot of Discord chat displaying a successful test message from the webhook with properly formatted Signal Pilot alert data.
๐ฌ Message Format Examples¶
Discord-Formatted Message
{
"content": "๐ **Signal Pilot Alert**",
"embeds": [{
"title": "Pentarch Reversal",
"description": "Reversal pattern detected on {{ticker}}",
"color": 65280,
"fields": [
{"name": "Price", "value": "{{close}}", "inline": true},
{"name": "Timeframe", "value": "{{interval}}", "inline": true},
{"name": "Time", "value": "{{time}}", "inline": false}
]
}]
}Simple Text Message
Signal Pilot: {{ticker}} - Harmonic Oscillator cross detected at {{close}} on {{interval}} timeframeStructured JSON for Custom API
{
"alert_type": "signal_pilot",
"indicator": "janus_atlas",
"symbol": "{{ticker}}",
"exchange": "{{exchange}}",
"timeframe": "{{interval}}",
"price": "{{close}}",
"timestamp": "{{time}}",
"condition": "Level Break Alert"
}๐ Common Webhook Platforms¶
| Platform | Use Case | Setup Complexity |
|---|---|---|
| Discord | Team notifications, logging | Very Easy |
| Telegram | Mobile notifications | Moderate (requires bot + bridge) |
| Make.com | Multi-service integration | Easy (visual workflow) |
| Zapier | Connect to 5000+ apps | Easy (visual workflow) |
| Webhook.site | Testing and debugging | Very Easy |
| Custom Server | Full control, custom logic | Advanced (programming required) |
๐ Troubleshooting¶
Follow this diagnostic flow if webhooks aren't working:
pasted correctly
in alert?} Check1 -->|No| Fix1[โ Missing webhook URL
Edit alert โ Paste webhook URL
in Notifications tab] Check1 -->|Yes| Check2{Alert actually
firing?} Check2 -->|No| Fix2[โ ๏ธ Alert not firing
See Alert Troubleshooting Guide] Check2 -->|Yes| Check3{Tested webhook
with webhook.site
or similar?} Check3 -->|No| Fix3[๐งช Test webhook first
Use webhook.site to verify
webhook URL works] Check3 -->|Yes - Works| Check4{Discord/Telegram
webhook URL
correct format?} Check3 -->|Yes - Fails| Fix3b[โ Webhook URL broken
Create NEW webhook URL
in Discord/Telegram] Check4 -->|No| Fix4[๐ Wrong format
Discord: .../webhooks/...
Telegram: bot token required] Check4 -->|Yes| Check5{Message format
valid JSON?} Check5 -->|No| Fix5[โ ๏ธ Invalid JSON
Use JSON validator
Check quotes and brackets] Check5 -->|Yes| Check6{TradingView plan
supports webhooks?} Check6 -->|No - Free/Essential| Fix6[๐ฐ Upgrade required
Webhooks need Pro+
or Premium plan] Check6 -->|Yes - Pro+/Premium| Support[๐ Contact Support
Provide: Screenshot of alert,
webhook URL, JSON message] style Problem fill:#f44336,color:#fff,stroke:#d32f2f,stroke-width:4px style Check1 fill:#2196f3,color:#fff,stroke:#1976d2,stroke-width:2px style Check2 fill:#2196f3,color:#fff,stroke:#1976d2,stroke-width:2px style Check3 fill:#2196f3,color:#fff,stroke:#1976d2,stroke-width:2px style Check4 fill:#2196f3,color:#fff,stroke:#1976d2,stroke-width:2px style Check5 fill:#2196f3,color:#fff,stroke:#1976d2,stroke-width:2px style Check6 fill:#2196f3,color:#fff,stroke:#1976d2,stroke-width:2px style Fix1 fill:#ff9800,color:#fff,stroke:#f57c00,stroke-width:2px style Fix2 fill:#ff9800,color:#fff,stroke:#f57c00,stroke-width:2px style Fix3 fill:#ff9800,color:#fff,stroke:#f57c00,stroke-width:2px style Fix3b fill:#ff5722,color:#fff,stroke:#e64a19,stroke-width:3px style Fix4 fill:#ff9800,color:#fff,stroke:#f57c00,stroke-width:2px style Fix5 fill:#ff9800,color:#fff,stroke:#f57c00,stroke-width:2px style Fix6 fill:#ff5722,color:#fff,stroke:#e64a19,stroke-width:3px style Support fill:#4caf50,color:#fff,stroke:#388e3c,stroke-width:3px
Quick Test: Always test your webhook with webhook.site first. If it works there but not in Discord/Telegram, the issue is with your Discord/Telegram webhook setup.
Webhook Not Received
- Verify TradingView plan: Free accounts cannot use webhooks
- Check URL: Ensure no extra spaces, correct protocol (https://)
- Test endpoint: Use webhook.site to verify TradingView can reach your URL
- Alert fired?: Check TradingView alert log to confirm alert actually triggered
Wrong Data in Message
- Placeholder syntax: Must use
{{ticker}}not{ticker} - JSON formatting: Validate JSON at jsonlint.com if using structured format
- Quote escaping: Use
\"for quotes inside JSON strings if needed
Too Many Webhooks (Spam)
- Alert frequency: Change from "Once Per Bar" to "Once Per Bar Close"
- Condition specificity: Use more specific alert conditions
- Cooldown period: Some webhook services have rate limits
๐ Security Considerations¶
Important Security Notes
- Webhook URLs are sensitive: Treat them like passwords and avoid sharing publicly
- Rotate URLs periodically: Especially for critical automation
- Validate incoming data: If using custom server, verify requests come from TradingView
- HTTPS strongly preferred: Unsecured HTTP endpoints pose security risks
๐ Example Workflow¶
Scenario: Receiving Pentarch reversal alerts in a Discord channel
- Created Discord webhook in #trading-alerts channel
- Configured Pentarch v1.0 on BTCUSDT 15m chart
- Set alert on "Pentarch: Reversal Detected" condition
- Set to fire "Once Per Bar Close"
- Pasted Discord webhook URL in alert settings
- Customized message with Discord embed format (shown above)
- Tested alert - message appeared in Discord
- Alert now active - team receives notifications when reversal patterns are detected
(Historical workflow example for educational purposes only. Not financial advice. Individual results may vary.)
- Webhook Fundamentals: Webhooks send HTTP POST requests with custom JSON data from TradingView alerts to external services (Discord, Slack, custom automation systems, trading bots) for real-time notifications
- Setup Process: Create webhook URL in external service, configure TradingView alert with webhook URL, customize message format using JSON with placeholders like {{ticker}}, {{close}}, {{time}}, then test before going live
- Message Customization: Use JSON format to structure alert data - include ticker symbol, price levels, timeframe, signal type, timestamp, and any other relevant trading context for your workflow
- Popular Integration Examples: Send alerts to Discord channels (team coordination), Slack workspaces (trading desk communication), custom APIs (automated trade execution), or logging services (performance tracking)
- Placeholder Variables: TradingView provides {{ticker}}, {{exchange}}, {{close}}, {{open}}, {{high}}, {{low}}, {{volume}}, {{time}}, {{interval}} placeholders for dynamic alert content
- Testing Best Practices: Always test webhook with simple message first, verify JSON formatting with online validators, check webhook URL is correct, confirm messages appear in destination service before enabling for live trading
- Workflow Optimization: Create separate alerts for different conditions (entry signals vs exit signals), use descriptive names for organization, document webhook setups, log all alerts to track performance over time
Next Steps: Review Core Alert Configuration Guide for basic TradingView alert setup, or explore your chosen integration service's documentation for advanced webhook customization options.
๐ Next Steps¶
- Multiple alerts: Create separate alerts for different conditions
- Alert management: Use descriptive names to organize alerts
- Logging: Consider logging all alerts to track performance over time
- Documentation: Document your webhook setup and message formats
- Testing: Always test with paper trading before live trading
Related Resources
- How to Set Up Alerts - Core alert configuration
- Best Practices - Alert management tips
- Support - Get help with webhook issues