APISessionsSessionCompletion
Finish a session and get its statistics
Authorization
ApiKeyAuth x-api-key<token>
In: header
Path Parameters
id*string
Query Parameters
breakEvenThreshold?|
Range
0 <= value <= 1000000000Default
0Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/sessions/string/finish"{ "session": { "id": "string", "projectId": "string", "name": "string", "mode": "manual", "status": "active", "source": "web", "initialBalance": 0, "accountCurrency": "string", "strategy": "string", "description": "string", "layoutTemplate": "1", "assets": [ { "id": "string", "sessionId": "string", "symbol": "string", "feed": "binance-spot", "timeframe": "1m", "calendarCode": "string", "executionCostConfig": { "spread": 0, "slippage": 0, "fees": { "entryFee": 0, "exitFee": 0, "type": "percent" } }, "contractPolicy": { "kind": "spot" }, "position": 0, "createdAt": 0 } ], "feesConfig": { "entryFee": 0, "exitFee": 0, "type": "percent" }, "rangeStart": 0, "rangeEnd": 0, "randomSourceStart": 0, "randomSourceEnd": 0, "randomSeed": 0, "blindMode": true, "smoothCandles": true, "accountTimezone": "string", "startedAt": 0, "endedAt": 0, "createdAt": 0, "updatedAt": 0 }, "stats": { "calculationVersion": "2.2.0", "tradeCount": 0, "winCount": 0, "lossCount": 0, "breakEvenCount": 0, "breakEvenThreshold": 0, "winrate": 0, "plGross": 0, "feesPaid": 0, "plNet": 0, "plNetPct": 0, "avgPlPerTrade": 0, "avgPlPctPerTrade": 0, "avgRMultiple": 0, "maxRMultiple": 0, "avgWin": 0, "avgLoss": 0, "winLossRatio": 0, "profitFactor": 0, "netProfitFactor": 0, "expectancy": 0, "expectancyComponents": { "winProbability": 0, "lossProbability": 0, "breakEvenProbability": 0, "avgBreakEven": 0, "winContribution": 0, "lossContribution": 0, "breakEvenContribution": 0 }, "tradesPerDay": 0, "tradesPerWeek": 0, "tradesPerMonth": 0, "avgDurationMs": 0, "avgWinDurationMs": 0, "avgLossDurationMs": 0, "maxWinStreak": 0, "maxLossStreak": 0, "avgWinStreak": 0, "avgLossStreak": 0, "bestWinPct": 0, "worstLossPct": 0, "avgWinPct": 0, "avgLossPct": 0, "maxDrawdown": 0, "maxDrawdownPct": 0, "equityCurve": [ { "time": 0, "equity": 0 } ], "plPctDistribution": [ { "from": 0, "to": 0, "count": 0 } ], "idealRAnalysis": { "state": "ready", "reason": "session-active", "analytics": { "horizonMs": 1, "thresholdR": 1, "totalTrades": 0, "eligibleTrades": 0, "measuredTrades": 0, "incompleteTrades": 0, "invalidRiskTrades": 0, "losingMeasuredTrades": 0, "averageIdealR": 0, "maxIdealR": 0, "couldHaveProfitBreakEvenCount": 0, "couldHaveProfitBreakEvenRate": 0, "observations": [ { "tradeId": "string", "status": "complete", "idealR": 0, "bestPrice": 0, "windowStartTime": 0, "targetEndTime": 0, "observedEndTime": 0, "couldHaveProfitBreakEven": true } ] }, "markets": [ { "symbol": "string", "feed": "string", "sourceTimeframe": "string", "analysisTimeframe": "1m", "approximateEntryBar": true, "requestedBars": 0, "loadedBars": 0 } ] } }}