spot-new-order: Create new order

spot-new-orderR Documentation

Create new order

Description

Exposes the POST /api/v3/order/ endpoint.

Usage

spot_new_order(
  order_type,
  symbol,
  side,
  quantity,
  price = NULL,
  time_in_force = NULL,
  test = FALSE,
  fills = TRUE
)

spot_new_market_order(...)

spot_new_limit_order(...)

Arguments

order_type

Order type. One of "LIMIT", "MARKET", "STOP_LOSS", "STOP_LOSS_LIMIT", "TAKE_PROFIT", "TAKE_PROFIT_LIMIT" or "LIMIT_MAKER".

symbol

Symbol.

side

Trade side. Either "BUY" or "SELL".

quantity

Amount to buy or sell.

price

Price at which to buy or sell.

time_in_force

Time for which order is valid. Options are: "GTC" — (Good Til Canceled) order will remain on the book unless canceled; "IOC" — (Immediate Or Cancel) try to fill as much as possible before it expires; or "FOK" — (Fill Or Kill) Order will expire if full order cannot be filled.

test

Is this just a test?

fills

Whether to returns fills element.

...

Further arguments passed to or from other methods.

Value

A data frame.

Examples

## Not run: 
# Create new order (returns a data frame).
spot_new_order(
  order_type = "LIMIT",
  symbol = "LTCUSDT",
  side = "SELL",
  quantity = 1,
  price = 67,
  time_in_force = "GTC"
)

# Test new order creation (returns a Boolean).
spot_new_order(
  order_type = "LIMIT",
  symbol = "LTCUSDT",
  side = "SELL",
  quantity = 1,
  price = 67,
  time_in_force = "GTC",
  test = TRUE
)

## End(Not run)

datawookie/binance documentation built on March 19, 2023, 11:01 p.m.