% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrappers_get_account.R
\name{get_account_positions_history}
\alias{get_account_positions_history}
\title{Get account position history}
\usage{
get_account_positions_history(config, tz = .okx_default_tz)
}
\arguments{
\item{config}{List. API credentials/config, typically containing
`api_key`, `secret_key`, and `passphrase`.}

\item{tz}{Character. Time zone for parsing timestamps. Default `"Asia/Hong_Kong"`.}
}
\value{
A `data.frame` with columns such as `instId`, `posId`, `posSide`, `pos`,
`lever`, `realizedPnl`, `fee`, plus timestamp fields (`cTime`, `uTime`).
}
\description{
Retrieve historical records of closed or adjusted positions.
}
\details{
Wraps `/api/v5/account/positions-history`. Includes closed positions and
their realized PnL. Returns one row per historical record.
}
\note{
Since okxr 0.1.1
}
\examples{
\dontrun{
cfg <- list(api_key = "xxx", secret_key = "xxx", passphrase = "xxx")
hist <- get_account_positions_history(config = cfg)
tail(hist)
}

}
\seealso{
[get_account_positions()]
}
