Skip to content

Algo Trade Analytics Integration Guide

Integrate your trading strategies with Algo Trade Analytics for comprehensive signal analysis and execution monitoring.

Algo Trade Analytics processes your webhook signals and provides detailed execution analytics, order analysis, and performance insights.

When you send a webhook to Algo Trade Analytics, you receive enhanced analytics data:

{
"success": true,
"message": "Webhook received and processed successfully",
"webhookEvent": {
"id": "evt_123",
"ticker": "AAPL",
"direction": "long",
"marketPrice": 150.25
},
"analytics": {
"orderType": "stop_limit",
"marketPrice": 150.25,
"intendedPrice": 151.00,
"setupCost": 0.75,
"executionQuality": "good",
"recommendations": ["Consider using limit orders for better price control"]
},
"validation": {
"valid": true,
"warnings": []
}
}

Send webhooks in this format for optimal analytics:

{
"auth_key": "your_auth_key",
"ticker": "AAPL",
"direction": "long",
"orderType": "stop_limit",
"qty": 100,
"marketPrice": 150.25,
"stopPrice": 150.50,
"limitPrice": 151.00,
"metadata": {
"strategy": "Breakout Strategy",
"signal": "Volume Surge",
"timestamp": "2024-01-15T14:30:00Z",
"signalPlatform": "tradingview",
"brokerPlatform": "alpaca"
}
}
  • auth_key - Your unique webhook authentication key
  • ticker - Trading symbol (e.g., “AAPL”)
  • direction - “long” or “short”
  • marketPrice - Current market price
  • orderType - Order type: market, limit, stop, stop_limit, trailing_stop
  • qty - Quantity in shares
  • stopPrice - Stop price for stop orders
  • limitPrice - Limit price for limit orders
  • metadata - Additional strategy information

Algo Trade Analytics stores enhanced data for comprehensive analysis:

{
"ticker": "AAPL",
"direction": "long",
"analytics": {
"orderType": "stop_limit",
"marketPrice": 150.25,
"intendedPrice": 151.00,
"setupCost": 0.75,
"executionQuality": "good",
"recommendations": ["Large stop-limit spread may reduce fill probability"]
},
"platformOrder": {
"symbol": "AAPL",
"side": "buy",
"type": "stop_limit",
"qty": "100",
"stop_price": "150.50",
"limit_price": "151.00"
}
}

📱 Using Analytics Data in Your Application

Section titled “📱 Using Analytics Data in Your Application”
const TradeAnalytics = ({ webhookEvent }) => {
const analytics = webhookEvent.rawPayload?.analytics;
return (
<div>
<h3>Order Analysis</h3>
<p>Order Type: {analytics?.orderType}</p>
<p>Market Price: ${analytics?.marketPrice?.toFixed(2)}</p>
<p>Setup Cost: ${analytics?.setupCost?.toFixed(4)}</p>
<p>Quality: {analytics?.executionQuality}</p>
{analytics?.recommendations?.length > 0 && (
<div>
<h4>Recommendations:</h4>
<ul>
{analytics.recommendations.map((rec, index) => (
<li key={index}>{rec}</li>
))}
</ul>
</div>
)}
</div>
);
};
const AnalyticsDashboard = ({ webhookEvents }) => {
const analyticsData = webhookEvents
.map(event => event.rawPayload?.analytics)
.filter(Boolean);
const avgSetupCost = analyticsData.reduce((sum, a) => sum + (a.setupCost || 0), 0) / analyticsData.length;
const qualityDistribution = analyticsData.reduce((acc, a) => {
acc[a.executionQuality || 'unknown'] = (acc[a.executionQuality || 'unknown'] || 0) + 1;
return acc;
}, {});
return (
<div>
<h2>Strategy Analytics</h2>
<div>Average Setup Cost: ${avgSetupCost.toFixed(4)}</div>
<div>Quality Distribution: {JSON.stringify(qualityDistribution)}</div>
</div>
);
};
Terminal window
curl -X POST https://algo-trade-analytics.com/api/webhooks/your_webhook_key \
-H "Content-Type: application/json" \
-d '{
"auth_key": "your_auth_key",
"ticker": "AAPL",
"direction": "long",
"orderType": "stop_limit",
"qty": 100,
"marketPrice": 150.25,
"stopPrice": 150.50,
"limitPrice": 151.00,
"metadata": {
"strategy": "Breakout Strategy",
"signal": "Volume Surge"
}
}'

Expected Response: Enhanced response with detailed analytics and recommendations.

strategy.entry("Long", strategy.long,
alert_message='{"auth_key":"your_key","ticker":"' + syminfo.ticker + '","direction":"long","orderType":"stop_limit","qty":100,"marketPrice":' + str.tostring(close) + ',"stopPrice":' + str.tostring(high[1]) + ',"limitPrice":' + str.tostring(high[1] * 1.002) + ',"metadata":{"strategy":"Breakout","signal":"High Break","timestamp":"' + str.tostring(time) + '"}}')

Understand exactly where your trading costs come from - setup costs vs execution slippage.

Get order type intelligence and execution quality ratings for every signal.

Ready for multiple brokers (Alpaca, Interactive Brokers, TD Ameritrade).

Receive actionable recommendations for strategy optimization.

Your Algo Trade Analytics integration provides:

Enhanced webhook processing with detailed analytics
Platform-agnostic order format generation
Rich metadata and analytics storage
Comprehensive validation and error handling
Actionable recommendations for optimization

Ready to receive enhanced webhook data with precise cost attribution and execution analytics!