How to Connect TradingView Alerts to Alpaca via AlgoWay

AlgoWay Alpaca Integration Guide

This guide explains how to connect Alpaca to AlgoWay, create or copy Alpaca API credentials, configure an Alpaca webhook inside AlgoWay, test the connection, and send TradingView alerts using the correct JSON format.

The setup has four main parts: get your Alpaca API key and secret, add them to AlgoWay, test the webhook, and configure your TradingView alert with the correct webhook URL and message body.

Step 1: Get Your Alpaca API Keys

Log in to your Alpaca account and open the API section from the left-side menu. Alpaca provides separate API credentials for live trading and paper trading.

If you want to use demo trading first, use the credentials from the Paper Accounts section. For live trading, use the credentials from your live account section.

  1. Log in to your Alpaca account.
  2. Open the API section.
  3. Find the API keys block for your selected account type.
  4. Use Paper Accounts for demo trading.
  5. Click Generate New Keys or Regenerate if you need new credentials.
Alpaca API settings page

Step 2: Save Your Alpaca API Key and Secret

After generating new keys, Alpaca will show your Key and Secret. Copy both values before leaving the page.

The secret key may disappear after refreshing or navigating away from the page, so save it before continuing with the AlgoWay setup.

Alpaca paper API key and secret

Step 3: Create an Alpaca Webhook in AlgoWay

After your Alpaca API credentials are ready, log in to AlgoWay and create a webhook for Alpaca. This webhook will receive TradingView alerts and route them to your Alpaca account.

  1. Log in to your AlgoWay account.
  2. Click Add Trial Webhook or Add Main Webhook.
  3. Select Start 14-Day Trial or Main Paid Webhook.
  4. Click Continue.

Fill in the webhook form with your Alpaca settings:

  • Source (from): TradingView
  • Platform (to): Alpaca
  • Quantity Multiplier: Absolute
  • API Mode: Demo for Alpaca Paper Account
  • API Key: paste your Alpaca API key
  • API Secret: paste your Alpaca API secret

Then click Add Trial Webhook or create the selected paid webhook.

Create Alpaca webhook in AlgoWay

Step 4: Send a Test Webhook from AlgoWay

Before connecting TradingView, you can send a test webhook from AlgoWay to confirm that the Alpaca connection works.

  1. Open Webhook Logs in AlgoWay.
  2. Click Test Webhook.
  3. Select your Alpaca webhook from the dropdown.
  4. Use a stock symbol such as AAPL or TSLA.
  5. Set the quantity and action.
  6. Click Send.

Example test JSON:

{
  "platform_name": "alpaca",
  "symbol": "AAPL",
  "order_action": "buy",
  "order_contracts": 1
}
Send Alpaca test webhook from AlgoWay

Step 5: Create a TradingView Strategy Alert

If you are using a TradingView Strategy, paste the following JSON into the alert message box. AlgoWay expects structured JSON, not plain text.

{
  "platform_name": "alpaca",
  "ticker": "{{ticker}}",
  "order_contracts": "{{strategy.order.contracts}}",
  "order_action": "{{strategy.market_position}}",
  "price": "{{close}}"
}

TradingView will automatically replace these placeholders with real strategy values when the alert is triggered:

  • {{ticker}} — chart ticker
  • {{strategy.order.contracts}} — strategy order size
  • {{strategy.market_position}} — current strategy position
  • {{close}} — current close price
TradingView Alpaca strategy alert JSON

Step 6: Add the AlgoWay Webhook URL in TradingView

In the same TradingView alert window, open the Notifications tab, enable Webhook URL, and paste your AlgoWay webhook link.

Your webhook URL will look like this:

https://algoway.co/your-webhook-uuid

After adding the webhook URL, click Apply or Create to save the alert.

TradingView webhook URL for Alpaca via AlgoWay

Indicator Alerts and Manual Alerts

If you are using an indicator alert instead of a TradingView Strategy alert, you do not have to write the JSON manually.

For indicator-based alerts, use one of the tools available in the AlgoWay Dashboard menu:

  • Message Wizard — helps you build a valid AlgoWay webhook message manually.
  • AlgoWay AI — helps convert a text signal into a valid AlgoWay JSON message.

This is useful when your indicator sends a custom text alert instead of strategy placeholders such as {{strategy.order.contracts}}.

Key takeaway

To automate Alpaca through AlgoWay, you need three things: valid Alpaca API credentials, a properly configured Alpaca webhook in AlgoWay, and a correct TradingView alert with the AlgoWay webhook URL. Once these parts are set correctly, TradingView strategy alerts can be routed directly to Alpaca through AlgoWay.

Need help? Contact support via your AlgoWay dashboard.