alpaca_new_order: Request a new order

Description Usage Arguments Value See Also

View source: R/orders.R

Description

Places a new order for the given account. An order request may be rejected if the account is not authorized for trading, or if the tradable balance is insufficient to fill the order.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
alpaca_new_order(
  symbol,
  qty = 1,
  side = "buy",
  type = "market",
  time_in_force = "day",
  limit_price = NULL,
  stop_price = NULL,
  extended_hours = FALSE,
  client_order_id = NULL,
  order_class = NULL,
  take_profit = NULL,
  stop_loss = NULL
)

Arguments

symbol

symbol or asset ID to identify the asset to trade

qty

number of shares to trade

side

buy or sell

type

market, limit, stop, or stop_limit

time_in_force

stringRequired day, gtc, opg, cls, ioc, fok. Please see Understand Orders for more info.

limit_price

string<number>Required required if type is limit or stop_limit

stop_price

string<number>Required required if type is stop or stop_limit

extended_hours

boolean (default) false. If true, order will be eligible to execute in premarket/afterhours. Only works with type limit and time_in_force day.

client_order_id

string (<= 48 characters) A unique identifier for the order. Automatically generated if not sent.

order_class

string simple, bracket, oco or oto. For details of non-simple order classes, please see Bracket Order Overview

take_profit

object Additional parameters for take-profit leg of advanced orders limit_price string<number>Required required for bracket orders

stop_loss

Additional parameters for stop-loss leg of advanced orders

Value

a list returned by alpaca

See Also

https://alpaca.markets/docs/trading-on-alpaca/orders/


mkearney/alpacar documentation built on May 5, 2020, 3:40 a.m.