Retrieves account data for all accounts linked to the Access Token or a specific account

schwab_accountData(output = "df", account_number = "", accessTokenList = NULL)

Arguments

output

Use 'df' for a list of 3 data frames containing balances, positions, and orders. Otherwise the data will be returned as a list of lists

account_number

The account number as shown on Schwab

accessTokenList

A valid Access Token must be set using the output from schwab_auth3_accessToken. The most recent Access Token will be used by default unless one is manually passed into the function.

Value

a list of requested account details

Details

The output will be either a list of three data frames or a list of three lists that contain balances, positions, and orders for Schwab accounts linked to the access token or specified. For historical orders, see schwab_orderSearch. The default is for a data frame output which is much cleaner.

Examples

if (FALSE) { # \dontrun{

# Get stored refresh token
refreshToken = readRDS('/secure/location/')

# Generate a new access token
accessTokenList = schwab_auth3_accessToken(appKey, appSecret, refreshToken)

# Passing the accessTokenList is optional. The default will return balances
asDF = schwab_accountData()
asList = schwab_accountData('list',account_number = '', accessTokenList)

} # }