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

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

if (FALSE) {
# 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
)
}