post_trade_order: Place a Trade Order

View source: R/wrappers_post_trade.R

post_trade_orderR Documentation

Place a Trade Order

Description

Submits a trade order to the OKX exchange.

Usage

post_trade_order(
  inst_id,
  td_mode,
  side,
  ord_type,
  sz,
  pos_side = NULL,
  px = NULL,
  reduce_only = NULL,
  tgt_ccy = NULL,
  cl_ord_id = NULL,
  tag = NULL,
  config,
  tz = .okx_default_tz
)

Arguments

inst_id

Instrument ID (e.g., "BTC-USDT").

td_mode

Trade mode: "cross" or "isolated".

side

Order side: "buy" or "sell".

ord_type

Order type: "limit", "market", etc.

sz

Size of the order (quantity to buy/sell).

pos_side

Optional. Position side: "long" or "short".

px

Optional. Price (required for limit orders).

reduce_only

Optional. Logical flag to indicate a reduce-only order.

tgt_ccy

Optional. Quote currency (e.g., "base", "quote").

cl_ord_id

Optional. Custom client order ID (auto-generated if NULL).

tag

Optional. Tag used for identifying the strategy or bot.

config

A list with API credentials: api_key, secret_key, passphrase.

tz

Timezone for parsing any timestamps (default: "Asia/Hong_Kong").

Value

A data.frame containing fields like order ID, client order ID, and timestamp.


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