API Trades
📋 Lister les Trades
GET /api/trades
Authorization: Bearer {token}
Paramètres de Query
| Paramètre | Type | Description |
|---|---|---|
| page | number | Numéro de page (défaut: 1) |
| limit | number | Résultats par page (défaut: 20) |
| instrument | string | Filtrer par instrument |
| dateFrom | ISO date | Date de début |
| dateTo | ISO date | Date de fin |
| status | string | open, closed, all |
Réponse
{
"trades": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 145,
"pages": 8
}
}
➕ Créer un Trade
POST /api/trades
Authorization: Bearer {token}
Content-Type: application/json
{
"instrument": "EUR/USD",
"direction": "long",
"entryPrice": 1.0850,
"positionSize": 0.5,
"stopLoss": 1.0820,
"takeProfit": 1.0910,
"entryTime": "2025-01-15T09:30:00Z",
"setupType": "breakout",
"notes": "Breakout sur résistance H4"
}
📖 Obtenir un Trade
GET /api/trades/{id}
Authorization: Bearer {token}
✏️ Mettre à Jour un Trade
PATCH /api/trades/{id}
Authorization: Bearer {token}
Content-Type: application/json
{
"exitPrice": 1.0895,
"exitTime": "2025-01-15T14:45:00Z",
"result": 225.00,
"notes": "Sortie sur signal de renversement"
}
🗑️ Supprimer un Trade
DELETE /api/trades/{id}
Authorization: Bearer {token}
📊 Statistiques
GET /api/trades/statistics
Authorization: Bearer {token}
Réponse
{
"totalTrades": 145,
"winRate": 62.4,
"profitFactor": 1.85,
"expectancy": 0.65,
"maxDrawdown": 12.3,
"totalPnL": 2450.00
}