stocks: Fast Functions for Stock Market Analysis
Version 1.1.2

Functions for analyzing stocks or other investments. Main features are loading and aligning historical data for ticker symbols, calculating performance metrics for individual funds or portfolios (e.g. compound annualized growth rate, maximum drawdown, Sharpe/Sortino ratio), and creating graphs. C++ code is used where possible to improve processing speed.

AuthorDane R. Van Domelen
Date of publication2017-05-16 18:30:05
MaintainerDane R. Van Domelen <vandomed@gmail.com>
LicenseGPL-2
Version1.1.2
Package repositoryView on R-Forge
InstallationInstall the latest version of this package by entering the following in R:
install.packages("stocks", repos="http://R-Forge.R-project.org")

Getting started

Package overview

Popular man pages

daily_yearly: Convert Daily Gain to X-year Gain
mdd: Maximum Drawdown
metrics: Calculate a Variety of Performance Metrics
vanguard_igrade_etfs: Vanguard Investment-grade Bond ETFs and Inception Dates as of...
vanguard_largecap_funds: Vanguard Large-cap Stock Mutual Funds and Inception Dates as...
vanguard_traditional_funds: Vanguard Traditional Mutual Funds and Inception Dates as of...
vanguard_treasury_etfs: Vanguard Treasury/Agency Bond ETFs as of April 2, 2017
See all...

All man pages Function index File listing

Man pages

balances: Calculate Balances Based on Initial Balance and Vector of...
beta_trailing50: Beta for Last 50 Daily Gains
contango_hedged: Implement a Hedged Contango-Based Volatility Trading Strategy
contango_simple: Implement a Simple Contango-Based Volatility Trading Strategy
convert_rate: Convert Gain from One Time Interval to Another
daily_yearly: Convert Daily Gain to X-year Gain
diffs: Lagged Differences (Alternate Implementation)
final_balance: Calculate Final Balance Based on Initial Balance and Vector...
gains_graph: Create Scatterplot of Investment Gains
gains_rate: Calculate Growth Rate From a Vector of Investment Gains
growth_graph: Graph Investment Growth
highyield_etfs: High-Yield ETFs from ETFdb.com and Inception Dates as of...
largest_etfs: Largest 100 Market Cap ETFs and Inception Dates as of April...
list_override: Add/Replace Elements of First List with Elements of Second...
load_gains: Download and Align Investment Gains for a Set of Tickers
load_prices: Download and Align Historical Prices for a Set of Tickers
mdd: Maximum Drawdown
metrics: Calculate a Variety of Performance Metrics
neg: Return Negative Elements of a Numeric Vector
nonneg: Return Non-Negative Elements of a Numeric Vector
nonpos: Return Non-Positive Elements of a Numeric Vector
onemetric_graph: Graph Performance Metric
onemetric_overtime_graph: Graph Performance Metric Over Time
pchanges: Lagged Proportion/Percent Changes
pdiffs: Lagged Proportion/Percent Differences
pos: Return Positive Elements of a Numeric Vector
prices_rate: Calculate Growth Rate From a Vector of Stock Prices or...
ratios: Ratios of Subsequent Elements in a Numeric Vector
rrr: Risk-Return Ratio
sector_spdr_etfs: Sector SPDR ETFs and Inception Dates as of April 7, 2017
sharpe_ratio: Sharpe Ratio
sortino_ratio: Sortino Ratio
stocks-package: Fast Functions for Stock Market Analysis
targetbeta_twofunds: Implement a Two-Fund Strategy that Targets a Particular Beta
threefunds_graph: Graph One Performance Metric vs. Another for Three-Fund...
ticker_dates: Get Yahoo! Finance Start/End Dates for One or More Tickers
twofunds_graph: Graph One Performance Metric vs. Another for Two-Fund...
twometrics_graph: Graph One Performance Metric vs. Another
vanguard_balanced_funds: Vanguard Balanced Mutual Funds and Inception Dates as of...
vanguard_bond_etfs: Vanguard Bond ETFs and Inception Dates as of April 2, 2017
vanguard_bond_funds: Vanguard Bond Mutual Funds and Inception Dates as of April 2,...
vanguard_etfs: Vanguard ETFs and Inception Dates as of April 2, 2017
vanguard_funds: Vanguard Mutual Funds and Inception Dates as of April 2, 2017
vanguard_igrade_etfs: Vanguard Investment-grade Bond ETFs and Inception Dates as of...
vanguard_igrade_funds: Vanguard Investment-grade Bond Mutual Funds and Inception...
vanguard_international_etfs: Vanguard International ETFs and Inception Dates as of April...
vanguard_international_funds: List of Vanguard International Mutual Funds and Inception...
vanguard_largecap_etfs: Vanguard Large-cap Stock ETFs and Inception Dates as of April...
vanguard_largecap_funds: Vanguard Large-cap Stock Mutual Funds and Inception Dates as...
vanguard_midcap_etfs: Vanguard Mid-cap Stock ETFs and Inception Dates as of April...
vanguard_midcap_funds: Vanguard Mid-cap Stock Mutual Funds and Inception Dates as of...
vanguard_sector_etfs: Vanguard Sector & Specialty ETFs and Inception Dates as of...
vanguard_sector_funds: Vanguard Sector Mutual Funds and Inception Dates as of April...
vanguard_smallcap_etfs: Vanguard Small-cap Stock ETFs and Inception Dates as of April...
vanguard_smallcap_funds: Vanguard Small-cap Stock Mutual Funds and Inception Dates as...
vanguard_stock_etfs: Vanguard Stock ETFs and Inception Dates as of April 2, 2017
vanguard_stock_funds: Vanguard Stock Mutual Funds and Inception Dates as of April...
vanguard_targetdate_funds: Vanguard Target Date Mutual Funds as of April 2, 2017
vanguard_targetrisk_funds: Vanguard Target Risk Mutual Funds and Inception Dates as of...
vanguard_taxexempt_bond_funds: Vanguard Tax-exempt Bond Mutual Funds and Inception Dates as...
vanguard_traditional_funds: Vanguard Traditional Mutual Funds and Inception Dates as of...
vanguard_treasury_etfs: Vanguard Treasury/Agency Bond ETFs as of April 2, 2017
vanguard_treasury_funds: Vanguard Treasury/Agency Bond Mutual Funds and Inception...
yearly_daily: Convert X-year Gain to Average Daily Gain
zzz: Daily Closing Prices for Imaginary Stock ZZZ Over 10 Years

Functions

balances Man page Source code
beta.trailing50 Man page Source code
contango.hedged Man page Source code
contango.simple Man page Source code
convert.rate Man page Source code
daily.yearly Man page Source code
diffs Man page Source code
final.balance Man page Source code
gains.graph Man page Source code
gains.rate Man page Source code
growth.graph Man page Source code
highyield.etfs Man page
largest.etfs Man page
list.override Man page Source code
load.gains Man page Source code
load.prices Man page Source code
mdd Man page Source code
metrics Man page Source code
neg Man page Source code
nonneg Man page Source code
nonpos Man page Source code
onemetric.graph Man page Source code
onemetric.overtime.graph Man page Source code
pchanges Man page Source code
pdiffs Man page Source code
pos Man page Source code
prices.rate Man page Source code
ratios Man page Source code
rrr Man page Source code
sector.spdr.etfs Man page
sharpe.ratio Man page Source code
sortino.ratio Man page Source code
stocks Man page
stocks-package Man page
targetbeta.twofunds Man page Source code
threefunds.graph Man page Source code
ticker.dates Man page Source code
twofunds.graph Man page Source code
twometrics.graph Man page Source code
vanguard.balanced.funds Man page
vanguard.bond.etfs Man page
vanguard.bond.funds Man page
vanguard.etfs Man page
vanguard.funds Man page
vanguard.igrade.etfs Man page
vanguard.igrade.funds Man page
vanguard.international.etfs Man page
vanguard.international.funds Man page
vanguard.largecap.etfs Man page
vanguard.largecap.funds Man page
vanguard.midcap.etfs Man page
vanguard.midcap.funds Man page
vanguard.sector.etfs Man page
vanguard.sector.funds Man page
vanguard.smallcap.etfs Man page
vanguard.smallcap.funds Man page
vanguard.stock.etfs Man page
vanguard.stock.funds Man page
vanguard.targetdate.funds Man page
vanguard.targetrisk.funds Man page
vanguard.taxexempt.bond.funds Man page
vanguard.traditional.funds Man page
vanguard.treasury.etfs Man page
vanguard.treasury.funds Man page
yearly.daily Man page Source code
zzz Man page

Files

DESCRIPTION
NAMESPACE
R
R/RcppExports.R
data
data/highyield_etfs.rda
data/largest_etfs.rda
data/sector_spdr_etfs.rda
data/vanguard_balanced_funds.rda
data/vanguard_bond_etfs.rda
data/vanguard_bond_funds.rda
data/vanguard_etfs.rda
data/vanguard_funds.rda
data/vanguard_igrade_etfs.rda
data/vanguard_igrade_funds.rda
data/vanguard_international_etfs.rda
data/vanguard_international_funds.rda
data/vanguard_largecap_etfs.rda
data/vanguard_largecap_funds.rda
data/vanguard_midcap_etfs.rda
data/vanguard_midcap_funds.rda
data/vanguard_sector_etfs.rda
data/vanguard_sector_funds.rda
data/vanguard_smallcap_etfs.rda
data/vanguard_smallcap_funds.rda
data/vanguard_stock_etfs.rda
data/vanguard_stock_funds.rda
data/vanguard_targetdate_funds.rda
data/vanguard_targetrisk_funds.rda
data/vanguard_taxexempt_bond_funds.rda
data/vanguard_traditional_funds.rda
data/vanguard_treasury_etfs.rda
data/vanguard_treasury_funds.rda
data/zzz.rda
man
man/balances.Rd
man/beta_trailing50.Rd
man/contango_hedged.Rd
man/contango_simple.Rd
man/convert_rate.Rd
man/daily_yearly.Rd
man/diffs.Rd
man/final_balance.Rd
man/gains_graph.Rd
man/gains_rate.Rd
man/growth_graph.Rd
man/highyield_etfs.Rd
man/largest_etfs.Rd
man/list_override.Rd
man/load_gains.Rd
man/load_prices.Rd
man/mdd.Rd
man/metrics.Rd
man/neg.Rd
man/nonneg.Rd
man/nonpos.Rd
man/onemetric_graph.Rd
man/onemetric_overtime_graph.Rd
man/pchanges.Rd
man/pdiffs.Rd
man/pos.Rd
man/prices_rate.Rd
man/ratios.Rd
man/rrr.Rd
man/sector_spdr_etfs.Rd
man/sharpe_ratio.Rd
man/sortino_ratio.Rd
man/stocks-package.Rd
man/targetbeta_twofunds.Rd
man/threefunds_graph.Rd
man/ticker_dates.Rd
man/twofunds_graph.Rd
man/twometrics_graph.Rd
man/vanguard_balanced_funds.Rd
man/vanguard_bond_etfs.Rd
man/vanguard_bond_funds.Rd
man/vanguard_etfs.Rd
man/vanguard_funds.Rd
man/vanguard_igrade_etfs.Rd
man/vanguard_igrade_funds.Rd
man/vanguard_international_etfs.Rd
man/vanguard_international_funds.Rd
man/vanguard_largecap_etfs.Rd
man/vanguard_largecap_funds.Rd
man/vanguard_midcap_etfs.Rd
man/vanguard_midcap_funds.Rd
man/vanguard_sector_etfs.Rd
man/vanguard_sector_funds.Rd
man/vanguard_smallcap_etfs.Rd
man/vanguard_smallcap_funds.Rd
man/vanguard_stock_etfs.Rd
man/vanguard_stock_funds.Rd
man/vanguard_targetdate_funds.Rd
man/vanguard_targetrisk_funds.Rd
man/vanguard_taxexempt_bond_funds.Rd
man/vanguard_traditional_funds.Rd
man/vanguard_treasury_etfs.Rd
man/vanguard_treasury_funds.Rd
man/yearly_daily.Rd
man/zzz.Rd
src
src/RcppExports.cpp
src/balances_weighted_c.cpp
src/diffs_c.cpp
src/mdd_hl_c1.cpp
src/mdd_hl_c2.cpp
src/mdd_p_c1.cpp
src/mdd_p_c2.cpp
src/pchanges_c.cpp
src/pdiffs_c.cpp
src/ratios_c.cpp
stocks documentation built on May 21, 2017, 1:17 a.m.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.