Scope & Matching Engine
The Scope Definition section configures your analysis parameters, and the Matching Engine pairs your alert signals with broker fills. Understanding these systems helps you get accurate results.
Scope Configuration
Section titled “Scope Configuration”Symbol Selection
Section titled “Symbol Selection”Choose which trading instrument to analyze:
| Option | Description |
|---|---|
| Specific Symbol | Analyze one instrument (e.g., TSLA, SPY) |
| ALL | Aggregate view across all traded symbols |
Date Range
Section titled “Date Range”Select the time window for your analysis:
| Component | Description |
|---|---|
| Start Date | Beginning of analysis window |
| End Date | End of analysis window |
| Start Time | Optional: specific time on start date |
| End Time | Optional: specific time on end date |
Recommended ranges:
| Use Case | Range |
|---|---|
| Daily monitoring | Last 24 hours |
| Weekly review | Last 7 days |
| Performance audit | Last 30 days |
| Issue investigation | Specific date/time |
Data Source
Section titled “Data Source”Using Webhook Data
Section titled “Using Webhook Data”Best for: Active strategies with real-time alert capture.
When selected:
- Fetches alert events from your webhook history
- Filters to the specified symbol and date range
- Provides millisecond-precision timestamps
Requirements:
- Webhook endpoint configured and active
- TradingView alerts sending to your webhook
- Alert history exists for the selected period
Using CSV Import
Section titled “Using CSV Import”Best for: Historical analysis or external alert sources.
When selected:
- Upload zone appears for your alert data
- Supports drag-and-drop or paste
- Validates format and timestamps
CSV Format:
timestamp,symbol,price,side,type2024-01-15T09:30:00Z,TSLA,245.50,buy,entry2024-01-15T14:45:00Z,TSLA,248.20,sell,exitMatching Engine
Section titled “Matching Engine”The matching engine pairs your alert signals with broker fills based on configurable tolerances.
How Matching Works
Section titled “How Matching Works”-
Time Window Filtering
For each alert, identify broker fills within the time tolerance:
alert_time to (alert_time + time_window) -
Symbol Matching
Only pair alerts and fills for the same trading symbol.
-
Direction Matching
Match buy alerts with buy fills, sell alerts with sell fills.
-
Best Match Selection
If multiple fills qualify, select based on:
- Closest timestamp (primary)
- Smallest price difference (secondary)
-
Classification
Each pair is classified:
- Full Match — Entry and exit both matched
- Entry Only — Entry matched, exit missing
- Exit Only — Exit matched, entry missing
- Unmatched — No corresponding fill found
Matching Configuration
Section titled “Matching Configuration”| Setting | Default | Description |
|---|---|---|
| Time Window | 5 minutes | Max delay from alert to fill |
| Price Tolerance | 2% | Acceptable price difference |
Adjusting tolerances:
| Scenario | Time Window | Price Tolerance |
|---|---|---|
| High-frequency | 30 seconds | 0.5% |
| Standard trading | 5 minutes | 2% |
| Position trading | 30 minutes | 5% |
| Volatile markets | 10 minutes | 5% |
Understanding Match Types
Section titled “Understanding Match Types”Full Match ✅
Section titled “Full Match ✅”Both the entry and exit signals have corresponding fills.
Alert: Entry Long @ 09:30:00, $100.00Fill: Buy @ 09:30:02, $100.05→ Matched with 2s latency, $0.05 slippage
Alert: Exit Long @ 14:45:00, $105.00Fill: Sell @ 14:45:03, $104.95→ Matched with 3s latency, -$0.05 slippageEntry Only 🟡
Section titled “Entry Only 🟡”Entry executed but exit is missing.
Common causes:
- Exit alert not configured
- Exit order rejected or timed out
- Position still open
Exit Only 🟡
Section titled “Exit Only 🟡”Exit executed but entry wasn’t matched.
Common causes:
- Entry alert missing from dataset
- Position opened outside analysis window
- Manual entry, automated exit
Unmatched Alert ❌
Section titled “Unmatched Alert ❌”Alert fired but no corresponding fill exists.
Common causes:
- Order rejected by broker
- Insufficient buying power
- Market closed
- Network failure
Unmatched Fill ❌
Section titled “Unmatched Fill ❌”Broker fill without a corresponding alert.
Common causes:
- Manual trading outside strategy
- Alerts from different source
- Duplicate order execution
Data Synchronization
Section titled “Data Synchronization”Alert Data Flow
Section titled “Alert Data Flow”TradingView → Webhook → Database → Analysis- Alerts arrive via webhook POST request
- Stored with millisecond precision timestamps
- Available for analysis immediately
Fill Data Flow
Section titled “Fill Data Flow”Alpaca API → Polling/Webhook → Database → Analysis- Fills retrieved from Alpaca trade history
- Updated periodically or via broker webhooks
- May have slight delay from actual execution
Timing Considerations
Section titled “Timing Considerations”| Event | Timestamp Source |
|---|---|
| Alert | Webhook receipt time |
| Order Submitted | Platform timestamp |
| Fill | Broker execution timestamp |
Common Scope Issues
Section titled “Common Scope Issues”No Alerts in Range
Section titled “No Alerts in Range”Symptoms: “0 alerts found” message
Solutions:
- Expand date range
- Check webhook configuration
- Verify TradingView alerts are active
- Switch to CSV import
No Fills in Range
Section titled “No Fills in Range”Symptoms: “0 fills found” message
Solutions:
- Verify Alpaca connection is active
- Check that orders were submitted
- Expand date range
- Check symbol spelling
Symbol Mismatch
Section titled “Symbol Mismatch”Symptoms: Low match rate despite activity
Solutions:
- Verify symbol format consistency
- Check for exchange prefixes (NASDAQ:AAPL vs AAPL)
- Ensure alerts and orders use same symbol
Related Sections
Section titled “Related Sections”- Visual Audit — Chart visualization
- Metrics & Analysis — Understanding results
- Troubleshooting — Common issues