Upscale
Menu
On this page

Get trading stats of the trader account

Try it out ↓
GET/accounts/{accountId}/stats
Get trading stats of the trader accountAccounts

Aggregates over the closed positions of the account: win rate, average profit and loss, risk-reward ratio, max drawdown and average holding times.

  • Responds with an empty body while the account has no closed positions yet.
  • Covers every phase the account has been through, not only the current one.
Base URL https://api.upscale.trade

Authorization

bearerhttp · bearerrequired

Personal API key, prefixed with usk_.

Parameters

Path
accountIdstring · uuidrequired

Trader account identifier. Must belong to the caller.

Example: 00000000-0000-4000-8000-000000000000

Examples

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

Responses

200Responseapplication/json

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

sumPnlstring · int32required

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

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

Trading fees paid over every closed position, fp9 raw.

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

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

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

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)$
Example: 1000000000
positionsCountnumberrequired

Number of closed positions the statistics are built from.

Example: 0
profitablePositionsCountnumberrequired

Closed positions that ended at or above break-even.

Example: 0
unprofitablePositionsCountnumberrequired

Closed positions that ended below break-even.

Example: 0
winratePercentnumberrequired

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

Example: 62.5
minProfitstring · int32 · nullablerequired

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

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

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

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

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

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

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

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

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

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

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

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

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

Array items · number

number

maxDrawdownPercentnumber[]required

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

Array items · number

number

avgLongPositionHoldTimenumber[]required

Average holding time of long positions, in seconds.

Array items · number

number

View example
[
  0
]
avgShortPositionHoldTimenumber[]required

Average holding time of short positions, in seconds.

Array items · number

number

View example
[
  0
]
avgPositionHoldTimenumber[]required

Average holding time across all closed positions, in seconds.

Array items · number

number

View example
[
  0
]
medianPositionHoldTimenumber[]required

Median holding time across all closed positions, in seconds.

Array items · number

number

View example
[
  0
]
maxProfitablePositionHoldTimenumber[]required

Longest a profitable position was held, in seconds.

Array items · number

number

View example
[
  0
]
maxUnprofitablePositionHoldTimenumber[]required

Longest a losing position was held, in seconds.

Array items · number

number

View example
[
  0
]
medianProfitablePositionHoldTimenumber[]required

Median holding time of profitable positions, in seconds.

Array items · number

number

View example
[
  0
]
medianUnprofitablePositionHoldTimenumber[]required

Median holding time of losing positions, in seconds.

Array items · number

number

View example
[
  0
]
avgLeverageProfitablePositionnumber[]required

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

Array items · number

number

avgLeverageUnprofitablePositionnumber[]required

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

Array items · number

number

topMarketstring[]required

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

Array items · string

string

topMarketPercentnumber[]required

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

Array items · number

number

401

Unauthorized

403

The account belongs to another user (account_access_denied), or the request is authenticated with an API key while api_trading is disabled on the account (api_trading_not_enabled).

404

No account with this identifier.

429

Rate limit of the API key exceeded (api_key_rate_limit_exceeded). Retry-After says when to come back; the body carries the bucket (read / write), the window that tripped, its limit and retryAt.