trade_log_analysis
Analyze supplied raw trade records for deterministic performance, execution quality, grouping, streaks, data-quality issues and risk patterns.
When to use
Use when an agent needs structured statistics and findings from a trading log or execution history.
Selection guidance
Role: supporting. Use when an agent needs structured statistics and findings from a trading log or execution history.
Use cases
- trade log
- execution history
- trading behavior
- fee analysis
- overtrading
Access
- REST:
POST https://rafid-agent-api.vercel.app/api/v1/trading/trade-log-analysis - x402:
POST https://rafid-agent-api.vercel.app/api/v1/x402/trading/trade-log-analysis - MCP tool:
trade_log_analysis
Price: $0.30 USD per call. Payment options are deployment-configured; inspect /api/v1/payment-methods. Prices and payment semantics are unchanged from the canonical registry.
Get the full result
0.30 USD per call
Pay with USDC · request an x402 challenge
curl -X POST 'https://rafid-agent-api.vercel.app/api/v1/x402/trading/trade-log-analysis' -H 'Content-Type: application/json' --data '{"records":[{"tradeId":"t1","symbol":"BTCUSD","direction":"long","entryTime":"2026-01-01T10:00:00Z","exitTime":"2026-01-01T11:00:00Z","entryPrice":100,"exitPrice":110,"quantity":1,"fees":1,"status":"closed","strategy":"breakout","session":"London"}]}'Authorized x402 client · signed retry request
curl -X POST 'https://rafid-agent-api.vercel.app/api/v1/x402/trading/trade-log-analysis' -H 'Content-Type: application/json' -H 'PAYMENT-SIGNATURE: <PAYMENT_SIGNATURE_FROM_AUTHORIZED_CLIENT>' -H 'X-Rafid-Payment-Journey: <PAYMENT_JOURNEY_FROM_CHALLENGE>' -H 'Idempotency-Key: <UNIQUE_REQUEST_ID>' --data '{"records":[{"tradeId":"t1","symbol":"BTCUSD","direction":"long","entryTime":"2026-01-01T10:00:00Z","exitTime":"2026-01-01T11:00:00Z","entryPrice":100,"exitPrice":110,"quantity":1,"fees":1,"status":"closed","strategy":"breakout","session":"London"}]}'Use an x402-compatible client to parse PAYMENT-REQUIRED and authorize payment before retrying the same input with PAYMENT-SIGNATURE. Copying a request does not pay.
No crypto wallet? Use Rafid Credits
curl -X POST 'https://rafid-agent-api.vercel.app/api/v1/trading/trade-log-analysis' -H 'Content-Type: application/json' -H 'Authorization: Bearer <RAFID_API_KEY>' -H 'X-Rafid-Payment-Method: credits' -H 'Idempotency-Key: <UNIQUE_REQUEST_ID>' -H 'X-Rafid-Payment-Journey: <PAYMENT_JOURNEY_FROM_CHALLENGE>' --data '{"records":[{"tradeId":"t1","symbol":"BTCUSD","direction":"long","entryTime":"2026-01-01T10:00:00Z","exitTime":"2026-01-01T11:00:00Z","entryPrice":100,"exitPrice":110,"quantity":1,"fees":1,"status":"closed","strategy":"breakout","session":"London"}]}'Create an API key instantly via POST https://rafid-agent-api.vercel.app/api/v1/account/signup or at https://rafid-agent-api.vercel.app/get-started, then fund by card (Stripe) or USDC and save with monthly plans ($10–$500/mo).
Existing account balance: GET https://rafid-agent-api.vercel.app/api/v1/account/balance.
MCP Credits integration
POST https://rafid-agent-api.vercel.app/mcp/credits
Authorization: Bearer <OAUTH_ACCESS_TOKEN>
Idempotency-Key: <UNIQUE_REQUEST_ID>
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "trade_log_analysis",
"arguments": {
"records": [
{
"tradeId": "t1",
"symbol": "BTCUSD",
"direction": "long",
"entryTime": "2026-01-01T10:00:00Z",
"exitTime": "2026-01-01T11:00:00Z",
"entryPrice": 100,
"exitPrice": 110,
"quantity": 1,
"fees": 1,
"status": "closed",
"strategy": "breakout",
"session": "London"
}
]
}
}
}OAuth metadata: authorization server · protected resource. Operator authorization and an existing funded account are required; OAuth does not grant credits.
Payment instructions and onboarding · API docs and schemas
These are copyable API integration requests. They do not open a checkout or execute a paid tool.
Related tools
Example input
{
"records": [
{
"tradeId": "t1",
"symbol": "BTCUSD",
"direction": "long",
"entryTime": "2026-01-01T10:00:00Z",
"exitTime": "2026-01-01T11:00:00Z",
"entryPrice": 100,
"exitPrice": 110,
"quantity": 1,
"fees": 1,
"status": "closed",
"strategy": "breakout",
"session": "London"
}
]
}Example output
{
"summary": {
"totalTrades": 1,
"closedTrades": 1,
"openTrades": 0,
"wins": 1,
"losses": 0,
"netPnl": 9,
"fees": 1,
"maxWinningStreak": 1,
"maxLosingStreak": 0,
"averageHoldingDurationSeconds": 3600
},
"performanceBySymbol": [],
"performanceByStrategy": [],
"performanceBySession": [],
"executionMetrics": {
"completeRecords": 1,
"malformedRecords": 0,
"duplicateTradeIds": [],
"outOfOrderTimestamps": 0,
"missingPrices": 0
},
"behavioralPatterns": [],
"anomalies": [],
"riskFlags": [],
"dataQuality": {
"completeTradeCount": 1,
"incompleteTradeCount": 0,
"warnings": []
}
}Input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"records": {
"maxItems": 100000,
"type": "array",
"items": {}
},
"accountEquity": {
"type": "number",
"minimum": 0
},
"duplicateTradeIdPolicy": {
"type": "string",
"enum": [
"flag",
"deduplicate"
]
}
},
"required": [
"records"
],
"additionalProperties": false
}Output schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"summary": {
"type": "object",
"properties": {
"totalTrades": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"closedTrades": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"openTrades": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"wins": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"losses": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"netPnl": {
"type": [
"number",
"null"
]
},
"fees": {
"type": [
"number",
"null"
]
},
"maxWinningStreak": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"maxLosingStreak": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"averageHoldingDurationSeconds": {
"type": [
"number",
"null"
]
}
},
"required": [
"totalTrades",
"closedTrades",
"openTrades",
"wins",
"losses",
"netPnl",
"fees",
"maxWinningStreak",
"maxLosingStreak",
"averageHoldingDurationSeconds"
],
"additionalProperties": false
},
"performanceBySymbol": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"trades": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"wins": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"losses": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"netPnl": {
"type": [
"number",
"null"
]
},
"fees": {
"type": [
"number",
"null"
]
},
"winRate": {
"type": [
"number",
"null"
]
}
},
"required": [
"key",
"trades",
"wins",
"losses",
"netPnl",
"fees",
"winRate"
],
"additionalProperties": false
}
},
"performanceByStrategy": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"trades": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"wins": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"losses": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"netPnl": {
"type": [
"number",
"null"
]
},
"fees": {
"type": [
"number",
"null"
]
},
"winRate": {
"type": [
"number",
"null"
]
}
},
"required": [
"key",
"trades",
"wins",
"losses",
"netPnl",
"fees",
"winRate"
],
"additionalProperties": false
}
},
"performanceBySession": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"trades": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"wins": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"losses": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"netPnl": {
"type": [
"number",
"null"
]
},
"fees": {
"type": [
"number",
"null"
]
},
"winRate": {
"type": [
"number",
"null"
]
}
},
"required": [
"key",
"trades",
"wins",
"losses",
"netPnl",
"fees",
"winRate"
],
"additionalProperties": false
}
},
"executionMetrics": {
"type": "object",
"properties": {
"completeRecords": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"malformedRecords": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"duplicateTradeIds": {
"type": "array",
"items": {
"type": "string"
}
},
"outOfOrderTimestamps": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"missingPrices": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"completeRecords",
"malformedRecords",
"duplicateTradeIds",
"outOfOrderTimestamps",
"missingPrices"
],
"additionalProperties": false
},
"behavioralPatterns": {
"type": "array",
"items": {
"type": "string"
}
},
"anomalies": {
"type": "array",
"items": {
"type": "string"
}
},
"riskFlags": {
"type": "array",
"items": {
"type": "string"
}
},
"dataQuality": {
"type": "object",
"properties": {
"completeTradeCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"incompleteTradeCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"completeTradeCount",
"incompleteTradeCount",
"warnings"
],
"additionalProperties": false
},
"sourceTraceability": {
"type": "object",
"properties": {
"strategyPerformance": {
"type": "string",
"enum": [
"GROK",
"SIGNALFLOW",
"MERGED",
"NEW"
]
},
"tradeRisk": {
"type": "string",
"enum": [
"GROK",
"SIGNALFLOW",
"MERGED",
"NEW"
]
},
"portfolioExposure": {
"type": "string",
"enum": [
"GROK",
"SIGNALFLOW",
"MERGED",
"NEW"
]
},
"tradeLog": {
"type": "string",
"enum": [
"GROK",
"SIGNALFLOW",
"MERGED",
"NEW"
]
},
"notes": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"strategyPerformance",
"tradeRisk",
"portfolioExposure",
"tradeLog",
"notes"
],
"additionalProperties": false
}
},
"required": [
"summary",
"performanceBySymbol",
"performanceByStrategy",
"performanceBySession",
"executionMetrics",
"behavioralPatterns",
"anomalies",
"riskFlags",
"dataQuality"
],
"additionalProperties": false
}Category: Trading Intelligence · hierarchy: supporting · idempotent: yes · side effects: no