get_account_positions_history: Get account position history

View source: R/wrappers_get_account.R

get_account_positions_historyR Documentation

Get account position history

Description

Retrieve historical records of closed or adjusted positions.

Usage

get_account_positions_history(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-history'. Includes closed positions and their realized PnL. Returns one row per historical record.

Value

A 'data.frame' with columns such as 'instId', 'posId', 'posSide', 'pos', 'lever', 'realizedPnl', 'fee', plus timestamp fields ('cTime', 'uTime').

Note

Since okxr 0.1.1

See Also

[get_account_positions()]

Examples

## Not run: 
cfg <- list(api_key = "xxx", secret_key = "xxx", passphrase = "xxx")
hist <- get_account_positions_history(config = cfg)
tail(hist)

## End(Not run)


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