

/api/v1/forward/trades/{id}Close an open forward trade at market, or cancel it when it is still an unfilled order. The exit price comes from the last completed 1-minute close and the realized P&L is recomputed server-side from the stored entry, so no price is accepted. Returns the closed trade. 404 if it does not exist or is not yours.
| Name | In | Type | Req. | Description |
|---|---|---|---|---|
| id | path | string | yes | The forward trade id to close or cancel. |
curl -X DELETE -H "Authorization: Bearer afx_live_xxx" \
"https://www.analytics-fx.com/api/v1/forward/trades/value"{
"apiVersion": "v1",
"data": {
"id": "9b8a...", "accountId": "7c1d...", "symbol": "EURUSD", "side": "long",
"orderType": "market", "status": "closed", "size": 0.5,
"entryPrice": 1.0821, "exitPrice": 1.0864, "stopLoss": 1.0835, "takeProfit": 1.09,
"pnl": 215, "floatingPnl": null, "currentPrice": null, "pricedAt": null,
"usedMargin": null, "takeProfitLadder": [], "breakEvenTrigger": null,
"openedAt": "2026-08-27T09:41:00.000Z", "closedAt": "2026-08-27T14:02:00.000Z",
"notes": "moved to break-even", "confluences": null
},
"meta": { "requestId": "req_fw06", "credits": { "cost": 1, "remaining": 972 } }
}DELETE /api/v1/forward/trades/Create a key at /dashboard/api. The key stays in your browser.