td_accountData: Get account balances positions, and orders returned as a list

Description Usage Arguments Details Value Examples

View source: R/account.R

Description

Retrieves a account data for the accounts linked to the Access Token

Usage

1
td_accountData(output = "df", accessToken = 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

accessToken

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

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 TD Ameritrade accounts linked to the access token. For historical orders, see td_orderSearch. The default is for a data frame output which is much cleaner.

Value

a list of requested account details

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

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

# Generate a new access token
accessToken = td_auth_accessToken(refreshToken, 'consumerKey')

# Passing the accessToken is optional. The default will return balances
asDF = td_accountData()
asList = td_accountData('list',accessToken)


## End(Not run)

rameritrade documentation built on Feb. 22, 2021, 5:07 p.m.