/accounts/{accountId}/statsAgregados sobre las posiciones cerradas de la cuenta: tasa de aciertos, beneficio y pérdida promedio, ratio riesgo-beneficio, drawdown máximo y tiempos de tenencia promedio.
- Responde con un cuerpo vacío mientras la cuenta aún no tiene posiciones cerradas.
- Cubre cada fase por la que ha pasado la cuenta, no solo la actual.
https://api.upscale.tradeParámetros
accountIdstring · uuidobligatorioIdentificador de la cuenta del trader. Debe pertenecer al solicitante.
00000000-0000-4000-8000-000000000000Ejemplos
curl --request GET 'https://api.upscale.trade/accounts/{accountId}/stats' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY'const response = await fetch("https://api.upscale.trade/accounts/{accountId}/stats", {
method: "GET",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
});
console.log(response.status, await response.text());import requests
response = requests.request(
"GET",
"https://api.upscale.trade/accounts/{accountId}/stats",
headers={"Accept":"application/json","Authorization":"Bearer YOUR_API_KEY"},
timeout=30,
)
print(response.status_code, response.text)Respuestas
200Respuestaapplication/json
sumPnlstring · fp9obligatorioRealised pnl summed over every closed position, fp9 raw, before fees and funding.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000sumFeestring · fp9obligatorioTrading fees paid over every closed position, fp9 raw.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000sumFundingstring · fp9obligatorioFunding settled over every closed position, fp9 raw. Positive when the account received more than it paid.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000profitstring · fp9obligatorioNet result of the closed positions, fp9 raw: pnl minus fees plus funding. This is what the win rate splits on.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000positionsCountnumberobligatorioNumber of closed positions the statistics are built from.
0profitablePositionsCountnumberobligatorioClosed positions that ended at or above break-even.
0unprofitablePositionsCountnumberobligatorioClosed positions that ended below break-even.
0winratePercentnumberobligatorioShare of closed positions that ended at or above break-even, in percent with two decimals.
62.5minProfitstring · fp9 · nullableobligatorioSmallest win among profitable positions, fp9 raw. Null when there is none.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000minLossstring · fp9 · nullableobligatorioSmallest loss among losing positions, fp9 raw (negative, closest to zero). Null when there is none.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000maxProfitstring · fp9 · nullableobligatorioLargest win, fp9 raw. Null when no position ended in profit.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000maxLossstring · fp9 · nullableobligatorioLargest loss, fp9 raw (the most negative value). Null when no position ended in loss.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000avgProfitstring · fp9 · nullableobligatorioAverage win across profitable positions, fp9 raw. Null when there is none.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000avgLossstring · fp9 · nullableobligatorioAverage loss across losing positions, fp9 raw (negative). Null when there is none.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000riskRewardRationumber · nullableobligatorioAverage win over the absolute average loss. Null while no losing position exists to divide by.
1.8maxDrawdownPercentnumber · nullableobligatorioDeepest equity drawdown of the account across all its phases, in percent with two decimals.
12.34avgLongPositionHoldTimenumber · nullableobligatorioAverage holding time of long positions, in seconds.
0avgShortPositionHoldTimenumber · nullableobligatorioAverage holding time of short positions, in seconds.
0avgPositionHoldTimenumber · nullableobligatorioAverage holding time across all closed positions, in seconds.
0medianPositionHoldTimenumber · nullableobligatorioMedian holding time across all closed positions, in seconds.
0maxProfitablePositionHoldTimenumber · nullableobligatorioLongest a profitable position was held, in seconds.
0maxUnprofitablePositionHoldTimenumber · nullableobligatorioLongest a losing position was held, in seconds.
0medianProfitablePositionHoldTimenumber · nullableobligatorioMedian holding time of profitable positions, in seconds.
0medianUnprofitablePositionHoldTimenumber · nullableobligatorioMedian holding time of losing positions, in seconds.
0avgLeverageProfitablePositionnumber · nullableobligatorioAverage leverage of profitable positions — notional over margin, as a plain multiple.
12avgLeverageUnprofitablePositionnumber · nullableobligatorioAverage leverage of losing positions — notional over margin, as a plain multiple.
20topMarketstring · nullableobligatorioBase asset ticker of the most traded market, by number of closed positions. Null when nothing has been closed.
BTCtopMarketPercentnumber · nullableobligatorioShare of closed positions that were on topMarket, in percent with two decimals.
41.67{
"sumPnl": "1000000000",
"sumFee": "1000000000",
"sumFunding": "1000000000",
"profit": "1000000000",
"positionsCount": 0,
"profitablePositionsCount": 0,
"unprofitablePositionsCount": 0,
"winratePercent": 62.5,
"minProfit": "1000000000",
"minLoss": "1000000000",
"maxProfit": "1000000000",
"maxLoss": "1000000000",
"avgProfit": "1000000000",
"avgLoss": "1000000000",
"riskRewardRatio": 1.8,
"maxDrawdownPercent": 12.34,
"avgLongPositionHoldTime": 0,
"avgShortPositionHoldTime": 0,
"avgPositionHoldTime": 0,
"medianPositionHoldTime": 0,
"maxProfitablePositionHoldTime": 0,
"maxUnprofitablePositionHoldTime": 0,
"medianProfitablePositionHoldTime": 0,
"medianUnprofitablePositionHoldTime": 0,
"avgLeverageProfitablePosition": 12,
"avgLeverageUnprofitablePosition": 20,
"topMarket": "BTC",
"topMarketPercent": 41.67
}No autorizado
La cuenta pertenece a otro usuario (account_access_denied), o la solicitud se autentica con una clave de API mientras api_trading está deshabilitado en la cuenta (api_trading_not_enabled).
No hay ninguna cuenta con este identificador.
Se superó el límite de velocidad de la clave de API (api_key_rate_limit_exceeded). Retry-After indica cuándo volver; el cuerpo incluye el bucket (read / write), la ventana que se activó, su límite y retryAt.