Package: stocks 1.1.4

Dane R. Van Domelen

stocks: Stock Market Analysis

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.

Authors:Dane R. Van Domelen

stocks_1.1.4.tar.gz
stocks_1.1.4.zip(r-4.7)stocks_1.1.4.zip(r-4.6)stocks_1.1.4.zip(r-4.5)
stocks_1.1.4.tgz(r-4.6-x86_64)stocks_1.1.4.tgz(r-4.6-arm64)stocks_1.1.4.tgz(r-4.5-x86_64)stocks_1.1.4.tgz(r-4.5-arm64)
stocks_1.1.4.tar.gz(r-4.7-arm64)stocks_1.1.4.tar.gz(r-4.7-x86_64)stocks_1.1.4.tar.gz(r-4.6-arm64)stocks_1.1.4.tar.gz(r-4.6-x86_64)
stocks_1.1.4.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
stocks/json (API)

# Install 'stocks' in R:
install.packages('stocks', repos = c('https://cranhaven.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/cranhaven/cranhaven.r-universe.dev/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

Conda:

archivedpackagesr-universecpp

2.29 score 5 stars 39 scripts 234 downloads 30 exports 91 dependencies

Last updated from:40b14fecb5 (on package/stocks). Checks:13 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-arm64OK252
linux-devel-x86_64OK258
source / vignettesOK212
linux-release-arm64OK226
linux-release-x86_64OK256
macos-release-arm64OK170
macos-release-x86_64OK427
macos-oldrel-arm64OK180
macos-oldrel-x86_64OK313
windows-develOK180
windows-releaseOK174
windows-oldrelOK161
wasm-releaseOK140

Exports:beta_trailing50contango_hedgedcontango_simpleconvert_gaindaily_yearlydiffsgains_graphgains_pricesgains_rategrowth_graphload_gainsload_pricesmddmetricsonemetric_graphonemetric_overtime_graphpchangespdiffsprices_gainsprices_rateratiosrrrsharpesortinotargetalltargetbeta_twofundsthreefunds_graphticker_datestwofunds_graphtwometrics_graph

Dependencies:backportsbase64encbslibcachemcheckmatecliclustercolorspacecpp11cubaturecurldata.tableDBIdigestdplyrdvmiscevaluatefarverfastmapfontawesomeforeignFormulafsgenericsggplot2gluegridExtragtablehighrHmischtmlTablehtmltoolshtmlwidgetsisobandjquerylibjsonlitekableExtraknitrlabelinglatticelifecyclelubridatemagrittrMASSMatrixmemoisemimeminqamitoolsmvtnormnnetnumDerivpillarpkgconfigpracmaquantmodR6rappdirsrbenchmarkRColorBrewerRcppRcppArmadillorlangrmarkdownrpartrstudioapiS7sassscalesstringistringrsurveysurvivalsvglitesystemfontstabtextshapingtibbletidyselecttimechangetinytexTTRutf8vctrsviridisLitewithrxfunxml2xtsyamlzoo

Readme and manuals

Help Manual

Help pageTopics
Beta for Last 50 Daily Gainsbeta_trailing50
Backtest a Hedged Contango-Based Volatility Trading Strategycontango_hedged
Backtest a Simple Contango-Based Volatility Trading Strategycontango_simple
Convert Gain from One Time Interval to Anotherconvert_gain
Convert Daily Gain to X-year Gaindaily_yearly
Lagged Differences (Alternate Implementation)diffs
Scatterplot of Investment Gainsgains_graph
Convert Gains to Pricesgains_prices
Calculate Growth Rate From a Vector of Gainsgains_rate
Graph Investment Growthgrowth_graph
High-Yield ETFs from ETFdb.com and Inception Dateshighyield_etfs
Largest 100 Market Cap ETFs (as of 3/2/18) and Inception Dateslargest_etfs
Download and Align Gains for a Set of Tickersload_gains
Download and Align Historical Prices for a Set of Tickersload_prices
Maximum Drawdownmdd
Calculate Various Performance Metricsmetrics
Graph Performance Metric for Various Investmentsonemetric_graph
Graph Performance Metric Over Time for Various Investmentsonemetric_overtime_graph
Lagged Proportion Changespchanges
Lagged Proportion Differencespdiffs
Convert Prices to Gainsprices_gains
Calculate Growth Rate From a Vector of Pricesprices_rate
Ratios of Subsequent Elements in a Vectorratios
Risk-Return Ratiorrr
Sector SPDR ETFs and Inception Datessector_spdr_etfs
Sharpe Ratiosharpe
Sortino Ratiosortino
Stock Market Analysisstocks-package stocks
Backtest a Fixed-Allocation Trading Strategytargetall
Backtest a Two-Fund Strategy that Targets a Certain Betatargetbeta_twofunds
Graph One Performance Metric vs. Another for Three-Fund Portfolio as Allocation Variesthreefunds_graph
Get Yahoo! Finance Start/End Dates for Tickersticker_dates
Graph One Performance Metric vs. Another for Two-Fund Portfolios as Allocation Variestwofunds_graph
Graph One Performance Metric vs. Another for Various Investmentstwometrics_graph
Vanguard Balanced Mutual Funds and Inception Datesvanguard_balanced_funds
Vanguard Bond ETFs and Inception Datesvanguard_bond_etfs
Vanguard Bond Mutual Fundsvanguard_bond_funds
Vanguard ETFs and Inception Datesvanguard_etfs
Vanguard Mutual Funds and Inception Datesvanguard_funds
Vanguard Investment-grade Bond ETFs and Inception Datesvanguard_igrade_etfs
Vanguard Investment-grade Bond Mutual Funds and Inception Datesvanguard_igrade_funds
Vanguard International ETFs and Inception Datesvanguard_international_etfs
Vanguard International Mutual Funds and Inception Datesvanguard_international_funds
Vanguard Large-cap Stock ETFs and Inception Datesvanguard_largecap_etfs
Vanguard Large-cap Stock Mutual Funds and Inception Datesvanguard_largecap_funds
Vanguard Mid-cap Stock ETFs and Inception Datesvanguard_midcap_etfs
Vanguard Mid-cap Stock Mutual Funds and Inception Datesvanguard_midcap_funds
Vanguard Sector & Specialty ETFs and Inception Datesvanguard_sector_etfs
Vanguard Sector Mutual Funds and Inception Datesvanguard_sector_funds
Vanguard Small-cap Stock ETFs and Inception Datesvanguard_smallcap_etfs
Vanguard Small-cap Stock Mutual Funds and Inception Datesvanguard_smallcap_funds
Vanguard Stock ETFs and Inception Datesvanguard_stock_etfs
Vanguard Stock Mutual Funds and Inception Datesvanguard_stock_funds
Vanguard Target Date Mutual Fundsvanguard_targetdate_funds
Vanguard Target Risk Mutual Funds and Inception Datesvanguard_targetrisk_funds
Vanguard Tax-exempt Bond Mutual Funds and Inception Datesvanguard_taxexempt_bond_funds
Vanguard Traditional Mutual Funds and Inception Datesvanguard_traditional_funds
Vanguard Treasury/Agency Bond ETFs and Inception Datesvanguard_treasury_etfs
Vanguard Treasury/Agency Bond Mutual Funds and Inception Datesvanguard_treasury_funds