View source: R/wrappers_get_trade.R
| get_trade_orders_history_7d | R Documentation |
Retrieve recent order history for an instrument type.
get_trade_orders_history_7d(
inst_type = "SWAP",
config,
tz = .okx_default_tz
)
inst_type |
Character. Instrument type. One of '"SPOT"', '"MARGIN"', '"SWAP"', '"FUTURES"', '"OPTION"'. Default '"SWAP"'. |
config |
List. API credentials/config, typically containing 'api_key', 'secret_key', and 'passphrase'. May also include 'base_url'. |
tz |
Character. Time zone for parsing timestamps (e.g. '"Asia/Hong_Kong"'). |
This wraps '/api/v5/trade/orders-history' and covers about 7 days of data. Older data is available from OKX's archive endpoint.
A 'data.frame' with one row per historical order and columns following the OKX schema (same layout as pending orders, plus final states). Timestamp columns are 'POSIXct' in 'tz'.
- HTTP 401 Unauthorized - HTTP 400 Bad Request for invalid 'inst_type'
Since okxr 0.1.2
[get_trade_order()], [get_trade_orders_pending()]
## Not run:
cfg <- list(api_key = "xxx", secret_key = "xxx", passphrase = "xxx")
hist <- get_trade_orders_history_7d(
inst_type = "SWAP",
config = cfg,
tz = "Asia/Hong_Kong"
)
tail(hist)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.