TradeApi: Trade operations

TradeApiR Documentation

Trade operations

Description

binanceRapi.Trade

Format

An R6Class generator object

Methods

ApiV3AccountGet Account Information (USER_DATA) Get current account information. Weight(IP): 10

  • @param recv.window integer

  • @returnType Account

  • status code : 200 | Account details

  • return type : Account

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3AllOrderListGet Query all OCO (USER_DATA) Retrieves all OCO based on provided optional parameters Weight(IP): 10

  • @param from.id integer

  • @param start.time integer

  • @param end.time integer

  • @param limit integer

  • @param recv.window integer

  • @returnType list( inline_response_200_6 )

  • status code : 200 | List of OCO orders

  • return type : array[InlineResponse2006]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3AllOrdersGet All Orders (USER_DATA) Get all account orders; active, canceled, or filled.. - If `orderId` is set, it will get orders >= that `orderId`. Otherwise most recent orders are returned. - For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. - If `startTime` and/or `endTime` provided, `orderId` is not required Weight(IP): 10

  • @param symbol character

  • @param order.id integer

  • @param start.time integer

  • @param end.time integer

  • @param limit integer

  • @param recv.window integer

  • @returnType list( orderDetails )

  • status code : 200 | Current open orders

  • return type : array[OrderDetails]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3MyTradesGet Account Trade List (USER_DATA) Get trades for a specific account and symbol. If `fromId` is set, it will get id >= that `fromId`. Otherwise most recent orders are returned. Weight(IP): 10

  • @param symbol character

  • @param order.id integer

  • @param start.time integer

  • @param end.time integer

  • @param from.id integer

  • @param limit integer

  • @param recv.window integer

  • @returnType list( myTrade )

  • status code : 200 | List of trades

  • return type : array[MyTrade]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3OpenOrderListGet Query Open OCO (USER_DATA) Weight(IP): 3

  • @param recv.window integer

  • @returnType list( inline_response_200_7 )

  • status code : 200 | List of OCO orders

  • return type : array[InlineResponse2007]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3OpenOrdersDelete Cancel all Open Orders on a Symbol (TRADE) Cancels all active orders on a symbol. This includes OCO orders. Weight(IP): 1

  • @param symbol character

  • @param recv.window integer

  • @returnType list( anyOf<order,ocoOrder> )

  • status code : 200 | Cancelled orders

  • return type : array[AnyOforderocoOrder]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3OpenOrdersGet Current Open Orders (USER_DATA) Get all open orders on a symbol. Careful when accessing this with no symbol. Weight(IP): - `3` for a single symbol; - `40` when the symbol parameter is omitted;

  • @param symbol character

  • @param recv.window integer

  • @returnType list( orderDetails )

  • status code : 200 | Current open orders

  • return type : array[OrderDetails]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3OrderDelete Cancel Order (TRADE) Cancel an active order. Either `orderId` or `origClientOrderId` must be sent. Weight(IP): 1

  • @param symbol character

  • @param order.id integer

  • @param orig.client.order.id character

  • @param new.client.order.id character

  • @param recv.window integer

  • @returnType Order

  • status code : 200 | Cancelled order

  • return type : Order

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3OrderGet Query Order (USER_DATA) Check an order's status. - Either `orderId` or `origClientOrderId` must be sent. - For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. Weight(IP): 2

  • @param symbol character

  • @param order.id integer

  • @param orig.client.order.id character

  • @param recv.window integer

  • @returnType OrderDetails

  • status code : 200 | Order details

  • return type : OrderDetails

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3OrderListDelete Cancel OCO (TRADE) Cancel an entire Order List Canceling an individual leg will cancel the entire OCO Weight(IP): 1

  • @param symbol character

  • @param order.list.id integer

  • @param list.client.order.id character

  • @param new.client.order.id character

  • @param recv.window integer

  • @returnType OcoOrder

  • status code : 200 | Report on deleted OCO

  • return type : OcoOrder

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3OrderListGet Query OCO (USER_DATA) Retrieves a specific OCO based on provided optional parameters Weight(IP): 2

  • @param order.list.id integer

  • @param orig.client.order.id character

  • @param recv.window integer

  • @returnType InlineResponse2005

  • status code : 200 | OCO details

  • return type : InlineResponse2005

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3OrderOcoPost New OCO (TRADE) Send in a new OCO - Price Restrictions: - `SELL`: Limit Price > Last Price > Stop Price - `BUY`: Limit Price < Last Price < Stop Price - Quantity Restrictions: - Both legs must have the same quantity - `ICEBERG` quantities however do not have to be the same - Order Rate Limit - `OCO` counts as 2 orders against the order rate limit. Weight(IP): 1

  • @param symbol character

  • @param side Enum < [SELL, BUY] >

  • @param quantity numeric

  • @param price numeric

  • @param stop.price numeric

  • @param list.client.order.id character

  • @param limit.client.order.id character

  • @param limit.iceberg.qty numeric

  • @param trailing.delta numeric

  • @param stop.client.order.id character

  • @param stop.limit.price numeric

  • @param stop.iceberg.qty numeric

  • @param stop.limit.time.in.force Enum < [GTC, FOK, IOC] >

  • @param new.order.resp.type Enum < [ACK, RESULT, FULL] >

  • @param recv.window integer

  • @returnType InlineResponse2004

  • status code : 200 | New OCO details

  • return type : InlineResponse2004

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3OrderPost New Order (TRADE) Send in a new order. - &#x60;LIMIT_MAKER&#x60; are &#x60;LIMIT&#x60; orders that will be rejected if they would immediately match and trade as a taker. - &#x60;STOP_LOSS&#x60; and &#x60;TAKE_PROFIT&#x60; will execute a &#x60;MARKET&#x60; order when the &#x60;stopPrice&#x60; is reached. - Any &#x60;LIMIT&#x60; or &#x60;LIMIT_MAKER&#x60; type order can be made an iceberg order by sending an &#x60;icebergQty&#x60;. - Any order with an &#x60;icebergQty&#x60; MUST have &#x60;timeInForce&#x60; set to &#x60;GTC&#x60;. - &#x60;MARKET&#x60; orders using &#x60;quantity&#x60; specifies how much a user wants to buy or sell based on the market price. - &#x60;MARKET&#x60; orders using &#x60;quoteOrderQty&#x60; specifies the amount the user wants to spend (when buying) or receive (when selling) of the quote asset; the correct quantity will be determined based on the market liquidity and &#x60;quoteOrderQty&#x60;. - &#x60;MARKET&#x60; orders using &#x60;quoteOrderQty&#x60; will not break &#x60;LOT_SIZE&#x60; filter rules; the order will execute a quantity that will have the notional value as close as possible to &#x60;quoteOrderQty&#x60;. - same &#x60;newClientOrderId&#x60; can be accepted only when the previous one is filled, otherwise the order will be rejected. Trigger order price rules against market price for both &#x60;MARKET&#x60; and &#x60;LIMIT&#x60; versions: - Price above market price: &#x60;STOP_LOSS&#x60; &#x60;BUY&#x60;, &#x60;TAKE_PROFIT&#x60; &#x60;SELL&#x60; - Price below market price: &#x60;STOP_LOSS&#x60; &#x60;SELL&#x60;, &#x60;TAKE_PROFIT&#x60; &#x60;BUY&#x60; Weight(IP): 1

  • @param symbol character

  • @param side Enum < [SELL, BUY] >

  • @param type Enum < [LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT, LIMIT_MAKER] >

  • @param time.in.force Enum < [GTC, IOC, FOK] >

  • @param quantity numeric

  • @param quote.order.qty numeric

  • @param price numeric

  • @param new.client.order.id character

  • @param stop.price numeric

  • @param trailing.delta numeric

  • @param iceberg.qty numeric

  • @param new.order.resp.type Enum < [ACK, RESULT, FULL] >

  • @param recv.window integer

  • @returnType OneOforderResponseAckorderResponseResultorderResponseFull

  • status code : 200 | Order result

  • return type : OneOforderResponseAckorderResponseResultorderResponseFull

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3OrderTestPost Test New Order (TRADE) Test new order creation and signature/recvWindow long. Creates and validates a new order but does not send it into the matching engine. Weight(IP): 1

  • @param symbol character

  • @param side Enum < [SELL, BUY] >

  • @param type Enum < [LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT, LIMIT_MAKER] >

  • @param time.in.force Enum < [GTC, IOC, FOK] >

  • @param quantity numeric

  • @param quote.order.qty numeric

  • @param price numeric

  • @param new.client.order.id character

  • @param stop.price numeric

  • @param trailing.delta numeric

  • @param iceberg.qty numeric

  • @param new.order.resp.type Enum < [ACK, RESULT, FULL] >

  • @param recv.window integer

  • status code : 200 | OK

  • return type : object

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3RateLimitOrderGet Query Current Order Count Usage (TRADE) Displays the user&#39;s current order count usage for all intervals. Weight(IP): 20

  • @param recv.window integer

  • @returnType list( inline_response_200_8 )

  • status code : 200 | Order rate limits

  • return type : array[InlineResponse2008]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

Public fields

apiClient

Handles the client-server communication.

Methods

Public methods


Method new()

Usage
TradeApi$new(apiClient)

Method ApiV3AccountGet()

Usage
TradeApi$ApiV3AccountGet(recv.window = NULL, ...)

Method ApiV3AccountGetWithHttpInfo()

Usage
TradeApi$ApiV3AccountGetWithHttpInfo(recv.window = NULL, ...)

Method ApiV3AllOrderListGet()

Usage
TradeApi$ApiV3AllOrderListGet(
  from.id = NULL,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3AllOrderListGetWithHttpInfo()

Usage
TradeApi$ApiV3AllOrderListGetWithHttpInfo(
  from.id = NULL,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3AllOrdersGet()

Usage
TradeApi$ApiV3AllOrdersGet(
  symbol,
  order.id = NULL,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3AllOrdersGetWithHttpInfo()

Usage
TradeApi$ApiV3AllOrdersGetWithHttpInfo(
  symbol,
  order.id = NULL,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3MyTradesGet()

Usage
TradeApi$ApiV3MyTradesGet(
  symbol,
  order.id = NULL,
  start.time = NULL,
  end.time = NULL,
  from.id = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3MyTradesGetWithHttpInfo()

Usage
TradeApi$ApiV3MyTradesGetWithHttpInfo(
  symbol,
  order.id = NULL,
  start.time = NULL,
  end.time = NULL,
  from.id = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OpenOrderListGet()

Usage
TradeApi$ApiV3OpenOrderListGet(recv.window = NULL, ...)

Method ApiV3OpenOrderListGetWithHttpInfo()

Usage
TradeApi$ApiV3OpenOrderListGetWithHttpInfo(recv.window = NULL, ...)

Method ApiV3OpenOrdersDelete()

Usage
TradeApi$ApiV3OpenOrdersDelete(symbol, recv.window = NULL, ...)

Method ApiV3OpenOrdersDeleteWithHttpInfo()

Usage
TradeApi$ApiV3OpenOrdersDeleteWithHttpInfo(symbol, recv.window = NULL, ...)

Method ApiV3OpenOrdersGet()

Usage
TradeApi$ApiV3OpenOrdersGet(symbol = NULL, recv.window = NULL, ...)

Method ApiV3OpenOrdersGetWithHttpInfo()

Usage
TradeApi$ApiV3OpenOrdersGetWithHttpInfo(symbol = NULL, recv.window = NULL, ...)

Method ApiV3OrderDelete()

Usage
TradeApi$ApiV3OrderDelete(
  symbol,
  order.id = NULL,
  orig.client.order.id = NULL,
  new.client.order.id = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderDeleteWithHttpInfo()

Usage
TradeApi$ApiV3OrderDeleteWithHttpInfo(
  symbol,
  order.id = NULL,
  orig.client.order.id = NULL,
  new.client.order.id = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderGet()

Usage
TradeApi$ApiV3OrderGet(
  symbol,
  order.id = NULL,
  orig.client.order.id = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderGetWithHttpInfo()

Usage
TradeApi$ApiV3OrderGetWithHttpInfo(
  symbol,
  order.id = NULL,
  orig.client.order.id = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderListDelete()

Usage
TradeApi$ApiV3OrderListDelete(
  symbol,
  order.list.id = NULL,
  list.client.order.id = NULL,
  new.client.order.id = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderListDeleteWithHttpInfo()

Usage
TradeApi$ApiV3OrderListDeleteWithHttpInfo(
  symbol,
  order.list.id = NULL,
  list.client.order.id = NULL,
  new.client.order.id = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderListGet()

Usage
TradeApi$ApiV3OrderListGet(
  order.list.id = NULL,
  orig.client.order.id = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderListGetWithHttpInfo()

Usage
TradeApi$ApiV3OrderListGetWithHttpInfo(
  order.list.id = NULL,
  orig.client.order.id = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderOcoPost()

Usage
TradeApi$ApiV3OrderOcoPost(
  symbol,
  side,
  quantity,
  price,
  stop.price,
  list.client.order.id = NULL,
  limit.client.order.id = NULL,
  limit.iceberg.qty = NULL,
  trailing.delta = NULL,
  stop.client.order.id = NULL,
  stop.limit.price = NULL,
  stop.iceberg.qty = NULL,
  stop.limit.time.in.force = NULL,
  new.order.resp.type = NULL,
  side.effect.type = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderOcoPostWithHttpInfo()

Usage
TradeApi$ApiV3OrderOcoPostWithHttpInfo(
  symbol,
  side,
  quantity,
  price,
  stop.price,
  list.client.order.id = NULL,
  limit.client.order.id = NULL,
  limit.iceberg.qty = NULL,
  trailing.delta = NULL,
  stop.client.order.id = NULL,
  stop.limit.price = NULL,
  stop.iceberg.qty = NULL,
  stop.limit.time.in.force = NULL,
  new.order.resp.type = NULL,
  side.effect.type = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderPost()

Usage
TradeApi$ApiV3OrderPost(
  symbol,
  side,
  type,
  time.in.force = NULL,
  quantity = NULL,
  quote.order.qty = NULL,
  price = NULL,
  new.client.order.id = NULL,
  stop.price = NULL,
  trailing.delta = NULL,
  iceberg.qty = NULL,
  new.order.resp.type = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderPostWithHttpInfo()

Usage
TradeApi$ApiV3OrderPostWithHttpInfo(
  symbol,
  side,
  type,
  time.in.force = NULL,
  quantity = NULL,
  quote.order.qty = NULL,
  price = NULL,
  new.client.order.id = NULL,
  stop.price = NULL,
  trailing.delta = NULL,
  iceberg.qty = NULL,
  new.order.resp.type = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderTestPost()

Usage
TradeApi$ApiV3OrderTestPost(
  symbol,
  side,
  type,
  time.in.force = NULL,
  quantity = NULL,
  quote.order.qty = NULL,
  price = NULL,
  new.client.order.id = NULL,
  stop.price = NULL,
  trailing.delta = NULL,
  iceberg.qty = NULL,
  new.order.resp.type = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3OrderTestPostWithHttpInfo()

Usage
TradeApi$ApiV3OrderTestPostWithHttpInfo(
  symbol,
  side,
  type,
  time.in.force = NULL,
  quantity = NULL,
  quote.order.qty = NULL,
  price = NULL,
  new.client.order.id = NULL,
  stop.price = NULL,
  trailing.delta = NULL,
  iceberg.qty = NULL,
  new.order.resp.type = NULL,
  recv.window = NULL,
  ...
)

Method ApiV3RateLimitOrderGet()

Usage
TradeApi$ApiV3RateLimitOrderGet(recv.window = NULL, ...)

Method ApiV3RateLimitOrderGetWithHttpInfo()

Usage
TradeApi$ApiV3RateLimitOrderGetWithHttpInfo(recv.window = NULL, ...)

Method clone()

The objects of this class are cloneable with this method.

Usage
TradeApi$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

## Not run: 
####################  ApiV3AccountGet  ####################

library(binanceRapi)
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Account Information (USER_DATA)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3AccountGet(recv.window=var.recv.window)


####################  ApiV3AllOrderListGet  ####################

library(binanceRapi)
var.from.id <- 56 # integer | Trade id to fetch from. Default gets most recent trades.
var.start.time <- 56 # integer | UTC timestamp in ms
var.end.time <- 56 # integer | UTC timestamp in ms
var.limit <- 500 # integer | Default 500; max 1000.
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Query all OCO (USER_DATA)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3AllOrderListGet(from.id=var.from.id, start.time=var.start.time, end.time=var.end.time, limit=var.limit, recv.window=var.recv.window)


####################  ApiV3AllOrdersGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.order.id <- 56 # integer | Order id
var.start.time <- 56 # integer | UTC timestamp in ms
var.end.time <- 56 # integer | UTC timestamp in ms
var.limit <- 500 # integer | Default 500; max 1000.
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#All Orders (USER_DATA)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3AllOrdersGet(var.symbol, order.id=var.order.id, start.time=var.start.time, end.time=var.end.time, limit=var.limit, recv.window=var.recv.window)


####################  ApiV3MyTradesGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.order.id <- 56 # integer | This can only be used in combination with symbol.
var.start.time <- 56 # integer | UTC timestamp in ms
var.end.time <- 56 # integer | UTC timestamp in ms
var.from.id <- 56 # integer | Trade id to fetch from. Default gets most recent trades.
var.limit <- 500 # integer | Default 500; max 1000.
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Account Trade List (USER_DATA)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3MyTradesGet(var.symbol, order.id=var.order.id, start.time=var.start.time, end.time=var.end.time, from.id=var.from.id, limit=var.limit, recv.window=var.recv.window)


####################  ApiV3OpenOrderListGet  ####################

library(binanceRapi)
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Query Open OCO (USER_DATA)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3OpenOrderListGet(recv.window=var.recv.window)


####################  ApiV3OpenOrdersDelete  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Cancel all Open Orders on a Symbol (TRADE)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3OpenOrdersDelete(var.symbol, recv.window=var.recv.window)


####################  ApiV3OpenOrdersGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Current Open Orders (USER_DATA)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3OpenOrdersGet(symbol=var.symbol, recv.window=var.recv.window)


####################  ApiV3OrderDelete  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.order.id <- 56 # integer | Order id
var.orig.client.order.id <- 'orig.client.order.id_example' # character | Order id from client
var.new.client.order.id <- 'new.client.order.id_example' # character | Used to uniquely identify this cancel. Automatically generated by default
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Cancel Order (TRADE)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3OrderDelete(var.symbol, order.id=var.order.id, orig.client.order.id=var.orig.client.order.id, new.client.order.id=var.new.client.order.id, recv.window=var.recv.window)


####################  ApiV3OrderGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.order.id <- 56 # integer | Order id
var.orig.client.order.id <- 'orig.client.order.id_example' # character | Order id from client
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Query Order (USER_DATA)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3OrderGet(var.symbol, order.id=var.order.id, orig.client.order.id=var.orig.client.order.id, recv.window=var.recv.window)


####################  ApiV3OrderListDelete  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.order.list.id <- 56 # integer | Order list id
var.list.client.order.id <- 'list.client.order.id_example' # character | A unique Id for the entire orderList
var.new.client.order.id <- 'new.client.order.id_example' # character | Used to uniquely identify this cancel. Automatically generated by default
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Cancel OCO (TRADE)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3OrderListDelete(var.symbol, order.list.id=var.order.list.id, list.client.order.id=var.list.client.order.id, new.client.order.id=var.new.client.order.id, recv.window=var.recv.window)


####################  ApiV3OrderListGet  ####################

library(binanceRapi)
var.order.list.id <- 56 # integer | Order list id
var.orig.client.order.id <- 'orig.client.order.id_example' # character | Order id from client
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Query OCO (USER_DATA)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3OrderListGet(order.list.id=var.order.list.id, orig.client.order.id=var.orig.client.order.id, recv.window=var.recv.window)


####################  ApiV3OrderOcoPost  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.side <- 'SELL' # character | 
var.quantity <- 3.4 # numeric | 
var.price <- 3.4 # numeric | Order price
var.stop.price <- 3.4 # numeric | 
var.list.client.order.id <- 'list.client.order.id_example' # character | A unique Id for the entire orderList
var.limit.client.order.id <- 'limit.client.order.id_example' # character | A unique Id for the limit order
var.limit.iceberg.qty <- 3.4 # numeric | 
var.trailing.delta <- 3.4 # numeric | 
var.stop.client.order.id <- 'stop.client.order.id_example' # character | A unique Id for the stop loss/stop loss limit leg
var.stop.limit.price <- 3.4 # numeric | If provided, stopLimitTimeInForce is required.
var.stop.iceberg.qty <- 3.4 # numeric | 
var.stop.limit.time.in.force <- 'stop.limit.time.in.force_example' # character | 
var.new.order.resp.type <- 'new.order.resp.type_example' # character | Set the response JSON.
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#New OCO (TRADE)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3OrderOcoPost(var.symbol, var.side, var.quantity, var.price, var.stop.price, list.client.order.id=var.list.client.order.id, limit.client.order.id=var.limit.client.order.id, limit.iceberg.qty=var.limit.iceberg.qty, trailing.delta=var.trailing.delta, stop.client.order.id=var.stop.client.order.id, stop.limit.price=var.stop.limit.price, stop.iceberg.qty=var.stop.iceberg.qty, stop.limit.time.in.force=var.stop.limit.time.in.force, new.order.resp.type=var.new.order.resp.type, recv.window=var.recv.window)


####################  ApiV3OrderPost  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.side <- 'SELL' # character | 
var.type <- 'type_example' # character | Order type
var.time.in.force <- 'time.in.force_example' # character | Order time in force
var.quantity <- 3.4 # numeric | Order quantity
var.quote.order.qty <- 3.4 # numeric | Quote quantity
var.price <- 3.4 # numeric | Order price
var.new.client.order.id <- 'new.client.order.id_example' # character | Used to uniquely identify this cancel. Automatically generated by default
var.stop.price <- 20.01 # numeric | Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
var.trailing.delta <- 3.4 # numeric | Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
var.iceberg.qty <- 3.4 # numeric | Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
var.new.order.resp.type <- 'new.order.resp.type_example' # character | Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#New Order (TRADE)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3OrderPost(var.symbol, var.side, var.type, time.in.force=var.time.in.force, quantity=var.quantity, quote.order.qty=var.quote.order.qty, price=var.price, new.client.order.id=var.new.client.order.id, stop.price=var.stop.price, trailing.delta=var.trailing.delta, iceberg.qty=var.iceberg.qty, new.order.resp.type=var.new.order.resp.type, recv.window=var.recv.window)


####################  ApiV3OrderTestPost  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.side <- 'SELL' # character | 
var.type <- 'type_example' # character | Order type
var.time.in.force <- 'time.in.force_example' # character | Order time in force
var.quantity <- 3.4 # numeric | Order quantity
var.quote.order.qty <- 3.4 # numeric | Quote quantity
var.price <- 3.4 # numeric | Order price
var.new.client.order.id <- 'new.client.order.id_example' # character | Used to uniquely identify this cancel. Automatically generated by default
var.stop.price <- 20.01 # numeric | Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
var.trailing.delta <- 3.4 # numeric | Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
var.iceberg.qty <- 3.4 # numeric | Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
var.new.order.resp.type <- 'new.order.resp.type_example' # character | Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Test New Order (TRADE)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3OrderTestPost(var.symbol, var.side, var.type, time.in.force=var.time.in.force, quantity=var.quantity, quote.order.qty=var.quote.order.qty, price=var.price, new.client.order.id=var.new.client.order.id, stop.price=var.stop.price, trailing.delta=var.trailing.delta, iceberg.qty=var.iceberg.qty, new.order.resp.type=var.new.order.resp.type, recv.window=var.recv.window)


####################  ApiV3RateLimitOrderGet  ####################

library(binanceRapi)
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Query Current Order Count Usage (TRADE)
api.instance <- TradeApi$new()

result <- api.instance$ApiV3RateLimitOrderGet(recv.window=var.recv.window)



## End(Not run)

grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.