update_market_value: Update Porfolio Market Value

Description Usage Arguments Details Value Examples

View source: R/Portfolio-update.R

Description

Function to update porfolio and holding's market value

Usage

1
update_market_value(pobj, prices = NULL)

Arguments

pobj

portfolio object

prices

tibble with symbol prices. requires symbol, and price columns

Details

Function appends portfolio's market value record for historical analysis and overwrites the holdings market value

Value

Updated Porfolio object with new market value

Examples

1
2
3
4
5
6
7
8
## Not run: 
p1 <- portfolio("new_port", cash=0) %>%
 make_deposit(amount = 5000) %>%
 make_buy(Sys.Date()-365, symbol = "SPY", quantity = 10, price = 200) %>%
 make_buy(Sys.Date()-365, symbol = "TLT", quantity = 25, price = 100)
 update_market_value(p1)

## End(Not run)

chrishaarstick/madstork documentation built on Jan. 3, 2022, 8:34 p.m.