Upscale
Menu
On this page

Obtener estadísticas de trading de la cuenta del trader

Probar ↓
GET/accounts/{accountId}/stats
Obtener estadísticas de trading de la cuenta del traderCuentas

Agregados 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.
URL base https://api.upscale.trade

Autorización

bearerhttp · bearerobligatorio

Clave de API personal, con el prefijo usk_.

Parámetros

Ruta
accountIdstring · uuidobligatorio

Identificador de la cuenta del trader. Debe pertenecer al solicitante.

Ejemplo: 00000000-0000-4000-8000-000000000000

Ejemplos

curl --request GET 'https://api.upscale.trade/accounts/{accountId}/stats' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Respuestas

200Respuestaapplication/json

Body.riskRewardRatio must be array Body.maxDrawdownPercent must be array Body.avgLeverageProfitablePosition must be array

sumPnlstring · int32obligatorio

Realised pnl summed over every closed position, fp9 raw, before fees and funding.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
sumFeestring · int32obligatorio

Trading fees paid over every closed position, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
sumFundingstring · int32obligatorio

Funding settled over every closed position, fp9 raw. Positive when the account received more than it paid.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
profitstring · int32obligatorio

Net 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)$
Ejemplo: 1000000000
positionsCountnumberobligatorio

Number of closed positions the statistics are built from.

Ejemplo: 0
profitablePositionsCountnumberobligatorio

Closed positions that ended at or above break-even.

Ejemplo: 0
unprofitablePositionsCountnumberobligatorio

Closed positions that ended below break-even.

Ejemplo: 0
winratePercentnumberobligatorio

Share of closed positions that ended at or above break-even, in percent with two decimals.

Ejemplo: 62.5
minProfitstring · int32 · nullableobligatorio

Smallest win among profitable positions, fp9 raw. Null when there is none.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
minLossstring · int32 · nullableobligatorio

Smallest loss among losing positions, fp9 raw (negative, closest to zero). Null when there is none.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
maxProfitstring · int32 · nullableobligatorio

Largest win, fp9 raw. Null when no position ended in profit.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
maxLossstring · int32 · nullableobligatorio

Largest loss, fp9 raw (the most negative value). Null when no position ended in loss.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
avgProfitstring · int32 · nullableobligatorio

Average win across profitable positions, fp9 raw. Null when there is none.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
avgLossstring · int32 · nullableobligatorio

Average loss across losing positions, fp9 raw (negative). Null when there is none.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
riskRewardRationumber[]obligatorio

Average win over the absolute average loss. Null while no losing position exists to divide by.

Elementos del array · number

number

maxDrawdownPercentnumber[]obligatorio

Deepest equity drawdown of the account across all its phases, in percent with two decimals.

Elementos del array · number

number

avgLongPositionHoldTimenumber[]obligatorio

Average holding time of long positions, in seconds.

Elementos del array · number

number

Ver ejemplo
[
  0
]
avgShortPositionHoldTimenumber[]obligatorio

Average holding time of short positions, in seconds.

Elementos del array · number

number

Ver ejemplo
[
  0
]
avgPositionHoldTimenumber[]obligatorio

Average holding time across all closed positions, in seconds.

Elementos del array · number

number

Ver ejemplo
[
  0
]
medianPositionHoldTimenumber[]obligatorio

Median holding time across all closed positions, in seconds.

Elementos del array · number

number

Ver ejemplo
[
  0
]
maxProfitablePositionHoldTimenumber[]obligatorio

Longest a profitable position was held, in seconds.

Elementos del array · number

number

Ver ejemplo
[
  0
]
maxUnprofitablePositionHoldTimenumber[]obligatorio

Longest a losing position was held, in seconds.

Elementos del array · number

number

Ver ejemplo
[
  0
]
medianProfitablePositionHoldTimenumber[]obligatorio

Median holding time of profitable positions, in seconds.

Elementos del array · number

number

Ver ejemplo
[
  0
]
medianUnprofitablePositionHoldTimenumber[]obligatorio

Median holding time of losing positions, in seconds.

Elementos del array · number

number

Ver ejemplo
[
  0
]
avgLeverageProfitablePositionnumber[]obligatorio

Average leverage of profitable positions — notional over margin, as a plain multiple.

Elementos del array · number

number

avgLeverageUnprofitablePositionnumber[]obligatorio

Average leverage of losing positions — notional over margin, as a plain multiple.

Elementos del array · number

number

topMarketstring[]obligatorio

Base asset ticker of the most traded market, by number of closed positions. Null when nothing has been closed.

Elementos del array · string

string

topMarketPercentnumber[]obligatorio

Share of closed positions that were on topMarket, in percent with two decimals.

Elementos del array · number

number

401

No autorizado

403

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).

404

No hay ninguna cuenta con este identificador.

429

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.