port_transform: transform portfolio history

port_transformR Documentation

transform portfolio history

Description

Transforms a PortfolioHistory response object returned from account_portfolio.

Usage

port_transform(resp)

Arguments

resp

(response) The response object

Value

A PortfolioHistory (tibble) Object with R amenable data types. Note that base value & timeframe can be accessed by calling attr(out, "info") on the returned tibble.

  • timestamp (Date/POSIXlt/Datetime(POSIXct)/character) time of each data element, with the first element being the beginning of the time window.

  • equity (numeric) equity value of the account in dollar amount as of the end of each time window

  • profit_loss (numeric) profit/loss in dollar from the base value

  • profit_loss_pct (numeric) profit/loss in percentage from the base value

  • base_value (numeric) basis in dollar of the profit loss calculation

  • timeframe (character) time window size of each data element


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