Skip to content

portfolioBacktest

0.4.2

Automated Backtesting of Portfolios over Multiple Datasets

1packages depend
10.8Kdownloads / year
51.1%test coverage
13/13checks pass

Overview

About
Maintained by Daniel P. PalomarFirst published 2019-06-1910 releasesCRAN page ↗GitHub ↗

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. See Chapter 8 (Portfolio Backtesting) of the book: Daniel P. Palomar, "Portfolio Optimization: Theory and Application", Cambridge University Press, 2025.

Install

Health

CRAN checks
13OK
Slowest check: 4.7 min · r-oldrel-windows-x86_64
Code health
Yes
Tests · ratio 0.20
51.1%
Coverage · measured lines
100%
Documentation · exports
14
Dependencies · direct
Check history
  • OK2026-08-05
    13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • NOTE2026-08-01
    12 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • OK2026-06-08
    13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • WARNING2026-06-07
    12 OK · 0 NOTE · 1 WARNING · 0 ERROR · 0 FAILURE
  • OK2026-05-24
    13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
Show 2 earlier snapshots
  • ERROR2026-04-12
    13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE
  • OK2026-03-10
    14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE

Documentation

Documentation
READMEYes · 317 wordsVignettesNopkgdown siteNoNEWSYes · 100% structuredCode of conductNoContributing guideNo
Examples that run
6%
Documented parameters
98%
Return-value docs
42%
References docs
0%

Downloads

10.8K
CRAN downloads in the past year
Rank #4,301 · ~30/day · ~903/mo
Daily download trend is not available in this view yet.
30030 days
1.9K90 days
10.8K1 year
Compare downloads with other packages →
Also on161 r2u15 autocran

Repository

Repository
74Stars
16Forks
4Open issues
1Open PRs
9Releases
479Commits
4Contributors
portfoliobacktestingfinancial-markets
License GPL-3.0 · 479 commits · Last activity 2026-05-18 · +1.4% stars, 30d

Stars over time

2025-08-14 · 642026-07-30 · 74

Repository practices

Upstream repositoryBeta

5 development-tooling and community-health practices detected across 5 families in the upstream repository

Checks run against github.com/dppalomar/portfoliobacktest on 2026-08-09.

Continuous integration (1)
GitHub Actions
Reproducibility and dev environment (1)
data-raw/
CRAN release process (1)
cran-comments.md
Docs source (1)
README.Rmd
Show all practices
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v1 (2026-07-18)

Dependencies

Declared dependencies
23 external dependencies (excludes base and recommended)
Depends (1)
R >= 2.10
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
1direct
0indirect

Code & Tests

Datasets

People & History

People (2)
Maintainer (1)
Maintainer, Author
Authors (2)
Maintainer, Author
Author
Listed in earlier versions (1)
no longer listed · 0.1.0 to 0.4.2
Package Timeline

10 releases. Pick two to compare their code metrics. R releases are shown for context.

  • 0.4.2Latest
    2026-05-19 · current release · diff ↗
  • unarchivedReturned to CRAN
    2026-05-18
  • archivedRemoved from CRAN
    2026-05-18
    issues were not corrected despite reminders
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • 0.4.1
    2022-04-22 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • 0.3.1
    2021-10-17 · diff ↗
  • 0.3.0
    2021-09-21 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • 0.2.3
    2021-01-12 · diff ↗
  • 0.2.2
    2020-08-03 · diff ↗
  • unarchivedReturned to CRAN
    2020-08-03
  • archivedRemoved from CRAN
    2020-08-03
    check problems were not corrected in time
Show 6 earlier events
  • R
    R 4.0.0 released · 2020-04-24
  • 0.2.1
    2019-10-07 · diff ↗
  • 0.2.0
    2019-08-23 · diff ↗
  • 0.1.1
    2019-07-06 · diff ↗
  • 0.1.0
    2019-06-19
  • R
    R 3.6.0 released · 2019-04-26

Package metadata

First published
2019-06-19
Total releases
10 / 7 yrs
License
GPL-3 OSI
Minimum R
≥ 2.10
Bundled data
745 KB / 2 files
Download size
1.6 MB for 0.4.1
Installed size
not tracked yet
With dependencies
not tracked yet

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("portfolioBacktest")
Palomar, D. P., & Zhou, R. (2026). portfolioBacktest: Automated Backtesting of Portfolios over Multiple Datasets (Version 0.4.2) [Computer software]. https://doi.org/10.32614/CRAN.package.portfolioBacktest

This is what citation() produces when a package has no citation file of its own. If it prints something else, use that.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for portfolioBacktest version 0.4.2 [Data set]. HJJB, LLC. Data release v2026-08-15. https://doi.org/10.5281/zenodo.21843040

From data release v2026-08-15, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy