Home  ›  SignalPipe  ›  Documentation  ›  How It Works

How It Works

How SignalPipe Works

SignalPipe connects TradingView to Alpaca through a four-step execution pipeline. Every step is automated -- once configured, no manual intervention is required.

The Execution Flow

Step 1: Signal Detection

The vyn premium Pine Script strategy runs on your TradingView charts, monitoring price action across your selected stock tickers. When the strategy's technical analysis detects a buy or sell condition, it fires an alert.

Step 2: Webhook Delivery

TradingView sends an HTTP POST request to the Blockresearch SignalPipe endpoint. The webhook payload contains:

FieldDescriptionExample
tickerThe stock or crypto symbolAAPL or BTCUSD
actionBuy or sellbuy
quantityNumber of shares or units10
pointerYour unique authentication tokena7f3...
prev_positionPrevious position stateflat or long
The webhook URL format is:
https://europe-west3-blockalgo-quant.cloudfunctions.net/alpacaWebhook

Step 3: Authentication and Processing

SignalPipe receives the alert and performs the following checks in order:

  1. Pointer authentication -- Looks up the user by their unique webhook pointer (stored as signalPipeSecret in the database). If no matching user is found, the request is rejected.
  2. Subscription check -- Verifies that the user has an active SignalPipe or vyn premium subscription. Without an active subscription, signals are logged but skipped.
  3. Account routing -- Determines which Alpaca account to use (paper or live) based on the user's default view mode or an explicit account field in the payload.
  4. Automation check -- Verifies that the target Alpaca account is connected and automation is enabled. If either is off, the signal is logged but skipped.
  5. Market hours check -- For live mode stock orders, verifies the US market is open (extended hours: Mon-Fri 4:00 AM - 8:00 PM ET). Crypto symbols trade 24/7 and bypass this check. Paper mode also bypasses this check.
  6. Quote currency conversion -- If configured, converts crypto ticker suffixes to match Alpaca's format (e.g. BTCUSDT to BTCUSD).
  7. Action routing -- Routes to the buy handler or sell handler based on the action field.

Step 4: Order Execution on Alpaca

The appropriate handler places orders on your Alpaca account:

  • Buy signals open new deals or add safety orders to existing positions
  • Sell signals close positions and record realized P&L

All buy orders are placed as market orders for immediate execution. Take-profit orders are placed as limit sell orders.

Important: SignalPipe always returns HTTP 200 to TradingView, even when an error occurs internally. This prevents TradingView from retrying alerts, which could cause duplicate orders. All errors are logged to the activity log on your dashboard.

This is a static view of a single section. For full search and interactivity visit the docs app. Open interactive docs →