

/api/v1/backtests/{id}/tradesAppend trades to one of your existing backtests (by id). JSON body. Owner-scoped: 404 if the backtest does not exist or is not yours. Unknown fields are ignored; inputs are validated and clamped. Trade times (openedAt/closedAt) accept ISO-8601 or epoch milliseconds. Returns the updated backtest with its full trade list. Backtests themselves are created in the app, not via the API.
| Name | In | Type | Req. | Description |
|---|---|---|---|---|
| id | path | string | yes | The backtest id to append trades to (from the list endpoint). |
| trades | body | array | yes | Trades: [{ side: 'long'|'short', size, entryPrice?, exitPrice?, stopLoss?, takeProfit?, pnl?, openedAt?, closedAt? }]. |
curl -X POST -H "Authorization: Bearer afx_live_xxx" \
-H "Content-Type: application/json" \
-d '{"trades":"value"}' \
"https://www.analytics-fx.com/api/v1/backtests/value/trades"{
"apiVersion": "v1",
"data": {
"id": "3f2a...", "symbol": "EURUSD", "name": "London breakout", "timeframe": "1h",
"startingBalance": 10000, "leverage": 100, "createdAt": "2026-07-26T20:40:00.000Z",
"stats": { "trades": 1, "netPnl": 195, "winRate": 100, "profitFactor": 99.99 },
"trades": [
{ "side": "long", "size": 0.5, "entryPrice": 1.0821, "exitPrice": 1.086,
"stopLoss": 1.08, "takeProfit": 1.09, "pnl": 195,
"openedAt": "2026-06-10T08:00:00.000Z", "closedAt": "2026-06-10T13:20:00.000Z" }
]
},
"meta": { "requestId": "req_bt02", "credits": { "cost": 2, "remaining": 978 } }
}POST /api/v1/backtests//tradesCreate a key at /dashboard/api. The key stays in your browser.