Configure TradingView webhook alerts for Alpaca

Complete the webhook step for tradingview webhook automation and route structured alerts from TradingView to Alpaca through TradeAdapter.

Step 1

Create TradingView alert

Add your strategy to the chart and create an alert on a US equity symbol.

Strategy
TradingView strategy
Alert
TradingView alert
Step 2

Set message and webhook URL

Paste Alpaca keys and TradeAdapter webhook URL for real-time trade execution.

Message
Alert message
Webhook
Webhook
JSON

TradingView alert message template

{
  "alpaca_api_key": "PUT YOUR ALPACA API KEY HERE",
  "alpaca_api_secret": "PUT YOUR ALPACA SECRET HERE",
  "real_order": "Yes / No",
  "order_market": "Spot",
  "order_type": "Market / Limit",
  "isolated_margin": "Yes / No",
  "exchange": "Alpaca",
  "ticker": "{{ticker}}",
  "time": "{{timenow}}",
  "order_contracts": "{{strategy.order.contracts}}",
  "order_action": "{{strategy.order.action}}",
  "order_price": "{{strategy.order.price}}"
}