Skip to content
Algo Trade Analytics Docs

Integration Architecture

This guide outlines the technical data flow between TradingView strategy intent, emitted alerts, and external broker fill reports. The system is designed to isolate variables across the signal-to-fill review pipeline; it does not place orders or route broker instructions.

The reconciliation engine utilizes a multi-stage pipeline to quantify performance variance:

  1. Signal Generation: A TradingView strategy initiates an alert containing a structured JSON alert signal.
  2. Ingestion: The Webhook Endpoint captures the signal with millisecond-precision.
  3. Normalization: The Universal Webhook Processor validates the signal and maps positionDirection to normalized intent labels for later matching.
  4. Market Data Loading: Backtest vs Alerts and Algo Lab can load historical stock bars from platform market data when enabled, or from the user’s connected Alpaca account.
  5. Broker Synchronization: Actual fill reports are retrieved from Alpaca via OAuth or secure API key synchronization. Basic or Professional
  6. Reconciliation: The matching engine pairs signals with fills based on symbol, timestamp, and logical direction.

The engine analyzes three primary data points to calculate fill variance:

  • Signal Price: The marketPrice recorded at the exact moment the alert was triggered.
  • Intended Price: The target price derived from the orderType (e.g., limitPrice or stopPrice).
  • Actual Price: The average fill price as reported by the external broker fill report.

To provide actionable insights, the system distinguishes between two primary cost vectors:

  • Setup Cost: Variance between the signal price and the intended entry (Strategy logic choice).
  • Fill Slippage: Variance between the intended entry and the actual fill price reported by the broker.

Custom integrations can utilize the structured analysis returned by the webhook endpoint:

{
"success": true,
"webhookEvent": { "id": "evt_123", "ticker": "AAPL" },
"analytics": {
"orderType": "stop_limit",
"intendedPrice": 151.0,
"setupCost": 0.75,
"executionQuality": "good"
},
"validation": { "valid": true, "warnings": [] }
}