% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrappers_post_trade.R
\name{post_trade_close_position}
\alias{post_trade_close_position}
\title{Close a Position}
\usage{
post_trade_close_position(
  inst_id,
  mgn_mode,
  pos_side,
  tz = .okx_default_tz,
  config
)
}
\arguments{
\item{inst_id}{Instrument ID (e.g., \code{"BTC-USDT"}).}

\item{mgn_mode}{Margin mode: \code{"cross"} or \code{"isolated"}.}

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

\item{tz}{Timezone for parsing any timestamps (default: \code{"Asia/Hong_Kong"}).}

\item{config}{A list with API credentials: \code{api_key}, \code{secret_key}, \code{passphrase}.}
}
\value{
A \code{data.frame} with close position confirmation details.
}
\description{
Submits a request to close a position for a given instrument and position side.
}
