View source: R/wrappers_get_account.R
| get_account_positions | R Documentation |
Retrieve all currently open positions under the account.
get_account_positions(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'. Returns one row per open position.
A 'data.frame' with columns such as 'instId', 'posId', 'posSide', 'pos', 'lever', 'avgPx', 'markPx', 'upl', 'realizedPnl', etc. Timestamps ('cTime', 'uTime') are 'POSIXct'.
Since okxr 0.1.1
[get_account_balance()], [get_account_positions_history()]
## Not run:
cfg <- list(api_key = "xxx", secret_key = "xxx", passphrase = "xxx")
pos <- get_account_positions(config = cfg)
pos
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.