order_symbol_id: retrieve the order id if an order object is supplied

View source: R/Orders.R

order_symbol_idR Documentation

retrieve the order id if an order object is supplied

Description

Retrieves the order_id from an order object if provided as symbol_id, or provides informative error if input order failed.

Usage

order_symbol_id(
  symbol_id,
  ...,
  ovar = get0("ovar", mode = "environment", envir = rlang::caller_env())
)

Arguments

symbol_id

(character) The stock symbol (Required when action = "submit") or Order object (single row tibble) (Required when action = "cancel"/"replace"). To expedite the setting of stops and limits for open positions, an Order ID from a 'buy' order can be provided when action = "submit" to place a 'sell' order with the following parameters such that they do not need to be set manually:

  • side = 'sell'

  • If qty is not provided, it will be populated from the buy order

  • symbol_id will be set to the symbol from the buy order.

  • If client_order_id = TRUE, the client_order_id will be set to the buy Order ID provided, effectively linking the orders for your records.

  • All other parameters can be specified as usual.


jagg19/AlpacaforR documentation built on July 3, 2023, 12:14 p.m.