Skip to content
Algo Trade Analytics Docs

Integration Architecture

This guide outlines the technical data flow between TradingView strategy intent and broker execution. The system is designed to isolate variables across the signal-to-fill pipeline.

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 broker-specific execution intents.
  4. Broker Synchronization: Actual fill reports are retrieved from Alpaca via OAuth or secure API key synchronization. Basic & Pro
  5. Reconciliation: The matching engine pairs signals with fills based on symbol, timestamp, and logical direction.

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

  • Signal Price: The marketPrice recorded at the exact moment the alert was triggered.
  • Intended Price: The execution target derived from the orderType (e.g., limitPrice or stopPrice).
  • Actual Price: The average fill price as reported by the broker’s execution 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).
  • Execution Slippage: Variance between the intended entry and the actual fill price (Broker execution performance).

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.00,
"setupCost": 0.75,
"executionQuality": "good"
},
"validation": { "valid": true, "warnings": [] }
}