Open Backtest Docs
APISessionsSessionCompletion

Finish a session and get its statistics

POST
/sessions/{id}/finish

Authorization

ApiKeyAuth
x-api-key<token>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/sessions/uuid/finish"
{  "session": {    "id": "string",    "projectId": "string",    "name": "string",    "mode": "manual",    "status": "active",    "source": "web",    "initialBalance": 0,    "feesConfig": {      "entryFee": 0,      "exitFee": 0,      "type": "percent"    },    "startedAt": 0,    "endedAt": 0,    "createdAt": 0,    "updatedAt": 0  },  "stats": {    "tradeCount": 0,    "winCount": 0,    "lossCount": 0,    "breakEvenCount": 0,    "winrate": 0,    "plGross": 0,    "feesPaid": 0,    "plNet": 0,    "plNetPct": 0,    "avgPlPerTrade": 0,    "avgPlPctPerTrade": 0,    "avgRMultiple": 0,    "profitFactor": 0,    "expectancy": 0,    "tradesPerDay": 0,    "avgDurationMs": 0,    "maxWinStreak": 0,    "maxLossStreak": 0,    "maxDrawdown": 0,    "maxDrawdownPct": 0,    "equityCurve": [      {        "time": 0,        "equity": 0      }    ],    "plPctDistribution": [      {        "from": 0,        "to": 0,        "count": 0      }    ]  }}
{  "error": {    "code": "NOT_FOUND",    "message": "Session not found"  }}
{  "error": {    "code": "NOT_FOUND",    "message": "Session not found"  }}
{  "error": {    "code": "NOT_FOUND",    "message": "Session not found"  }}