transfer_out: Transfer Out Holdings function

Description Usage Arguments Value Examples

View source: R/Trades.R

Description

Function removes holding from portfolio without a cash transaction

Usage

1
transfer_out(pobj, id, date = Sys.Date(), quantity, desc = "")

Arguments

pobj

portfolio object

id

holding id to sell

date

date of transaction. Date type

quantity

number of shares. numeric type

desc

trade description. string type

Value

updated portfolio object

Examples

1
2
3
4
5
library(tidyverse)
 p1 <- portfolio("new_port") %>%
       make_deposit(Sys.Date(), amount = 2000) %>%
       make_buy(Sys.Date()-1, symbol = "SPY", quantity = 10, price = 100) %>%
       transfer_out(id = 1, quantity = 10)

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