Package: portfolioBacktest 0.4.1

portfolioBacktest: Automated Backtesting of Portfolios over Multiple Datasets

Automated backtesting of multiple portfolios over multiple datasets of stock prices in a rolling-window fashion. Intended for researchers and practitioners to backtest a set of different portfolios, as well as by a course instructor to assess the students in their portfolio design in a fully automated and convenient manner, with results conveniently formatted in tables and plots. Each portfolio design is easily defined as a function that takes as input a window of the stock prices and outputs the portfolio weights. Multiple portfolios can be easily specified as a list of functions or as files in a folder. Multiple datasets can be conveniently extracted randomly from different markets, different time periods, and different subsets of the stock universe. The results can be later assessed and ranked with tables based on a number of performance criteria (e.g., expected return, volatility, Sharpe ratio, drawdown, turnover rate, return on investment, computational time, etc.), as well as plotted in a number of ways with nice barplots and boxplots.

Authors:Daniel P. Palomar [cre, aut], Rui Zhou [aut]

portfolioBacktest_0.4.1.tar.gz
portfolioBacktest_0.4.1.zip(r-4.5)portfolioBacktest_0.4.1.zip(r-4.4)portfolioBacktest_0.4.1.zip(r-4.3)
portfolioBacktest_0.4.1.tgz(r-4.4-any)portfolioBacktest_0.4.1.tgz(r-4.3-any)
portfolioBacktest_0.4.1.tar.gz(r-4.5-noble)portfolioBacktest_0.4.1.tar.gz(r-4.4-noble)
portfolioBacktest_0.4.1.tgz(r-4.4-emscripten)portfolioBacktest_0.4.1.tgz(r-4.3-emscripten)
portfolioBacktest.pdf |portfolioBacktest.html
portfolioBacktest/json (API)
NEWS

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

Peer review:

Bug tracker:https://github.com/dppalomar/portfoliobacktest/issues

Datasets:
  • SP500_symbols - Stock symbols of the S&P 500 constituents
  • dataset10 - Ten datasets obtained by resampling the S&P 500

On CRAN:

backtestingfinancial-marketsportfolio

19 exports 59 stars 3.36 score 42 dependencies 65 scripts 1.2k downloads

Last updated 2 years agofrom:c5b82196c0. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 15 2024
R-4.5-winOKSep 15 2024
R-4.5-linuxOKSep 15 2024
R-4.4-winOKSep 15 2024
R-4.4-macOKSep 15 2024
R-4.3-winOKSep 15 2024
R-4.3-macOKSep 15 2024

Exports:add_performancebacktestBoxPlotbacktestChartCumReturnbacktestChartDrawdownbacktestChartSharpeRatiobacktestChartStackedBarbacktestLeaderboardbacktestSelectorbacktestSummarybacktestTablefinancialDataResamplegenRandomFunslistPortfoliosWithFailuresplotPerformanceVsParamsportfolioBackteststockDataDownloadstockDataResamplesummaryBarPlotsummaryTable

Dependencies:clicolorspacecurldigestevaluatefansifarverggplot2gluegtableisobandjsonlitelabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellnlmepbapplyPerformanceAnalyticspillarpkgconfigquadprogquantmodR.methodsS3R.ooR.utilsR6RColorBrewerrlangscalestibbleTTRutf8vctrsviridisLitewithrxtszoo

Portfolio Backtesting

Rendered fromPortfolioBacktest.html.asisusingR.rsp::asison Sep 15 2024.

Last update: 2019-06-17
Started: 2019-04-19

Readme and manuals

Help Manual

Help pageTopics
portfolioBacktest: Automated Backtesting of Portfolios over Multiple DatasetsportfolioBacktest-package
Add a new performance measure to backtestsadd_performance
Create boxplot from backtest resultsbacktestBoxPlot
Chart of the cumulative returns or wealth for a single backtestbacktestChartCumReturn
Chart of the drawdown for a single backtestbacktestChartDrawdown
Chart of the rolling Sharpe ratio over time for a single backtestbacktestChartSharpeRatio
Chart of the weight allocation over time for a portfolio over a single backtestbacktestChartStackedBar
Leaderboard of portfolios from the backtest resultsbacktestLeaderboard
Selector of portfolio backtest resultsbacktestSelector
Summary of portfolio backtestbacktestSummary
Table with portfolio backtest resultsbacktestTable
Ten datasets obtained by resampling the S&P 500dataset10
Generate random resamples from financial datafinancialDataResample
Generate multiple versions of a function with randomly chosen parametersgenRandomFuns
List portfolios with failureslistPortfoliosWithFailures
Plot performance of portfolio function vs choice of parametersplotPerformanceVsParams
Backtest multiple portfolios over multiple datasets of stock prices in a rolling-window basisportfolioBacktest
Stock symbols of the S&P 500 constituentsSP500_symbols
Download stock data from the InternetstockDataDownload
Generate random resamples from financial datastockDataResample
Create barplot from backtest summarysummaryBarPlot
Create table from backtest summarysummaryTable