get_account_positions: Get account open positions

View source: R/wrappers_get_account.R

get_account_positionsR Documentation

Get account open positions

Description

Retrieve all currently open positions under the account.

Usage

get_account_positions(config, tz = .okx_default_tz)

Arguments

config

List. API credentials/config, typically containing 'api_key', 'secret_key', and 'passphrase'.

tz

Character. Time zone for parsing timestamps. Default '"Asia/Hong_Kong"'.

Details

Wraps '/api/v5/account/positions'. Returns one row per open position.

Value

A 'data.frame' with columns such as 'instId', 'posId', 'posSide', 'pos', 'lever', 'avgPx', 'markPx', 'upl', 'realizedPnl', etc. Timestamps ('cTime', 'uTime') are 'POSIXct'.

Note

Since okxr 0.1.1

See Also

[get_account_balance()], [get_account_positions_history()]

Examples

## Not run: 
cfg <- list(api_key = "xxx", secret_key = "xxx", passphrase = "xxx")
pos <- get_account_positions(config = cfg)
pos

## End(Not run)


okxr documentation built on May 8, 2026, 5:09 p.m.