View source: R/wrappers_get_account.R
| get_account_positions_history | R Documentation |
Retrieve historical records of closed or adjusted positions.
get_account_positions_history(config, tz = .okx_default_tz)
config |
List. API credentials/config, typically containing 'api_key', 'secret_key', and 'passphrase'. |
tz |
Character. Time zone for parsing timestamps. Default '"Asia/Hong_Kong"'. |
Wraps '/api/v5/account/positions-history'. Includes closed positions and their realized PnL. Returns one row per historical record.
A 'data.frame' with columns such as 'instId', 'posId', 'posSide', 'pos', 'lever', 'realizedPnl', 'fee', plus timestamp fields ('cTime', 'uTime').
Since okxr 0.1.1
[get_account_positions()]
## Not run:
cfg <- list(api_key = "xxx", secret_key = "xxx", passphrase = "xxx")
hist <- get_account_positions_history(config = cfg)
tail(hist)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.