restAPItrade {okxAPI}R Documentation

restAPItrade Class

Description

Wrapper for REST API TRADE.

Super class

okxAPI::restAPI -> restAPItrade

Methods

Public methods

Inherited methods

Method order()

See Place order for more information.

Usage
restAPItrade$order(
  instId,
  tdMode = c("isolated", "cross", "cash"),
  side = c("buy", "sell"),
  sz,
  ordType = c("market", "limit", "post_only", "fok", "ioc", "optimal_limit_ioc"),
  process = "identity",
  ...
)
Arguments
instId

Instrument ID, e.g. BTC-USD-190927-5000-C.

tdMode

Trade mode. Margin mode: cross or isolated. Non-Margin mode: cash.

side

Order side, buy or sell.

sz

Quantity to buy or sell.

ordType

Order type. market: Market order, limit: Limit order, post_only: Post-only order, fok: Fill-or-kill order, ioc: Immediate-or-cancel order, optimal_limit_ioc: Market order with immediate-or-cancel order (applicable only to Futures and Perpetual swap).

process

A function to process the data received from the API. Default to identity.

...

Other request parameters.


Method cancel_order()

See Cancel order for more information.

Usage
restAPItrade$cancel_order(instId, ordId, clOrdId, process = "identity", ...)
Arguments
instId

Instrument ID, e.g. BTC-USD-190927.

ordId

Order ID, Either ordId or clOrdId is required. If both are passed, ordId will be used.

clOrdId

Client Order ID as assigned by the client.

process

A function to process the data received from the API. Default to identity.

...

Other request parameters.


Method clone()

The objects of this class are cloneable with this method.

Usage
restAPItrade$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


[Package okxAPI version 0.1.1 Index]