Backend function called by place_order(), get_order_status(), cancel_order(). Issues a buy/sell order or returns the status of an order. When issuing a buy order use the url column in the return data to check the status or cancel the order.
api_orders(
RH,
action,
status_url = NULL,
cancel_url = NULL,
instrument_id = NULL,
symbol = NULL,
type = NULL,
time_in_force = NULL,
trigger = NULL,
price = NULL,
stop_price = NULL,
quantity = NULL,
side = NULL,
page_size = NULL
)
object of class RobinHood
(string) one of "order", "status", "cancel", or "history"
(string) if action = "status", status_url is required (output from place_order())
(string) if action = "cancel", cancel_url is required (output from place_order())
(string) URL of the instrument_id
(string) Ticket symbol you are attempting to buy or sell
(string) "market" or "limit"
(string) Good For Day ("gfd"), Good Till Canceled ("gtc"), Immediate or Cancel ("ioc"), or Opening ("opg")
(string) "immediate" or "stop"
(number) the price you are willing to sell or buy at
(number) if trigger = stop, enter stop price, otherwise leave blank
(int) number of shares you wish to transact
(string) "buy" or "sell"
(int) for get_order_history, refers to the number of historical records to return