% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrappers_post_trade.R
\name{post_trade_order}
\alias{post_trade_order}
\title{Place a Trade Order}
\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{
\item{inst_id}{Instrument ID (e.g., \code{"BTC-USDT"}).}

\item{td_mode}{Trade mode: \code{"cross"} or \code{"isolated"}.}

\item{side}{Order side: \code{"buy"} or \code{"sell"}.}

\item{ord_type}{Order type: \code{"limit"}, \code{"market"}, etc.}

\item{sz}{Size of the order (quantity to buy/sell).}

\item{pos_side}{Optional. Position side: \code{"long"} or \code{"short"}.}

\item{px}{Optional. Price (required for limit orders).}

\item{reduce_only}{Optional. Logical flag to indicate a reduce-only order.}

\item{tgt_ccy}{Optional. Quote currency (e.g., \code{"base"}, \code{"quote"}).}

\item{cl_ord_id}{Optional. Custom client order ID (auto-generated if NULL).}

\item{tag}{Optional. Tag used for identifying the strategy or bot.}

\item{config}{A list with API credentials: \code{api_key}, \code{secret_key}, \code{passphrase}.}

\item{tz}{Timezone for parsing any timestamps (default: \code{"Asia/Hong_Kong"}).}
}
\value{
A \code{data.frame} containing fields like order ID, client order ID, and timestamp.
}
\description{
Submits a trade order to the OKX exchange.
}
