stocks_file()
lets the user download his personal Excel with his
Portfolio's data, locally or from Dropbox.
daily_stocks()
creates a dataframe with all relevant metrics and values,
for each ticker or symbol, for every day since inception.
daily_portfolio()
creates a data.frame with all relevant
metrics and values, for the overall portfolio, for every day
since inception.
stocks_obj()
lets the user create his portfolio's calculations and
plots for further study.
stocks_report()
lets the user create his portfolio's full report with
plots and send it to an email with the HTML report attached
stocks_file(
file = NA,
creds = NA,
auto = TRUE,
sheets = c("Portafolio", "Fondos", "Transacciones"),
keep_old = TRUE,
cache = TRUE,
quiet = FALSE,
...
)daily_stocks(hist, trans, tickers = NA, window = "MAX", ...)
daily_portfolio(hist, trans, cash, cash_fix = 0, window = "MAX")
stocks_obj(
data = stocks_file(),
cash_fix = 0,
tax = 30,
sectors = FALSE,
parg = FALSE,
window = c("1M", "YTD", "1Y", "MAX"),
cache = TRUE,
quiet = FALSE
)
stocks_report(
data = NA,
keep_old = TRUE,
dir = NA,
mail = FALSE,
attachment = TRUE,
to = "laresbernardo@gmail.com",
sectors = FALSE,
keep = FALSE,
creds = NA,
cache = TRUE
)
List with portfolio, transactions, and cash data.frames.
data.frame. Processed at date and symbol level.
data.frame. Processed at date and portfolio level.
List. Aggregated results and plots.
Invisible list. Aggregated results and plots.
Character. Import an Excel file, local or from URL.
Character. Credential's user (see get_creds()
) for
sending mail and Dropbox interaction.
Boolean. Automatically use my local personal file? You might want
to set in into your .Renviron LARES_PORTFOLIO=~/dir/to/your/file.xlsx
so you
can leave all other parameters as NA
and use it every time.
Character Vector. Names of each sheet containing Portfolio summary, Cash, and Transactions information. Please, keep the order of these tabs.
Boolean. Include sold tickers even though not currently in portfolio?
Boolean. Use daily cache if available?
Boolean. Keep quiet? If not, informative messages will be printed.
Additional parameters.
Dataframe. Result from stocks_hist()
Dataframe. Result from stocks_file()$transactions
Dataframe. Result from stocks_file()$portfolio
Character. Choose any of: "1W", "1M", "6M", "1Y", "YTD", "5Y", "MAX"
Dataframe. Result from stocks_file()$cash
Numeric. If, for some reason, you need to fix your cash amount for all reports, set the amount here
Character. stocks_obj()
output. If NA, automatic
parameters and stocks_file()
defaults will be used.
Numeric. How much [0-99] of your dividends are gone with taxes?
Boolean. Return sectors segmentation for ETFs?
Boolean. Personal argument. Used to personalize stuff, in this case, taxes changed from A to B in given date (hard-coded)
Character. Directory for HTML report output. If set to NA, current working directory will be used. If mail sent, file will be erased
Boolean. Do you want to send an email with the report attached? If not, an HTML file will be created in dir
Boolean. Create and add report as attachment if
mail=TRUE
? If not, no report will be rendered and only tabulated
summaries will be included on email's body.
Character. Email to send the report to
Boolean. Keep HTML file when sent by email?
Other Investment:
etf_sector()
,
splot_summary()
,
stocks_quote()
Other Credentials:
db_download()
,
db_upload()
,
get_credentials()
,
get_tweets()
,
mail_send()
,
queryDB()
,
queryGA()
,
slackSend()
if (FALSE) {
# Load lares dummy portfolio XLSX
file <- system.file("inst/docs", "dummyPortfolio.xlsx", package = "lares")
df <- stocks_file(
file = file,
sheets = c("Portafolio", "Fondos", "Transacciones"),
keep_old = FALSE
)
}
if (FALSE) {
list <- stocks_obj()
stocks_report(list, dir = "~/Desktop")
}
Run the code above in your browser using DataLab