Provides the transactions for a selected brokerage account based on the search criteria provided.

etrd_transactions(
  account,
  count = 50,
  fromDate = Sys.Date() - 30,
  toDate = Sys.Date(),
  output = c("df", "list"),
  access_tokens = NULL,
  etrade_cred = NULL,
  sandbox = FALSE
)

Arguments

account

The account ID key, not the account ID associated with the specific account. Use etrd_account_list to identify the proper account id key.

count

Number of transactions to return in the response with a max of 50. If not specified, defaults to 50.

fromDate

a date object for the start of the filter

toDate

a data object for the end of the filter

output

Indicate whether the output should be in the form of a data frame ('df') or list ('list'). Data frame is returned by default.

access_tokens

Access tokens are created using etrd_auth_access_token. This entry is not required because the output is saved and retrieved from R options automatically.

etrade_cred

The output created from etrd_auth_credentials when a valid ETRADE key and secret have been passed. This entry is not required because the output is saved and retrieved from R options automatically.

sandbox

ETRADE offers a sandbox environment for validating API calls and responses. If using the sandbox environment, this must be set to TRUE in each function called throughout etrader. ETRADE states "Sandbox responses use stored data that's intended to provide typical responses for basic use cases. So the responses you receive will not contain current data, and may not exactly match your requests in other ways." Essentially, the responses will not match the requests entered but successful pull will indicate whether the entry was valid or not.

Value

a list or df of transactions

Examples

if (FALSE) { # Search for mutual fund buys over the last month account_id = etrd_account_list()$accountIdKey[1] etrd_transactions(account_id, fromDate = Sys.Date()-30, toDate = Sys.Date()) }