Webhook Templates
Copy-paste JSON templates for TradingView alerts. These templates work with SignalBee's webhook endpoints to automate your trading signals.
Template Format Overview
All webhook payloads use JSON format with string values for all fields (including numbers).
Complete Field Reference
| Field | JSON Key | Type | Required | Valid Values |
|---|---|---|---|---|
| Webhook Secret | webhook_secret | string | Yes | Your webhook's secret key |
| Side | side | string | Yes | buy, sell, close |
| Symbol | symbol | string | Yes | 6-20 chars, alphanumeric (e.g., BTCUSDT) |
| Quantity Type | quantity_type | string | Yes | fixed, percentage |
| Quantity | quantity | string | Yes | Positive number (0-100 for percentage) |
| Source Timestamp | source_timestamp | ISO 8601 | Yes | Alert trigger time (within 5 minutes). Use {{timenow}} in TradingView |
| Signal Price | signal_price | string | No | Reference price (for logging only) |
Normalization Rules
SignalBee normalizes incoming values:
- side: Case-insensitive → normalized to lowercase (
BUY→buy) - symbol: Case-insensitive → normalized to uppercase (
btcusdt→BTCUSDT) - quantity_type: Case-insensitive → normalized to lowercase (
PERCENTAGE→percentage)
Minimal vs Full Payload
Minimal (required fields only):
{
"webhook_secret": "your-secret-here",
"side": "buy",
"symbol": "BTCUSDT",
"quantity_type": "fixed",
"quantity": "0.001",
"source_timestamp": "{{timenow}}"
}
Full (all fields):
{
"webhook_secret": "your-secret-here",
"side": "buy",
"symbol": "BTCUSDT",
"quantity_type": "percentage",
"quantity": "25",
"source_timestamp": "{{timenow}}",
"signal_price": "{{close}}"
}
Basic Templates
Simple Buy (Fixed Quantity)
Buys an exact amount of the asset.
{
"webhook_secret": "your-secret-here",
"side": "buy",
"symbol": "BTCUSDT",
"quantity_type": "fixed",
"quantity": "0.001",
"source_timestamp": "{{timenow}}"
}
Use case: Consistent position sizing regardless of account balance.
Simple Sell (Fixed Quantity)
Sells an exact amount of the asset.
{
"webhook_secret": "your-secret-here",
"side": "sell",
"symbol": "BTCUSDT",
"quantity_type": "fixed",
"quantity": "0.001",
"source_timestamp": "{{timenow}}"
}
Use case: Selling a specific amount at take-profit levels.
Buy with Percentage of Balance
Uses a percentage of your available quote currency (e.g., USDT).
{
"webhook_secret": "your-secret-here",
"side": "buy",
"symbol": "ETHUSDT",
"quantity_type": "percentage",
"quantity": "25",
"source_timestamp": "{{timenow}}"
}
Use case: Position sizing that scales with account growth. Uses 25% of available USDT.
Sell Percentage of Holdings
Sells a percentage of your current holdings.
{
"webhook_secret": "your-secret-here",
"side": "sell",
"symbol": "ETHUSDT",
"quantity_type": "percentage",
"quantity": "50",
"source_timestamp": "{{timenow}}"
}
Use case: Taking partial profits while maintaining exposure.
Close Entire Position
Sells 100% of your holdings for a symbol.
{
"webhook_secret": "your-secret-here",
"side": "close",
"symbol": "BTCUSDT",
"quantity_type": "percentage",
"quantity": "100",
"source_timestamp": "{{timenow}}"
}
Use case: Stop-loss exits, full position closes. The close side is equivalent to sell with 100% quantity.
TradingView Dynamic Variables
TradingView replaces placeholder variables with actual values when the alert fires.
Available Variables
| Variable | Maps to | Example Output |
|---|---|---|
{{strategy.order.action}} | side | buy or sell |
{{ticker}} | symbol | BTCUSDT |
{{close}} | signal_price | 67543.21 |
{{timenow}} | source_timestamp | 2024-01-15T10:30:00Z |
{{open}} | — | 67100.00 |
{{high}} | — | 67800.00 |
{{low}} | — | 66900.00 |
{{volume}} | — | 1234.56 |
{{exchange}} | — | BINANCE |
{{strategy.order.price}} | — | 67500.00 |
{{strategy.position_size}} | — | 0.5 |
Strategy Alert Template
Use with Pine Script strategies that have built-in buy/sell signals:
{
"webhook_secret": "your-secret-here",
"side": "{{strategy.order.action}}",
"symbol": "{{ticker}}",
"quantity_type": "percentage",
"quantity": "50",
"signal_price": "{{close}}",
"source_timestamp": "{{timenow}}"
}
Note: The
{{strategy.order.action}}variable outputsbuyorsellbased on your strategy's order direction.
Manual Indicator Template (Fixed Side)
Use when your indicator doesn't output buy/sell signals—create separate alerts for each direction:
Buy Alert:
{
"webhook_secret": "your-secret-here",
"side": "buy",
"symbol": "{{ticker}}",
"quantity_type": "percentage",
"quantity": "25",
"signal_price": "{{close}}",
"source_timestamp": "{{timenow}}"
}
Sell Alert:
{
"webhook_secret": "your-secret-here",
"side": "sell",
"symbol": "{{ticker}}",
"quantity_type": "percentage",
"quantity": "100",
"signal_price": "{{close}}",
"source_timestamp": "{{timenow}}"
}
Strategy-Specific Templates
EMA Crossover Strategy
For moving average crossover signals:
{
"webhook_secret": "your-secret-here",
"side": "{{strategy.order.action}}",
"symbol": "{{ticker}}",
"quantity_type": "percentage",
"quantity": "10",
"source_timestamp": "{{timenow}}"
}
Setup:
- Add an EMA crossover strategy to your chart
- Create alert on "Order fills"
- Paste this template in the message field
RSI Overbought/Oversold
Create two separate alerts for RSI-based entries and exits.
RSI Oversold (Buy Signal) — RSI < 30:
{
"webhook_secret": "your-secret-here",
"side": "buy",
"symbol": "{{ticker}}",
"quantity_type": "percentage",
"quantity": "20",
"source_timestamp": "{{timenow}}"
}
RSI Overbought (Sell Signal) — RSI > 70:
{
"webhook_secret": "your-secret-here",
"side": "sell",
"symbol": "{{ticker}}",
"quantity_type": "percentage",
"quantity": "100",
"source_timestamp": "{{timenow}}"
}
Setup:
- Add RSI indicator to your chart
- Create first alert: RSI crossing up 30 → use buy template
- Create second alert: RSI crossing down 70 → use sell template
Dollar Cost Averaging (DCA)
Automated recurring purchases:
{
"webhook_secret": "your-secret-here",
"side": "buy",
"symbol": "BTCUSDT",
"quantity_type": "fixed",
"quantity": "0.0005",
"source_timestamp": "{{timenow}}"
}
Setup:
- Create a time-based alert in TradingView
- Set to trigger at your desired interval (daily, weekly)
- Use a fixed quantity for consistent DCA amounts
Breakout Trading
For price breakout strategies:
{
"webhook_secret": "your-secret-here",
"side": "buy",
"symbol": "{{ticker}}",
"quantity_type": "percentage",
"quantity": "15",
"source_timestamp": "{{timenow}}",
"signal_price": "{{close}}"
}
Setup:
- Draw a horizontal line at resistance level
- Create alert: Price crossing up the line
- Use this template for breakout entries
Multi-Exchange Considerations
Exchange Selection
The exchange is determined by which webhook you use, not by a field in the payload. Each webhook in SignalBee is linked to a specific exchange.
- Same JSON template works for all exchanges
- Create separate webhooks for each exchange you want to trade on
- Use the appropriate webhook URL for each alert
Symbol Format by Exchange
Different exchanges use different symbol formats. Use the format that matches your connected exchange:
| Exchange | Format | Example |
|---|---|---|
| Binance | No separator | BTCUSDT |
| Coinbase | Hyphen | BTC-USD |
| Kraken | Varies | XXBTZUSD or BTCUSD |
| Bybit | No separator | BTCUSDT |
| OKX | Hyphen | BTC-USDT |
| KuCoin | Hyphen | BTC-USDT |
| Gate.io | Underscore | BTC_USDT |
Tip: Check your exchange's API documentation for the exact symbol format.
Common Mistakes
Avoid these frequent errors that cause signal rejection.
| Mistake | ❌ Wrong | ✅ Right |
|---|---|---|
| Percentage symbol in quantity | "quantity": "50%" | "quantity": "50" |
| Missing webhook_secret | No webhook_secret field | Include webhook_secret |
| Unquoted numbers | "quantity": 0.001 | "quantity": "0.001" |
| Wrong field name (action) | "action": "buy" | "side": "buy" |
| Wrong field name (ticker) | "ticker": "BTCUSDT" | "symbol": "BTCUSDT" |
| Slash in symbol | "symbol": "BTC/USDT" | "symbol": "BTCUSDT" |
| Invalid side value | "side": "long" | "side": "buy" |
| Trailing comma | "quantity": "50",} | "quantity": "50"} |
| Extra whitespace in secret | "webhook_secret": " abc123 " | "webhook_secret": "abc123" |
Field Name Reference
SignalBee uses these canonical field names:
| Correct | Incorrect (won't work) |
|---|---|
side | action, direction, type |
symbol | ticker, pair, market |
signal_price | price, entry_price |
source_timestamp | timestamp, time |
Validation Checklist
Before sending your first signal, verify each item:
Required Fields
-
webhook_secret— Matches exactly what's in SignalBee (copy-paste it) -
side— Is one of:buy,sell, orclose -
symbol— Matches your exchange's format (no slashes for Binance) -
quantity_type— Is eitherfixedorpercentage -
quantity— Is a positive number as a string (no%symbol) -
source_timestamp— Use{{timenow}}for TradingView alerts (required for duplicate detection)
JSON Syntax
- All values are strings (wrapped in double quotes)
- No trailing commas after the last field
- Proper JSON structure (validates at jsonlint.com)
- No extra whitespace in field values
TradingView Variables
- Variables use double curly braces:
{{ticker}}not{ticker} - Variable names are spelled correctly
- Variables are inside quotes:
"{{ticker}}"not{{ticker}}
SignalBee Configuration
- Webhook is enabled in SignalBee
- Trading is enabled for the webhook
- Symbol is in the allowed pairs list (or list is empty for all pairs)
- Exchange is connected and tested successfully
Testing Your Template
Method 1: SignalBee's Test Feature
- Go to SignalBee Dashboard → Webhooks
- Click on your webhook
- Click Test Webhook
- The test sends a sample signal to verify connectivity
Method 2: TradingView's Test Button
- Create your alert in TradingView
- Before saving, click the Test button (if available)
- Check SignalBee's Signals → History for the test signal
Method 3: Live Testing with Small Quantities
- Use a very small quantity:
"quantity": "0.0001" - Create an alert on a condition that triggers quickly
- Monitor in SignalBee Signals → History
- Check your exchange for the executed trade
- Delete the test alert after verification
Method 4: JSON Validation Tools
Before pasting into TradingView:
- Copy your JSON template
- Paste into jsonlint.com
- Click "Validate JSON"
- Fix any syntax errors before using
Debugging Failed Signals
If your signal isn't working:
- Check TradingView Alert History — Verify the alert fired
- Check SignalBee Signal History — Look for the signal and its error
- Validate JSON syntax — Use jsonlint.com
- Verify field names — Use
sideandsymbol, notactionandticker - Check webhook_secret — Copy-paste it directly, don't type it
Related Documents
- TradingView Setup — Complete guide to creating TradingView alerts
- Error Codes — Understanding signal failure reasons
- Glossary — Term definitions
- User Guide - Webhooks — SignalBee webhook configuration