What is the format for using the addDiv command in R? I know how to use the function as far as inputs go, but I can't figure out where it should be placed beyond a general idea. Do I place it after where I instantiate the portfolio? Below is the help article R provides:
Add cash dividend transactions to a portfolio.
Description
Adding a cash dividend does not affect position quantity, like a split would.
Usage
addDiv(Portfolio, Symbol, TxnDate, DivPerShare, ..., TxnFees = 0, ConMult = NULL, verbose = TRUE)Arguments
PortfolioA portfolio name that points to a portfolio object structured withinitPortf.
SymbolAn instrument identifier for a symbol included in the portfolio, e.g., IBM.
TxnDateTransaction date as ISO 8601, e.g., '2008-09-01' or '2010-01-05 09:54:23.12345'.
DivPerShareThe amount of the cash dividend paid per share or per unit quantity.
TxnFeesFees associated with the transaction, e.g. commissions. See Details.
ConMultContract or instrument multiplier for the Symbol if it is not defined in an instrument specification.
verboseIfTRUE(default) the function prints the elements of the transaction in a line to the screen, e.g., "2007-01-08 IBM 50 @ 77.6". Suppress usingFALSE.
...Any other passthrough parameters.Note
**# TODO add TxnTypes to $txn table
**# TODO add AsOfDate****