td_orderSearch {rameritrade} | R Documentation |
Search for orders by date
Description
Search for orders associated with a TD account over the previous 60 days. The result is a list of three objects:
jsonlite formatted extract of all orders
all entered orders with details
a data frame of all executed orders with the executions
Usage
td_orderSearch(
accountNumber,
startDate = Sys.Date() - 30,
endDate = Sys.Date(),
maxResults = 50,
orderStatus = "",
accessToken = NULL
)
Arguments
accountNumber |
The TD brokerage account number associated with the Access Token |
startDate |
Orders from a certain date with. Format yyyy-mm-dd. TD indicates there is a 60 day max, but this limit may not always apply |
endDate |
Filter orders that occurred before a certain date. Format yyyy-mm-dd |
maxResults |
the max results to return in the query |
orderStatus |
search by order status (ACCEPTED, FILLED, EXPIRED, CANCELED, REJECTED, etc) |
accessToken |
A valid Access Token must be set using
|
Value
a list of three objects: a jsonlite formatted extract of all orders, all entered orders with details, a data frame of all executed orders with the executions
Examples
## Not run:
# Get all orders run over the last 50 days (up to 500)
td_orderSearch(accountNumber = 987654321,
startDate = Sys.Date()-days(50),
maxResult = 500, orderStatus = 'FILLED')
## End(Not run)