/positions/{accountId}/{asset}/chart-eventsEventos de posición de la cuenta en un mercado dentro de un rango de tiempo, los más recientes primero — los marcadores que dibuja un gráfico.
- Solo se devuelven aumentos, cierres, cierres forzosos y liquidaciones; los cambios de financiación y margen no son eventos de gráfico.
- El rango se da en segundos enteros mediante
executedFromyexecutedTo, ambos inclusive. - Limitado a la fase en la que se encuentra actualmente la cuenta.
https://api.upscale.tradeParámetros
accountIdstring · uuidobligatorioIdentificador de la cuenta del trader. Debe pertenecer al solicitante.
- pattern
- ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
00000000-0000-4000-8000-000000000000assetstringobligatorioTicker del activo base del mercado, tal como lo devuelve GET /v2/markets.
- minLength
- 1
BTCexecutedFromnumberobligatorioEjecutado desde, marca de tiempo Unix en segundos (inclusive)
1735689600executedTonumberobligatorioEjecutado hasta, marca de tiempo Unix en segundos (inclusive)
1767225599limitintegeropcionalTamaño de página: cuántos eventos devolver.
Predeterminado: 20
- minimum
- 1
- maximum
- 1000
20offsetintegeropcionalCuántos eventos omitir antes de la página.
Predeterminado: 0
- minimum
- 0
- maximum
- 9007199254740991
0Ejemplos
curl --request GET 'https://api.upscale.trade/positions/{accountId}/{asset}/chart-events' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY'const response = await fetch("https://api.upscale.trade/positions/{accountId}/{asset}/chart-events", {
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/positions/{accountId}/{asset}/chart-events",
headers={"Accept":"application/json","Authorization":"Bearer YOUR_API_KEY"},
timeout=30,
)
print(response.status_code, response.text)Respuestas
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, o no hay ningún mercado para este ticker.
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.
defaultRespuestaapplication/json
dataobject[]obligatorioRequested page of chart markers, newest first.
Elementos del array · object
assetstringobligatorioBase asset ticker of the market the event happened on.
BTCdirectionstring · enumobligatorioDirection of the position the event belongs to.
"long" "short"longeventNamestring · enumobligatorioWhat the marker stands for: open for the first increase of a position, increase for later ones, decrease for a partial close, close for a full one and liquidation for a liquidation.
"open" "increase" "decrease" "close" "liquidation"openexecutedAtnumberobligatorioWhen the event happened, unix timestamp in seconds.
1767225599pricestring · int32obligatorioPrice the event executed at, fp9 raw — exchanged quote over exchanged base.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000sizestring · int32obligatorioAbsolute size the event moved, in base asset units, fp9 raw.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000Ver ejemplo
[
{
"asset": "BTC",
"direction": "long",
"eventName": "open",
"executedAt": 1767225599,
"price": "1000000000",
"size": "1000000000"
}
]totalCountnumberobligatorioTotal number of events in the requested range, across all pages.
0{
"data": [
{
"asset": "BTC",
"direction": "long",
"eventName": "open",
"executedAt": 1767225599,
"price": "1000000000",
"size": "1000000000"
}
],
"totalCount": 0
}