Learn R Programming

stocks (version 1.1.4)

Stock Market Analysis

Description

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. annualized growth, maximum drawdown, Sharpe/Sortino ratio), and creating graphs. C++ code is used to improve processing speed where possible.

Copy Link

Version

Install

install.packages('stocks')

Monthly Downloads

189

Version

1.1.4

License

GPL-3

Maintainer

Dane Van Domelen

Last Published

August 31st, 2018

Functions in stocks (1.1.4)

vanguard_largecap_funds

Vanguard Large-cap Stock Mutual Funds and Inception Dates
vanguard_midcap_etfs

Vanguard Mid-cap Stock ETFs and Inception Dates
vanguard_targetrisk_funds

Vanguard Target Risk Mutual Funds and Inception Dates
vanguard_taxexempt_bond_funds

Vanguard Tax-exempt Bond Mutual Funds and Inception Dates
load_gains

Download and Align Gains for a Set of Tickers
load_prices

Download and Align Historical Prices for a Set of Tickers
prices_gains

Convert Prices to Gains
prices_rate

Calculate Growth Rate From a Vector of Prices
growth_graph

Graph Investment Growth
onemetric_graph

Graph Performance Metric for Various Investments
gains_rate

Calculate Growth Rate From a Vector of Gains
onemetric_overtime_graph

Graph Performance Metric Over Time for Various Investments
sector_spdr_etfs

Sector SPDR ETFs and Inception Dates
sharpe

Sharpe Ratio
beta_trailing50

Beta for Last 50 Daily Gains
vanguard_bond_funds

Vanguard Bond Mutual Funds
vanguard_etfs

Vanguard ETFs and Inception Dates
contango_hedged

Backtest a Hedged Contango-Based Volatility Trading Strategy
pdiffs

Lagged Proportion Differences
pchanges

Lagged Proportion Changes
vanguard_midcap_funds

Vanguard Mid-cap Stock Mutual Funds and Inception Dates
vanguard_sector_etfs

Vanguard Sector & Specialty ETFs and Inception Dates
sortino

Sortino Ratio
vanguard_stock_funds

Vanguard Stock Mutual Funds and Inception Dates
vanguard_targetdate_funds

Vanguard Target Date Mutual Funds
contango_simple

Backtest a Simple Contango-Based Volatility Trading Strategy
gains_graph

Scatterplot of Investment Gains
convert_gain

Convert Gain from One Time Interval to Another
highyield_etfs

High-Yield ETFs from ETFdb.com and Inception Dates
gains_prices

Convert Gains to Prices
largest_etfs

Largest 100 Market Cap ETFs (as of 3/2/18) and Inception Dates
mdd

Maximum Drawdown
ratios

Ratios of Subsequent Elements in a Vector
rrr

Risk-Return Ratio
metrics

Calculate Various Performance Metrics
vanguard_funds

Vanguard Mutual Funds and Inception Dates
vanguard_igrade_etfs

Vanguard Investment-grade Bond ETFs and Inception Dates
stocks

Stock Market Analysis
targetall

Backtest a Fixed-Allocation Trading Strategy
vanguard_international_funds

Vanguard International Mutual Funds and Inception Dates
threefunds_graph

Graph One Performance Metric vs. Another for Three-Fund Portfolio as Allocation Varies
targetbeta_twofunds

Backtest a Two-Fund Strategy that Targets a Certain Beta
vanguard_balanced_funds

Vanguard Balanced Mutual Funds and Inception Dates
vanguard_largecap_etfs

Vanguard Large-cap Stock ETFs and Inception Dates
ticker_dates

Get Yahoo! Finance Start/End Dates for Tickers
vanguard_sector_funds

Vanguard Sector Mutual Funds and Inception Dates
vanguard_bond_etfs

Vanguard Bond ETFs and Inception Dates
vanguard_smallcap_funds

Vanguard Small-cap Stock Mutual Funds and Inception Dates
vanguard_igrade_funds

Vanguard Investment-grade Bond Mutual Funds and Inception Dates
vanguard_stock_etfs

Vanguard Stock ETFs and Inception Dates
vanguard_smallcap_etfs

Vanguard Small-cap Stock ETFs and Inception Dates
vanguard_international_etfs

Vanguard International ETFs and Inception Dates
vanguard_traditional_funds

Vanguard Traditional Mutual Funds and Inception Dates
vanguard_treasury_etfs

Vanguard Treasury/Agency Bond ETFs and Inception Dates
vanguard_treasury_funds

Vanguard Treasury/Agency Bond Mutual Funds and Inception Dates
diffs

Lagged Differences (Alternate Implementation)
daily_yearly

Convert Daily Gain to X-year Gain
twofunds_graph

Graph One Performance Metric vs. Another for Two-Fund Portfolios as Allocation Varies
twometrics_graph

Graph One Performance Metric vs. Another for Various Investments