account_activities: Get Account Activity

View source: R/Account.R

account_activitiesR Documentation

Get Account Activity

Description

The account activities API provides access to a historical record of transaction activities that have impacted your account. Trade execution activities and non-trade activities, such as dividend payments, are both reported through this endpoint. See Account Activities for details.

Usage

account_activities(
  activity_type = NULL,
  date = NULL,
  until = NULL,
  after = NULL,
  direction = "desc",
  page_size = 50,
  page_token = NULL,
  live = get_live()
)

Arguments

activity_type

(character) The activity type you want to view entries for. A list of valid activity types can be found in Details.

date

(character/Date) The date in YYYY-MM-DD format for which you want to see activities.

until

(character/Date) The response will contain only activities submitted before this date in YYYY-MM-DD format. (Cannot be used with date.)

after

(character/Date) The response will contain only activities submitted after this date in YYYY-MM-DD format. (Cannot be used with date.)

direction

(character) asc or desc, default is desc.

page_size

(integer/numeric) The maximum number of entries to return in the response.

page_token

(character) The ID of the end of your current page of results to indicate where the next page should start.

live

(logical) TRUE / FALSE if you are connecting to a live account. Default to FALSE, so it will use the paper url if nothing was provided.

Details

Activity Types:

  • "FILL" Order fills (both partial and full fills)

  • "TRANS" Cash transactions (both CSD and CSR)

  • "MISC" Miscellaneous or rarely used activity types (All types except those in TRANS, DIV, or FILL)

  • "ACATC" ACATS IN/OUT (Cash)

  • "ACATS" ACATS IN/OUT (Securities)

  • "CSD" Cash disbursement(+)

  • "CSR" Cash receipt(-)

  • "DIV" Dividends

  • "DIVCGL" Dividend (capital gain long term)

  • "DIVCGS" Dividend (capital gain short term)

  • "DIVFEE" Dividend fee

  • "DIVFT" Dividend adjusted (Foreign Tax Withheld)

  • "DIVNRA" Dividend adjusted (NRA Withheld)

  • "DIVROC" Dividend return of capital

  • "DIVTW" Dividend adjusted (Tefra Withheld)

  • "DIVTXEX" Dividend (tax exempt)

  • "INT" Interest (credit/margin)

  • "INTNRA" Interest adjusted (NRA Withheld)

  • "INTTW" Interest adjusted (Tefra Withheld)

  • "JNL" Journal entry

  • "JNLC" Journal entry (cash)

  • "JNLS" Journal entry (stock)

  • "MA" Merger/Acquisition

  • "NC" Name change

  • "OPASN" Option assignment

  • "OPEXP" Option expiration

  • "OPXRC" Option exercise

  • "PTC" Pass Thru Charge

  • "PTR" Pass Thru Rebate

  • "REORG" Reorg CA

  • "SC" Symbol change

  • "SSO" Stock spinoff

  • "SSP" Stock split

Value

TradeActivity (tibble) TradeActivity Object or a NonTradeActivity Object. See Details.

  • id (character) An id for the activity. Always in " ::" format. Can be sent as page_token in requests to facilitate the paging of results.

  • activity_type (character) Activity type to filter for. IE "FILL". Non case-sensitive.

  • transaction_time (POSIXct) The time at which the execution occurred.

  • type (character) "fill" or "partial_fill"

  • price (numeric) The per-share price that the trade was executed at.

  • qty (integer) The number of shares involved in the trade execution.

  • side (character) "buy" or "sell"

  • symbol (character) The symbol of the security being traded.

  • leaves_qty (integer) For partially_filled orders, the quantity of shares that are left to be filled.

  • order_id (character) The id for the order that filled.

  • cum_qty (integer) The cumulative quantity of shares involved in the execution.

NonTradeActivity (tibble) A NonTradeActivity Entity:

  • activity_type (character) See Details

  • id (character) An id for the activity. Always in " ::" format. Can be sent as page_token in requests to facilitate the paging of results.

  • date (POSIXct) The date on which the activity occurred or on which the transaction associated with the activity settled.

  • net_amount (numeric) The net amount of money (positive or negative) associated with the activity.

  • symbol (character) The symbol of the security involved with the activity. Not present for all activity types.

  • qty (integer) For dividend activities, the number of shares that contributed to the payment. Not present for other activity types.

  • per_share_amount (numeric) For dividend activities, the average amount paid per share. Not present for other activity types.

See Also

Other Account: account_config(), account_portfolio(), account()

Examples

account_activities(activity_type = "FILL")

jagg19/AlpacaforR documentation built on July 3, 2023, 12:14 p.m.