/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
Body.riskRewardRatio must be array Body.maxDrawdownPercent must be array Body.avgLeverageProfitablePosition must be array
sumPnlstring · int32obligatorioRealised pnl summed over every closed position, fp9 raw, before fees and funding.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000sumFeestring · int32obligatorioTrading fees paid over every closed position, fp9 raw.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000sumFundingstring · int32obligatorioFunding settled over every closed position, fp9 raw. Positive when the account received more than it paid.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000profitstring · int32obligatorioNet 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 · int32 · nullableobligatorioSmallest win among profitable positions, fp9 raw. Null when there is none.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000minLossstring · int32 · nullableobligatorioSmallest loss among losing positions, fp9 raw (negative, closest to zero). Null when there is none.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000maxProfitstring · int32 · nullableobligatorioLargest win, fp9 raw. Null when no position ended in profit.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000maxLossstring · int32 · nullableobligatorioLargest loss, fp9 raw (the most negative value). Null when no position ended in loss.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000avgProfitstring · int32 · nullableobligatorioAverage win across profitable positions, fp9 raw. Null when there is none.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000avgLossstring · int32 · nullableobligatorioAverage loss across losing positions, fp9 raw (negative). Null when there is none.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000riskRewardRationumber[]obligatorioAverage win over the absolute average loss. Null while no losing position exists to divide by.
Elementos del array · number
number
maxDrawdownPercentnumber[]obligatorioDeepest equity drawdown of the account across all its phases, in percent with two decimals.
Elementos del array · number
number
avgLongPositionHoldTimenumber[]obligatorioAverage holding time of long positions, in seconds.
Elementos del array · number
number
Ver ejemplo
[
0
]avgShortPositionHoldTimenumber[]obligatorioAverage holding time of short positions, in seconds.
Elementos del array · number
number
Ver ejemplo
[
0
]avgPositionHoldTimenumber[]obligatorioAverage holding time across all closed positions, in seconds.
Elementos del array · number
number
Ver ejemplo
[
0
]medianPositionHoldTimenumber[]obligatorioMedian holding time across all closed positions, in seconds.
Elementos del array · number
number
Ver ejemplo
[
0
]maxProfitablePositionHoldTimenumber[]obligatorioLongest a profitable position was held, in seconds.
Elementos del array · number
number
Ver ejemplo
[
0
]maxUnprofitablePositionHoldTimenumber[]obligatorioLongest a losing position was held, in seconds.
Elementos del array · number
number
Ver ejemplo
[
0
]medianProfitablePositionHoldTimenumber[]obligatorioMedian holding time of profitable positions, in seconds.
Elementos del array · number
number
Ver ejemplo
[
0
]medianUnprofitablePositionHoldTimenumber[]obligatorioMedian holding time of losing positions, in seconds.
Elementos del array · number
number
Ver ejemplo
[
0
]avgLeverageProfitablePositionnumber[]obligatorioAverage leverage of profitable positions — notional over margin, as a plain multiple.
Elementos del array · number
number
avgLeverageUnprofitablePositionnumber[]obligatorioAverage leverage of losing positions — notional over margin, as a plain multiple.
Elementos del array · number
number
topMarketstring[]obligatorioBase asset ticker of the most traded market, by number of closed positions. Null when nothing has been closed.
Elementos del array · string
string
topMarketPercentnumber[]obligatorioShare of closed positions that were on topMarket, in percent with two decimals.
Elementos del array · number
number
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.