Webhook Integration
Algo Trade Analytics receives strategy signals for analysis. Your execution platform routes trade orders to your broker.
Choose where to send your alerts
Section titled “Choose where to send your alerts”- Backtest vs Alerts. Create one TradingView alert that sends your strategy’s signals to Algo Trade Analytics. Compare them with your backtest. This workflow needs no execution platform or brokerage account.
- Alerts vs Fills. Create two alerts from the same Pine strategy, symbol, timeframe, and trading settings. Send one to Algo Trade Analytics and the other to your execution platform (for example, TradersPost), using each destination’s URL and message format. If the execution alert is already running, add only the analytics alert. Connect your API broker (Alpaca) to load paper or live fills and compare price and quantity. Alpaca is the only supported broker connection for this comparison.
How It Works
Section titled “How It Works”Understanding the data flow is essential for troubleshooting:
- Trigger: Your Pine Script strategy fires an alert condition (e.g., “Buy Signal”).
- Payload: TradingView sends a JSON packet containing trade details (ticker, action, price).
- Authentication: Our server verifies the
auth_keyin the payload matches your specific webhook endpoint. - Ingestion: If valid, the system creates a TradeWebhookEvent record.
- Processing: The event is parsed into a TradeOrder record for analytics, matching, and post-hoc report review.
Step 1: Create a Connection
Section titled “Step 1: Create a Connection”- Navigate to Dashboard > Webhooks.
- Click Create.
- Enter a recognizable name (for example, “BTC Strategy”) and select Create Webhook.
- Copy the generated Webhook URL and Auth Key. You will need these for TradingView.
Step 2: Configure TradingView Alert
Section titled “Step 2: Configure TradingView Alert”You can write the messages in Pine using the analytics webhook format. For help, choose Set up TradingView alerts in Algo Lab, or ask your MCP assistant to prepare the strategy. The assisted setup can add both formats to one script. For the analytics alert, choose Algo Trade Analytics under Webhook Platform in the TradingView strategy inputs and paste your webhook’s Auth Key into Algo Trade Analytics auth key.
If you write your own Pine messages, build a payload for each order and pass it in the order’s alert_message argument. For example, use positionDirection: "entryLong" for a long entry and positionDirection: "exitLong" for its exit. Use entryShort and exitShort for short trades.
For both setup paths, create a TradingView strategy alert, select Order fills only, and set Message to {{strategy.order.alert_message}}. Under Notifications, enable Webhook URL and paste your analytics webhook URL. TradingView then sends the message from the order that filled.
Example payload for one long entry. This illustrates the JSON received by the webhook. Your strategy supplies the values for each fill.
{ "auth_key": "YOUR_AUTH_KEY_HERE", "ticker": "AAPL", "positionDirection": "entryLong", "orderType": "market", "qty": 1, "marketPrice": 150.50, "metadata": { "timestamp": "2026-10-12T15:30:00Z", "strategy": "My Strategy", "signal": "Long entry" }}Step 3: Limitations & Best Practices
Section titled “Step 3: Limitations & Best Practices”To ensure system stability and accurate processing:
- Rate Limits: New webhook connections default to 30 requests per 60-second window. The window and maximum are stored per connection, so check the product if the values have been changed. High-frequency trading (HFT) is not supported.
- Plan Limits: The number of endpoints and the monthly events per endpoint depend on your plan (see the pricing page for current numbers). Deliveries past a cap return
429until the next month or an upgrade. - One Strategy, One Webhook: We recommend creating a separate webhook connection for each distinct strategy. This makes debugging much easier if one strategy starts misbehaving.
- Payload Size: JSON bodies are capped at 128 KB. Keep payloads focused on the signal and its reconciliation metadata.
Troubleshooting
Section titled “Troubleshooting”- 401 Error: Check your
auth_key. It must be an exact string match. - 429 Error: Either the endpoint reached its monthly events cap, or the endpoint is paused because it is over your plan’s active-endpoint limit — the response message says which. Free a slot by deactivating another endpoint, wait for the next monthly cycle, or upgrade.
- No Event: Verify you checked the “Webhook URL” box in TradingView alert options.
- Event but No Trade: Check the Webhook Events Log. If the JSON was malformed, the system creates an event but marks it as “Failed to Process”.
Next Steps
Section titled “Next Steps”Once your webhooks are flowing:
- Verify Data: Check the raw logs to ensure TradingView is sending what you expect.
- Backtest vs Alerts: Compare these real-time signals against your historical backtest.
- Standard Reference: View the full list of supported JSON fields.