Skip to content

portfolioBacktest

Automated Backtesting of Portfolios over Multiple Datasets

v0.4.1 · Apr 22, 2022 · GPL-3

Description

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.

Downloads

838

Last 30 days

4257th

2.7K

Last 90 days

11.3K

Last year

Trend: -10.5% (30d vs prior 30d)

CRAN Check Status

14 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Reverse Dependencies (1)

Dependency Network

Dependencies Reverse dependencies digest evaluate ggplot2 pbapply PerformanceAnalytics quadprog quantmod R.utils rlang xts zoo riskParityPortfolio portfolioBacktest

Version History

new 0.4.1 Mar 10, 2026
updated 0.4.1 ← 0.3.1 diff Apr 21, 2022
updated 0.3.1 ← 0.3.0 diff Oct 16, 2021
updated 0.3.0 ← 0.2.3 diff Sep 20, 2021
updated 0.2.3 ← 0.2.2 diff Jan 11, 2021
updated 0.2.2 ← 0.2.1 diff Aug 2, 2020
updated 0.2.1 ← 0.2.0 diff Oct 6, 2019
updated 0.2.0 ← 0.1.1 diff Aug 22, 2019
updated 0.1.1 ← 0.1.0 diff Jul 5, 2019
new 0.1.0 Jun 18, 2019