{"format":"opendoc-document","version":1,"url":"https://docs.upscale.trade/es/developers/operations/getpositionshistory","title":"Obtener el historial de todas las posiciones","description":"GET /positions/{accountId}/portfolio/history: Todas las posiciones de la cuenta en todos los mercados, tanto abiertas como cerradas, las más recientes primero, con el recuento…","kind":"api-operation","locale":"es","inLanguage":"es","translation":{"sourceLanguage":"en","targetLanguage":"es","status":"complete","translatedUnits":50,"totalUnits":50},"lastModified":"2026-09-28T20:05:09.350Z","revision":"3c2fd254d25c5fe88817d5c939afd24407f25862bdfb7b9dc8ab5105728c7abe","section":{"title":"Developers","url":"https://docs.upscale.trade/es/developers"},"representations":{"html":"https://docs.upscale.trade/es/developers/operations/getpositionshistory","markdown":"https://docs.upscale.trade/es/developers/operations/getpositionshistory.md","json":"https://docs.upscale.trade/es/developers/operations/getpositionshistory.json"},"translations":{"en":"https://docs.upscale.trade/developers/operations/getpositionshistory","ru":"https://docs.upscale.trade/ru/developers/operations/getpositionshistory","es":"https://docs.upscale.trade/es/developers/operations/getpositionshistory"},"operation":{"id":"getPositionsHistory","method":"GET","path":"/positions/{accountId}/portfolio/history","summary":"Obtener el historial de todas las posiciones","description":"Todas las posiciones de la cuenta en todos los mercados, tanto abiertas como cerradas, las más recientes primero, con el recuento total para la paginación.\n\n- Limitado a la fase en la que se encuentra actualmente la cuenta: no se devuelven las posiciones de una fase anterior.","tags":["Trading"],"tagLabels":{"Accounts":"Cuentas","Config":"Configuración","Trading":"Trading"},"deprecated":false,"parameters":[{"name":"accountId","location":"path","schema":{"type":"string · uuid","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid"},"properties":[],"variants":[]},"type":"string · uuid","required":true,"description":"Identificador de la cuenta del trader. Debe pertenecer al solicitante.","example":"00000000-0000-4000-8000-000000000000"},{"name":"limit","location":"query","schema":{"type":"integer","types":["integer"],"example":20,"default":20,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"minimum":1,"maximum":100},"properties":[],"variants":[]},"type":"integer","required":false,"description":"Tamaño de página: cuántos registros devolver.","example":"20"},{"name":"offset","location":"query","schema":{"type":"integer","types":["integer"],"example":0,"default":0,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"minimum":0,"maximum":9007199254740991},"properties":[],"variants":[]},"type":"integer","required":false,"description":"Cuántos registros omitir antes de la página.","example":"0"}],"bodies":[],"responses":[{"status":"401","description":"No autorizado","properties":[],"headers":[]},{"status":"403","description":"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`).","properties":[],"headers":[]},{"status":"404","description":"No hay ninguna cuenta con este identificador.","properties":[],"headers":[]},{"status":"429","description":"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`.","properties":[],"headers":[]},{"status":"default","description":"Respuesta","mediaType":"application/json","properties":[],"schema":{"type":"object[]","types":["array"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"object","types":["object"],"reference":"#/components/schemas/PositionsPaginatedResponse","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[{"name":"data","type":"object[]","required":true,"description":"Página solicitada de posiciones, las más recientes primero.","example":"[\n  {\n    \"idx\": \"string\",\n    \"txId\": \"string\",\n    \"version\": 0,\n    \"openedAt\": \"2026-05-01T12:30:00.000Z\",\n    \"lastUpdatedAt\": \"2026-05-01T12:30:00.000Z\",\n    \"closedAt\": \"2026-05-01T12:30:00.000Z\",\n    \"type\": \"long\",\n    \"status\": \"opened\",\n    \"market\": \"00000000-0000-4000-8000-000000000000\",\n    \"trader\": \"00000000-0000-4000-8000-000000000000\",\n    \"size\": \"1000000000\",\n    \"notional\": \"1000000000\",\n    \"fraction\": \"1000000000\",\n    \"margin\": \"1000000000\",\n    \"pnl\": \"1000000000\",\n    \"funding\": \"1000000000\",\n    \"rolloverFee\": \"1000000000\",\n    \"settlementOraclePrice\": \"1000000000\",\n    \"fee\": \"1000000000\",\n    \"feeRate\": \"1000000000\",\n    \"exchangedQuote\": \"1000000000\",\n    \"exchangedBase\": \"1000000000\",\n    \"direction\": \"long\",\n    \"eventName\": \"addMargin\",\n    \"pnlInEvent\": \"1000000000\",\n    \"rawPnlInEvent\": \"1000000000\",\n    \"profitAdjustmentApplied\": true,\n    \"holdingTimeMs\": \"string\",\n    \"feeInEvent\": \"1000000000\",\n    \"fundingInEvent\": \"1000000000\",\n    \"rolloverFeeInEvent\": \"1000000000\",\n    \"executionFeeRate\": \"1000000000\",\n    \"executionFeeInEvent\": \"1000000000\",\n    \"executionFee\": \"1000000000\",\n    \"timestamp\": \"2026-05-01T12:30:00.000Z\",\n    \"isOnchain\": true,\n    \"roe\": \"1000000000\",\n    \"scalpingCoefficient\": \"1000000000\",\n    \"closeReason\": \"string\"\n  }\n]","schema":{"type":"object[]","types":["array"],"description":"Página solicitada de posiciones, las más recientes primero.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"object","types":["object"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[{"name":"idx","type":"string · nullable","required":true,"description":"Identificador de la posición. Mismo valor que `txId`.","example":"string","schema":{"type":"string · nullable","types":["string","null"],"description":"Identificador de la posición. Mismo valor que `txId`.","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"txId","type":"string · nullable","required":true,"description":"Identificador de la posición. Se mantiene por compatibilidad hacia atrás, siempre igual a `idx`.","example":"string","schema":{"type":"string · nullable","types":["string","null"],"description":"Identificador de la posición. Se mantiene por compatibilidad hacia atrás, siempre igual a `idx`.","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"version","type":"number","required":true,"description":"Revisión de la posición: incrementada por cada evento que se le aplica.","example":"0","schema":{"type":"number","types":["number"],"description":"Revisión de la posición: incrementada por cada evento que se le aplica.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"openedAt","type":"string · date-time","required":true,"description":"Cuándo se abrió la posición.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time","types":["string"],"description":"Cuándo se abrió la posición.","example":"2026-05-01T12:30:00.000Z","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"lastUpdatedAt","type":"string · date-time","required":true,"description":"Cuándo se aplicó el último evento a la posición.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time","types":["string"],"description":"Cuándo se aplicó el último evento a la posición.","example":"2026-05-01T12:30:00.000Z","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"closedAt","type":"string · date-time · nullable","required":true,"description":"Cuándo se cerró la posición; null mientras sigue abierta.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time · nullable","types":["string"],"description":"Cuándo se cerró la posición; null mientras sigue abierta.","example":"2026-05-01T12:30:00.000Z","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"type","type":"string · enum","required":true,"description":"Dirección de la posición. Mismo valor que `direction`.","example":"long","schema":{"type":"string · enum","types":["string"],"description":"Dirección de la posición. Mismo valor que `direction`.","enum":["long","short"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"status","type":"string · enum","required":true,"description":"Si la posición sigue abierta, fue cerrada por el trader o fue liquidada.","example":"opened","schema":{"type":"string · enum","types":["string"],"description":"Si la posición sigue abierta, fue cerrada por el trader o fue liquidada.","enum":["opened","closed","liquidated"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"market","type":"string · uuid","required":true,"description":"Mercado en el que se mantiene la posición.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Mercado en el que se mantiene la posición.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","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})$"},"properties":[],"variants":[]}},{"name":"trader","type":"string · uuid","required":true,"description":"Cuenta del trader a la que pertenece la posición.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Cuenta del trader a la que pertenece la posición.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","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})$"},"properties":[],"variants":[]}},{"name":"size","type":"string · int32","required":true,"description":"Tamaño de la posición en unidades del activo base, fp9 sin procesar.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Tamaño de la posición en unidades del activo base, fp9 sin procesar.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"notional","type":"string · int32","required":true,"description":"Nocional abierto de la posición en moneda de cotización, fp9 sin procesar — tamaño al precio de entrada.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Nocional abierto de la posición en moneda de cotización, fp9 sin procesar — tamaño al precio de entrada.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"fraction","type":"string · int32","required":true,"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"margin","type":"string · int32","required":true,"description":"Margen que actualmente respalda la posición, fp9 sin procesar. Cambia con pnl, financiación y cambios manuales de margen.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Margen que actualmente respalda la posición, fp9 sin procesar. Cambia con pnl, financiación y cambios manuales de margen.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"pnl","type":"string · int32 · nullable","required":true,"description":"Pnl realizado acumulado a lo largo de cada evento de la posición, fp9 sin procesar.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Pnl realizado acumulado a lo largo de cada evento de la posición, fp9 sin procesar.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"funding","type":"string · int32 · nullable","required":true,"description":"Financiación pagada (negativa) o recibida (positiva) durante la vida de la posición, fp9 en bruto.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Financiación pagada (negativa) o recibida (positiva) durante la vida de la posición, fp9 en bruto.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"rolloverFee","type":"string · int32","required":true,"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"settlementOraclePrice","type":"string · int32","required":true,"description":"Siempre `1000000000` (1.0). Se mantiene por compatibilidad con versiones anteriores.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Siempre `1000000000` (1.0). Se mantiene por compatibilidad con versiones anteriores.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"fee","type":"string · int32","required":true,"description":"Comisiones de trading cobradas durante la vida de la posición, fp9 en bruto.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Comisiones de trading cobradas durante la vida de la posición, fp9 en bruto.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"feeRate","type":"string · int32","required":true,"description":"Tasa de comisión aplicada a la posición, fp9 fracción en bruto (`1000000` = 0.1%).","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Tasa de comisión aplicada a la posición, fp9 fracción en bruto (`1000000` = 0.1%).","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"exchangedQuote","type":"string · int32","required":true,"description":"Importe de cotización intercambiado por el evento más reciente, fp9 en bruto.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Importe de cotización intercambiado por el evento más reciente, fp9 en bruto.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"exchangedBase","type":"string · int32","required":true,"description":"Importe base intercambiado por el evento más reciente, fp9 en bruto.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Importe base intercambiado por el evento más reciente, fp9 en bruto.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"direction","type":"string · enum","required":true,"description":"Dirección de la posición.","example":"long","schema":{"type":"string · enum","types":["string"],"description":"Dirección de la posición.","enum":["long","short"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"eventName","type":"string · enum","required":true,"description":"Tipo del evento más reciente aplicado a la posición.","example":"addMargin","schema":{"type":"string · enum","types":["string"],"description":"Tipo del evento más reciente aplicado a la posición.","enum":["addMargin","removeMargin","closePosition","increasePosition","liquidate","forceClose","payFunding"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"pnlInEvent","type":"string · int32","required":true,"description":"Pnl realizado del evento más reciente, fp9 en bruto.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Pnl realizado del evento más reciente, fp9 en bruto.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"rawPnlInEvent","type":"string · int32","required":true,"description":"Pnl realizado del evento más reciente antes del ajuste de 60 segundos, fp9 en bruto. Difiere de `pnlInEvent` solo cuando se activó el ajuste.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Pnl realizado del evento más reciente antes del ajuste de 60 segundos, fp9 en bruto. Difiere de `pnlInEvent` solo cuando se activó el ajuste.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"profitAdjustmentApplied","type":"boolean","required":true,"description":"Si el ajuste de 60 segundos limitó la ganancia del evento más reciente — dentro de un minuto de una apertura o un aumento de la posición, el pnl de la posición no puede crecer por encima de lo que era en ese momento.","example":"true","schema":{"type":"boolean","types":["boolean"],"description":"Si el ajuste de 60 segundos limitó la ganancia del evento más reciente — dentro de un minuto de una apertura o un aumento de la posición, el pnl de la posición no puede crecer por encima de lo que era en ese momento.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"holdingTimeMs","type":"string · nullable","required":true,"description":"Cuánto tiempo se mantuvo la posición antes del cierre más reciente, en milisegundos, contado desde la apertura o el último incremento. Nulo en eventos que no son cierres.","example":"string","schema":{"type":"string · nullable","types":["string","null"],"description":"Cuánto tiempo se mantuvo la posición antes del cierre más reciente, en milisegundos, contado desde la apertura o el último incremento. Nulo en eventos que no son cierres.","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"feeInEvent","type":"string · int32","required":true,"description":"Comisión cobrada por el evento más reciente, fp9 en bruto.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Comisión cobrada por el evento más reciente, fp9 en bruto.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"fundingInEvent","type":"string · int32","required":true,"description":"Financiación liquidada por el evento más reciente, fp9 en bruto.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Financiación liquidada por el evento más reciente, fp9 en bruto.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"rolloverFeeInEvent","type":"string · int32","required":true,"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"executionFeeRate","type":"string · int32","required":true,"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"executionFeeInEvent","type":"string · int32","required":true,"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"executionFee","type":"string · int32","required":true,"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Siempre `0`. Se mantiene por compatibilidad hacia atrás.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"timestamp","type":"string · date-time","required":true,"description":"Marca de tiempo del evento más reciente. Mismo valor que `lastUpdatedAt`.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time","types":["string"],"description":"Marca de tiempo del evento más reciente. Mismo valor que `lastUpdatedAt`.","example":"2026-05-01T12:30:00.000Z","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"isOnchain","type":"boolean","required":true,"description":"Siempre `true`. Se mantiene por compatibilidad con versiones anteriores.","example":"true","schema":{"type":"boolean","types":["boolean"],"description":"Siempre `true`. Se mantiene por compatibilidad con versiones anteriores.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"roe","type":"string · int32","required":true,"description":"Rentabilidad sobre el capital de la posición — pnl realizado sobre el margen aportado, fp9 fracción sin procesar.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Rentabilidad sobre el capital de la posición — pnl realizado sobre el margen aportado, fp9 fracción sin procesar.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"scalpingCoefficient","type":"string · int32","required":true,"description":"Multiplicador dinámico de spread que se aplicó a la posición, fp9 sin procesar (`1000000000` = 1.0). Por encima de 1 cuando la operación quedó dentro de la ventana de scalping del mercado.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Multiplicador dinámico de spread que se aplicó a la posición, fp9 sin procesar (`1000000000` = 1.0). Por encima de 1 cuando la operación quedó dentro de la ventana de scalping del mercado.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"closeReason","type":"string · nullable","required":true,"description":"Por qué la plataforma cerró la posición (por ejemplo, `weekly_session_risk_close`). Nulo para las posiciones cerradas por el trader y para las abiertas.","example":"string","schema":{"type":"string · nullable","types":["string","null"],"description":"Por qué la plataforma cerró la posición (por ejemplo, `weekly_session_risk_close`). Nulo para las posiciones cerradas por el trader y para las abiertas.","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}}],"variants":[]},"variants":[]}},{"name":"totalCount","type":"number","required":true,"description":"Número total de posiciones que coinciden con la solicitud, en todas las páginas.","example":"0","schema":{"type":"number","types":["number"],"description":"Número total de posiciones que coinciden con la solicitud, en todas las páginas.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}}],"variants":[]},"variants":[]},"example":"[\n  {\n    \"data\": [\n      {\n        \"idx\": \"string\",\n        \"txId\": \"string\",\n        \"version\": 0,\n        \"openedAt\": \"2026-05-01T12:30:00.000Z\",\n        \"lastUpdatedAt\": \"2026-05-01T12:30:00.000Z\",\n        \"closedAt\": \"2026-05-01T12:30:00.000Z\",\n        \"type\": \"long\",\n        \"status\": \"opened\",\n        \"market\": \"00000000-0000-4000-8000-000000000000\",\n        \"trader\": \"00000000-0000-4000-8000-000000000000\",\n        \"size\": \"1000000000\",\n        \"notional\": \"1000000000\",\n        \"fraction\": \"1000000000\",\n        \"margin\": \"1000000000\",\n        \"pnl\": \"1000000000\",\n        \"funding\": \"1000000000\",\n        \"rolloverFee\": \"1000000000\",\n        \"settlementOraclePrice\": \"1000000000\",\n        \"fee\": \"1000000000\",\n        \"feeRate\": \"1000000000\",\n        \"exchangedQuote\": \"1000000000\",\n        \"exchangedBase\": \"1000000000\",\n        \"direction\": \"long\",\n        \"eventName\": \"addMargin\",\n        \"pnlInEvent\": \"1000000000\",\n        \"rawPnlInEvent\": \"1000000000\",\n        \"profitAdjustmentApplied\": true,\n        \"holdingTimeMs\": \"string\",\n        \"feeInEvent\": \"1000000000\",\n        \"fundingInEvent\": \"1000000000\",\n        \"rolloverFeeInEvent\": \"1000000000\",\n        \"executionFeeRate\": \"1000000000\",\n        \"executionFeeInEvent\": \"1000000000\",\n        \"executionFee\": \"1000000000\",\n        \"timestamp\": \"2026-05-01T12:30:00.000Z\",\n        \"isOnchain\": true,\n        \"roe\": \"1000000000\",\n        \"scalpingCoefficient\": \"1000000000\",\n        \"closeReason\": \"string\"\n      }\n    ],\n    \"totalCount\": 0\n  }\n]","headers":[]}],"security":[{"name":"bearer","type":"http · bearer","description":"Clave de API personal, con el prefijo `usk_`.","required":true,"scopes":[]}],"codeSamples":[{"label":"cURL","language":"bash","source":"curl --request GET 'https://api.upscale.trade/positions/{accountId}/portfolio/history' \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer YOUR_API_KEY'"},{"label":"JavaScript","language":"javascript","source":"const response = await fetch(\"https://api.upscale.trade/positions/{accountId}/portfolio/history\", {\n  method: \"GET\",\n  headers: {\n    \"Accept\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_API_KEY\"\n  },\n});\nconsole.log(response.status, await response.text());"},{"label":"Python","language":"python","source":"import requests\n\nresponse = requests.request(\n    \"GET\",\n    \"https://api.upscale.trade/positions/{accountId}/portfolio/history\",\n    headers={\"Accept\":\"application/json\",\"Authorization\":\"Bearer YOUR_API_KEY\"},\n    timeout=30,\n)\nprint(response.status_code, response.text)"}]},"breadcrumbs":[{"title":"Qué es el prop trading","url":"https://docs.upscale.trade/es"},{"title":"Developers","url":"https://docs.upscale.trade/es/developers"},{"title":"Obtener el historial de todas las posiciones","url":"https://docs.upscale.trade/es/developers/operations/getpositionshistory"}],"headings":[{"depth":2,"id":"authorization","title":"Autorización"},{"depth":2,"id":"parameters","title":"Parámetros"},{"depth":2,"id":"examples","title":"Ejemplos"},{"depth":2,"id":"responses","title":"Respuestas"}],"markdown":"# Obtener el historial de todas las posiciones\n\n`GET /positions/{accountId}/portfolio/history`\n\nTodas las posiciones de la cuenta en todos los mercados, tanto abiertas como cerradas, las más recientes primero, con el recuento total para la paginación.\n\n- Limitado a la fase en la que se encuentra actualmente la cuenta: no se devuelven las posiciones de una fase anterior.\n\n<a id=\"authorization\"></a>\n\n## Autorización\n\nbearer: http · bearer (obligatorio). Clave de API personal, con el prefijo `usk_`.\n\n<a id=\"parameters\"></a>\n\n## Parámetros\n\n- path: accountId (string · uuid; obligatorio). Identificador de la cuenta del trader. Debe pertenecer al solicitante.\n\nTipo: string · uuid\n\nformat: uuid\n\n- query: limit (integer; opcional). Tamaño de página: cuántos registros devolver.\n\nTipo: integer\n\nEjemplo: 20\n\nPredeterminado: 20\n\nminimum: 1\n\nmaximum: 100\n\n- query: offset (integer; opcional). Cuántos registros omitir antes de la página.\n\nTipo: integer\n\nEjemplo: 0\n\nPredeterminado: 0\n\nminimum: 0\n\nmaximum: 9007199254740991\n\n<a id=\"example-curl\"></a>\n\n## Ejemplo · cURL\n\n```bash\ncurl --request GET 'https://api.upscale.trade/positions/{accountId}/portfolio/history' \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer YOUR_API_KEY'\n```\n\n<a id=\"example-javascript\"></a>\n\n## Ejemplo · JavaScript\n\n```javascript\nconst response = await fetch(\"https://api.upscale.trade/positions/{accountId}/portfolio/history\", {\n  method: \"GET\",\n  headers: {\n    \"Accept\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_API_KEY\"\n  },\n});\nconsole.log(response.status, await response.text());\n```\n\n<a id=\"example-python\"></a>\n\n## Ejemplo · Python\n\n```python\nimport requests\n\nresponse = requests.request(\n    \"GET\",\n    \"https://api.upscale.trade/positions/{accountId}/portfolio/history\",\n    headers={\"Accept\":\"application/json\",\"Authorization\":\"Bearer YOUR_API_KEY\"},\n    timeout=30,\n)\nprint(response.status_code, response.text)\n```\n\n<a id=\"response-401\"></a>\n\n## Respuesta 401\n\n**401**  — No autorizado\n\n<a id=\"response-403\"></a>\n\n## Respuesta 403\n\n**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`).\n\n<a id=\"response-404\"></a>\n\n## Respuesta 404\n\n**404**  — No hay ninguna cuenta con este identificador.\n\n<a id=\"response-429\"></a>\n\n## Respuesta 429\n\n**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`.\n\n<a id=\"response-default-positionspaginatedresponse\"></a>\n\n## Respuesta default · PositionsPaginatedResponse\n\n**default** application/json — Respuesta\n\nTipo: object[]\n\n[]Esquema: PositionsPaginatedResponse\n\n[]Tipo: object\n\n[]Campos obligatorios: data, totalCount\n\n[]Tipos de campos obligatorios: data (object[]; obligatorio), totalCount (number; obligatorio)\n\n- []data (object[]; obligatorio)\n\n[]data ejemplo: [\n  {\n    \"idx\": \"string\",\n    \"txId\": \"string\",\n    \"version\": 0,\n    \"openedAt\": \"2026-05-01T12:30:00.000Z\",\n    \"lastUpdatedAt\": \"2026-05-01T12:30:00.000Z\",\n    \"closedAt\": \"2026-05-01T12:30:00.000Z\",\n    \"type\": \"long\",\n    \"status\": \"opened\",\n    \"market\": \"00000000-0000-4000-8000-000000000000\",\n    \"trader\": \"00000000-0000-4000-8000-000000000000\",\n    \"size\": \"1000000000\",\n    \"notional\": \"1000000000\",\n    \"fraction\": \"1000000000\",\n    \"margin\": \"1000000000\",\n    \"pnl\": \"1000000000\",\n    \"funding\": \"1000000000\",\n    \"rolloverFee\": \"1000000000\",\n    \"settlementOraclePrice\": \"1000000000\",\n    \"fee\": \"1000000000\",\n    \"feeRate\": \"1000000000\",\n    \"exchangedQuote\": \"1000000000\",\n    \"exchangedBase\": \"1000000000\",\n    \"direction\": \"long\",\n    \"eventName\": \"addMargin\",\n    \"pnlInEvent\": \"1000000000\",\n    \"rawPnlInEvent\": \"1000000000\",\n    \"profitAdjustmentApplied\": true,\n    \"holdingTimeMs\": \"string\",\n    \"feeInEvent\": \"1000000000\",\n    \"fundingInEvent\": \"1000000000\",\n    \"rolloverFeeInEvent\": \"1000000000\",\n    \"executionFeeRate\": \"1000000000\",\n    \"executionFeeInEvent\": \"1000000000\",\n    \"executionFee\": \"1000000000\",\n    \"timestamp\": \"2026-05-01T12:30:00.000Z\",\n    \"isOnchain\": true,\n    \"roe\": \"1000000000\",\n    \"scalpingCoefficient\": \"1000000000\",\n    \"closeReason\": \"string\"\n  }\n]\n\n[]data.Tipo: object[]\n\n[]data.Página solicitada de posiciones, las más recientes primero.\n\n[]data.[]Tipo: object\n\n[]data.[]Campos obligatorios: idx, txId, version, openedAt, lastUpdatedAt, closedAt, type, status, market, trader, size, notional, fraction, margin, pnl, funding, rolloverFee, settlementOraclePrice, fee, feeRate, exchangedQuote, exchangedBase, direction, eventName, pnlInEvent, rawPnlInEvent, profitAdjustmentApplied, holdingTimeMs, feeInEvent, fundingInEvent, rolloverFeeInEvent, executionFeeRate, executionFeeInEvent, executionFee, timestamp, isOnchain, roe, scalpingCoefficient, closeReason\n\n[]data.[]Tipos de campos obligatorios: idx (string · nullable; obligatorio), txId (string · nullable; obligatorio), version (number; obligatorio), openedAt (string · date-time; obligatorio), lastUpdatedAt (string · date-time; obligatorio), closedAt (string · date-time · nullable; obligatorio), type (string · enum; obligatorio), status (string · enum; obligatorio), market (string · uuid; obligatorio), trader (string · uuid; obligatorio), size (string · int32; obligatorio), notional (string · int32; obligatorio), fraction (string · int32; obligatorio), margin (string · int32; obligatorio), pnl (string · int32 · nullable; obligatorio), funding (string · int32 · nullable; obligatorio), rolloverFee (string · int32; obligatorio), settlementOraclePrice (string · int32; obligatorio), fee (string · int32; obligatorio), feeRate (string · int32; obligatorio), exchangedQuote (string · int32; obligatorio), exchangedBase (string · int32; obligatorio), direction (string · enum; obligatorio), eventName (string · enum; obligatorio), pnlInEvent (string · int32; obligatorio), rawPnlInEvent (string · int32; obligatorio), profitAdjustmentApplied (boolean; obligatorio), holdingTimeMs (string · nullable; obligatorio), feeInEvent (string · int32; obligatorio), fundingInEvent (string · int32; obligatorio), rolloverFeeInEvent (string · int32; obligatorio), executionFeeRate (string · int32; obligatorio), executionFeeInEvent (string · int32; obligatorio), executionFee (string · int32; obligatorio), timestamp (string · date-time; obligatorio), isOnchain (boolean; obligatorio), roe (string · int32; obligatorio), scalpingCoefficient (string · int32; obligatorio), closeReason (string · nullable; obligatorio)\n\n- []data.[]idx (string · nullable; obligatorio)\n\n[]data.[]idx ejemplo: string\n\n[]data.[]idx.Tipo: string · nullable\n\n[]data.[]idx.Identificador de la posición. Mismo valor que `txId`.\n\n- []data.[]txId (string · nullable; obligatorio)\n\n[]data.[]txId ejemplo: string\n\n[]data.[]txId.Tipo: string · nullable\n\n[]data.[]txId.Identificador de la posición. Se mantiene por compatibilidad hacia atrás, siempre igual a `idx`.\n\n- []data.[]version (number; obligatorio)\n\n[]data.[]version ejemplo: 0\n\n[]data.[]version.Tipo: number\n\n[]data.[]version.Revisión de la posición: incrementada por cada evento que se le aplica.\n\n- []data.[]openedAt (string · date-time; obligatorio)\n\n[]data.[]openedAt ejemplo: 2026-05-01T12:30:00.000Z\n\n[]data.[]openedAt.Tipo: string · date-time\n\n[]data.[]openedAt.Cuándo se abrió la posición.\n\n[]data.[]openedAt.format: date-time\n\n- []data.[]lastUpdatedAt (string · date-time; obligatorio)\n\n[]data.[]lastUpdatedAt ejemplo: 2026-05-01T12:30:00.000Z\n\n[]data.[]lastUpdatedAt.Tipo: string · date-time\n\n[]data.[]lastUpdatedAt.Cuándo se aplicó el último evento a la posición.\n\n[]data.[]lastUpdatedAt.format: date-time\n\n- []data.[]closedAt (string · date-time · nullable; obligatorio)\n\n[]data.[]closedAt ejemplo: 2026-05-01T12:30:00.000Z\n\n[]data.[]closedAt.Tipo: string · date-time · nullable\n\n[]data.[]closedAt.Cuándo se cerró la posición; null mientras sigue abierta.\n\n[]data.[]closedAt.format: date-time\n\n- []data.[]type (string · enum; obligatorio)\n\n[]data.[]type ejemplo: long\n\n[]data.[]type.Tipo: string · enum\n\n[]data.[]type.Dirección de la posición. Mismo valor que `direction`.\n\n[]data.[]type.Valores permitidos: [\"long\",\"short\"]\n\n- []data.[]status (string · enum; obligatorio)\n\n[]data.[]status ejemplo: opened\n\n[]data.[]status.Tipo: string · enum\n\n[]data.[]status.Si la posición sigue abierta, fue cerrada por el trader o fue liquidada.\n\n[]data.[]status.Valores permitidos: [\"opened\",\"closed\",\"liquidated\"]\n\n- []data.[]market (string · uuid; obligatorio)\n\n[]data.[]market ejemplo: 00000000-0000-4000-8000-000000000000\n\n[]data.[]market.Tipo: string · uuid\n\n[]data.[]market.Mercado en el que se mantiene la posición.\n\n[]data.[]market.format: uuid\n\n[]data.[]market.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})$\n\n- []data.[]trader (string · uuid; obligatorio)\n\n[]data.[]trader ejemplo: 00000000-0000-4000-8000-000000000000\n\n[]data.[]trader.Tipo: string · uuid\n\n[]data.[]trader.Cuenta del trader a la que pertenece la posición.\n\n[]data.[]trader.format: uuid\n\n[]data.[]trader.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})$\n\n- []data.[]size (string · int32; obligatorio)\n\n[]data.[]size ejemplo: 1000000000\n\n[]data.[]size.Tipo: string · int32\n\n[]data.[]size.Tamaño de la posición en unidades del activo base, fp9 sin procesar.\n\n[]data.[]size.format: int32\n\n[]data.[]size.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]notional (string · int32; obligatorio)\n\n[]data.[]notional ejemplo: 1000000000\n\n[]data.[]notional.Tipo: string · int32\n\n[]data.[]notional.Nocional abierto de la posición en moneda de cotización, fp9 sin procesar — tamaño al precio de entrada.\n\n[]data.[]notional.format: int32\n\n[]data.[]notional.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]fraction (string · int32; obligatorio)\n\n[]data.[]fraction ejemplo: 1000000000\n\n[]data.[]fraction.Tipo: string · int32\n\n[]data.[]fraction.Siempre `0`. Se mantiene por compatibilidad hacia atrás.\n\n[]data.[]fraction.format: int32\n\n[]data.[]fraction.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]margin (string · int32; obligatorio)\n\n[]data.[]margin ejemplo: 1000000000\n\n[]data.[]margin.Tipo: string · int32\n\n[]data.[]margin.Margen que actualmente respalda la posición, fp9 sin procesar. Cambia con pnl, financiación y cambios manuales de margen.\n\n[]data.[]margin.format: int32\n\n[]data.[]margin.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]pnl (string · int32 · nullable; obligatorio)\n\n[]data.[]pnl ejemplo: 1000000000\n\n[]data.[]pnl.Tipo: string · int32 · nullable\n\n[]data.[]pnl.Pnl realizado acumulado a lo largo de cada evento de la posición, fp9 sin procesar.\n\n[]data.[]pnl.format: int32\n\n[]data.[]pnl.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]funding (string · int32 · nullable; obligatorio)\n\n[]data.[]funding ejemplo: 1000000000\n\n[]data.[]funding.Tipo: string · int32 · nullable\n\n[]data.[]funding.Financiación pagada (negativa) o recibida (positiva) durante la vida de la posición, fp9 en bruto.\n\n[]data.[]funding.format: int32\n\n[]data.[]funding.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]rolloverFee (string · int32; obligatorio)\n\n[]data.[]rolloverFee ejemplo: 1000000000\n\n[]data.[]rolloverFee.Tipo: string · int32\n\n[]data.[]rolloverFee.Siempre `0`. Se mantiene por compatibilidad hacia atrás.\n\n[]data.[]rolloverFee.format: int32\n\n[]data.[]rolloverFee.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]settlementOraclePrice (string · int32; obligatorio)\n\n[]data.[]settlementOraclePrice ejemplo: 1000000000\n\n[]data.[]settlementOraclePrice.Tipo: string · int32\n\n[]data.[]settlementOraclePrice.Siempre `1000000000` (1.0). Se mantiene por compatibilidad con versiones anteriores.\n\n[]data.[]settlementOraclePrice.format: int32\n\n[]data.[]settlementOraclePrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]fee (string · int32; obligatorio)\n\n[]data.[]fee ejemplo: 1000000000\n\n[]data.[]fee.Tipo: string · int32\n\n[]data.[]fee.Comisiones de trading cobradas durante la vida de la posición, fp9 en bruto.\n\n[]data.[]fee.format: int32\n\n[]data.[]fee.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]feeRate (string · int32; obligatorio)\n\n[]data.[]feeRate ejemplo: 1000000000\n\n[]data.[]feeRate.Tipo: string · int32\n\n[]data.[]feeRate.Tasa de comisión aplicada a la posición, fp9 fracción en bruto (`1000000` = 0.1%).\n\n[]data.[]feeRate.format: int32\n\n[]data.[]feeRate.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]exchangedQuote (string · int32; obligatorio)\n\n[]data.[]exchangedQuote ejemplo: 1000000000\n\n[]data.[]exchangedQuote.Tipo: string · int32\n\n[]data.[]exchangedQuote.Importe de cotización intercambiado por el evento más reciente, fp9 en bruto.\n\n[]data.[]exchangedQuote.format: int32\n\n[]data.[]exchangedQuote.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]exchangedBase (string · int32; obligatorio)\n\n[]data.[]exchangedBase ejemplo: 1000000000\n\n[]data.[]exchangedBase.Tipo: string · int32\n\n[]data.[]exchangedBase.Importe base intercambiado por el evento más reciente, fp9 en bruto.\n\n[]data.[]exchangedBase.format: int32\n\n[]data.[]exchangedBase.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]direction (string · enum; obligatorio)\n\n[]data.[]direction ejemplo: long\n\n[]data.[]direction.Tipo: string · enum\n\n[]data.[]direction.Dirección de la posición.\n\n[]data.[]direction.Valores permitidos: [\"long\",\"short\"]\n\n- []data.[]eventName (string · enum; obligatorio)\n\n[]data.[]eventName ejemplo: addMargin\n\n[]data.[]eventName.Tipo: string · enum\n\n[]data.[]eventName.Tipo del evento más reciente aplicado a la posición.\n\n[]data.[]eventName.Valores permitidos: [\"addMargin\",\"removeMargin\",\"closePosition\",\"increasePosition\",\"liquidate\",\"forceClose\",\"payFunding\"]\n\n- []data.[]pnlInEvent (string · int32; obligatorio)\n\n[]data.[]pnlInEvent ejemplo: 1000000000\n\n[]data.[]pnlInEvent.Tipo: string · int32\n\n[]data.[]pnlInEvent.Pnl realizado del evento más reciente, fp9 en bruto.\n\n[]data.[]pnlInEvent.format: int32\n\n[]data.[]pnlInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]rawPnlInEvent (string · int32; obligatorio)\n\n[]data.[]rawPnlInEvent ejemplo: 1000000000\n\n[]data.[]rawPnlInEvent.Tipo: string · int32\n\n[]data.[]rawPnlInEvent.Pnl realizado del evento más reciente antes del ajuste de 60 segundos, fp9 en bruto. Difiere de `pnlInEvent` solo cuando se activó el ajuste.\n\n[]data.[]rawPnlInEvent.format: int32\n\n[]data.[]rawPnlInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]profitAdjustmentApplied (boolean; obligatorio)\n\n[]data.[]profitAdjustmentApplied ejemplo: true\n\n[]data.[]profitAdjustmentApplied.Tipo: boolean\n\n[]data.[]profitAdjustmentApplied.Si el ajuste de 60 segundos limitó la ganancia del evento más reciente — dentro de un minuto de una apertura o un aumento de la posición, el pnl de la posición no puede crecer por encima de lo que era en ese momento.\n\n- []data.[]holdingTimeMs (string · nullable; obligatorio)\n\n[]data.[]holdingTimeMs ejemplo: string\n\n[]data.[]holdingTimeMs.Tipo: string · nullable\n\n[]data.[]holdingTimeMs.Cuánto tiempo se mantuvo la posición antes del cierre más reciente, en milisegundos, contado desde la apertura o el último incremento. Nulo en eventos que no son cierres.\n\n- []data.[]feeInEvent (string · int32; obligatorio)\n\n[]data.[]feeInEvent ejemplo: 1000000000\n\n[]data.[]feeInEvent.Tipo: string · int32\n\n[]data.[]feeInEvent.Comisión cobrada por el evento más reciente, fp9 en bruto.\n\n[]data.[]feeInEvent.format: int32\n\n[]data.[]feeInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]fundingInEvent (string · int32; obligatorio)\n\n[]data.[]fundingInEvent ejemplo: 1000000000\n\n[]data.[]fundingInEvent.Tipo: string · int32\n\n[]data.[]fundingInEvent.Financiación liquidada por el evento más reciente, fp9 en bruto.\n\n[]data.[]fundingInEvent.format: int32\n\n[]data.[]fundingInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]rolloverFeeInEvent (string · int32; obligatorio)\n\n[]data.[]rolloverFeeInEvent ejemplo: 1000000000\n\n[]data.[]rolloverFeeInEvent.Tipo: string · int32\n\n[]data.[]rolloverFeeInEvent.Siempre `0`. Se mantiene por compatibilidad hacia atrás.\n\n[]data.[]rolloverFeeInEvent.format: int32\n\n[]data.[]rolloverFeeInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]executionFeeRate (string · int32; obligatorio)\n\n[]data.[]executionFeeRate ejemplo: 1000000000\n\n[]data.[]executionFeeRate.Tipo: string · int32\n\n[]data.[]executionFeeRate.Siempre `0`. Se mantiene por compatibilidad hacia atrás.\n\n[]data.[]executionFeeRate.format: int32\n\n[]data.[]executionFeeRate.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]executionFeeInEvent (string · int32; obligatorio)\n\n[]data.[]executionFeeInEvent ejemplo: 1000000000\n\n[]data.[]executionFeeInEvent.Tipo: string · int32\n\n[]data.[]executionFeeInEvent.Siempre `0`. Se mantiene por compatibilidad hacia atrás.\n\n[]data.[]executionFeeInEvent.format: int32\n\n[]data.[]executionFeeInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]executionFee (string · int32; obligatorio)\n\n[]data.[]executionFee ejemplo: 1000000000\n\n[]data.[]executionFee.Tipo: string · int32\n\n[]data.[]executionFee.Siempre `0`. Se mantiene por compatibilidad hacia atrás.\n\n[]data.[]executionFee.format: int32\n\n[]data.[]executionFee.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]timestamp (string · date-time; obligatorio)\n\n[]data.[]timestamp ejemplo: 2026-05-01T12:30:00.000Z\n\n[]data.[]timestamp.Tipo: string · date-time\n\n[]data.[]timestamp.Marca de tiempo del evento más reciente. Mismo valor que `lastUpdatedAt`.\n\n[]data.[]timestamp.format: date-time\n\n- []data.[]isOnchain (boolean; obligatorio)\n\n[]data.[]isOnchain ejemplo: true\n\n[]data.[]isOnchain.Tipo: boolean\n\n[]data.[]isOnchain.Siempre `true`. Se mantiene por compatibilidad con versiones anteriores.\n\n- []data.[]roe (string · int32; obligatorio)\n\n[]data.[]roe ejemplo: 1000000000\n\n[]data.[]roe.Tipo: string · int32\n\n[]data.[]roe.Rentabilidad sobre el capital de la posición — pnl realizado sobre el margen aportado, fp9 fracción sin procesar.\n\n[]data.[]roe.format: int32\n\n[]data.[]roe.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]scalpingCoefficient (string · int32; obligatorio)\n\n[]data.[]scalpingCoefficient ejemplo: 1000000000\n\n[]data.[]scalpingCoefficient.Tipo: string · int32\n\n[]data.[]scalpingCoefficient.Multiplicador dinámico de spread que se aplicó a la posición, fp9 sin procesar (`1000000000` = 1.0). Por encima de 1 cuando la operación quedó dentro de la ventana de scalping del mercado.\n\n[]data.[]scalpingCoefficient.format: int32\n\n[]data.[]scalpingCoefficient.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- []data.[]closeReason (string · nullable; obligatorio)\n\n[]data.[]closeReason ejemplo: string\n\n[]data.[]closeReason.Tipo: string · nullable\n\n[]data.[]closeReason.Por qué la plataforma cerró la posición (por ejemplo, `weekly_session_risk_close`). Nulo para las posiciones cerradas por el trader y para las abiertas.\n\n- []totalCount (number; obligatorio)\n\n[]totalCount ejemplo: 0\n\n[]totalCount.Tipo: number\n\n[]totalCount.Número total de posiciones que coinciden con la solicitud, en todas las páginas.\n\nEjemplo\n\n\n\n```json\n[\n  {\n    \"data\": [\n      {\n        \"idx\": \"string\",\n        \"txId\": \"string\",\n        \"version\": 0,\n        \"openedAt\": \"2026-05-01T12:30:00.000Z\",\n        \"lastUpdatedAt\": \"2026-05-01T12:30:00.000Z\",\n        \"closedAt\": \"2026-05-01T12:30:00.000Z\",\n        \"type\": \"long\",\n        \"status\": \"opened\",\n        \"market\": \"00000000-0000-4000-8000-000000000000\",\n        \"trader\": \"00000000-0000-4000-8000-000000000000\",\n        \"size\": \"1000000000\",\n        \"notional\": \"1000000000\",\n        \"fraction\": \"1000000000\",\n        \"margin\": \"1000000000\",\n        \"pnl\": \"1000000000\",\n        \"funding\": \"1000000000\",\n        \"rolloverFee\": \"1000000000\",\n        \"settlementOraclePrice\": \"1000000000\",\n        \"fee\": \"1000000000\",\n        \"feeRate\": \"1000000000\",\n        \"exchangedQuote\": \"1000000000\",\n        \"exchangedBase\": \"1000000000\",\n        \"direction\": \"long\",\n        \"eventName\": \"addMargin\",\n        \"pnlInEvent\": \"1000000000\",\n        \"rawPnlInEvent\": \"1000000000\",\n        \"profitAdjustmentApplied\": true,\n        \"holdingTimeMs\": \"string\",\n        \"feeInEvent\": \"1000000000\",\n        \"fundingInEvent\": \"1000000000\",\n        \"rolloverFeeInEvent\": \"1000000000\",\n        \"executionFeeRate\": \"1000000000\",\n        \"executionFeeInEvent\": \"1000000000\",\n        \"executionFee\": \"1000000000\",\n        \"timestamp\": \"2026-05-01T12:30:00.000Z\",\n        \"isOnchain\": true,\n        \"roe\": \"1000000000\",\n        \"scalpingCoefficient\": \"1000000000\",\n        \"closeReason\": \"string\"\n      }\n    ],\n    \"totalCount\": 0\n  }\n]\n```","text":"Obtener el historial de todas las posiciones Todas las posiciones de la cuenta en todos los mercados, tanto abiertas como cerradas, las más recientes primero, con el recuento total para la paginación. - Limitado a la fase en la que se encuentra actualmente la cuenta: no se devuelven las posiciones de una fase anterior. GET /positions/{accountId}/portfolio/history Trading accountId Identificador de la cuenta del trader. Debe pertenecer al solicitante. string · uuid limit Tamaño de página: cuántos registros devolver. integer offset Cuántos registros omitir antes de la página. integer 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`. default Respuesta","api":{"title":"API pública de Upscale","version":"d796ac9","documentation":"https://docs.upscale.trade/es/developers","playgroundServer":"https://api.upscale.trade"}}