Test Investment Strategies with English-Like Code
Overview
Design, backtest, and analyze portfolio strategies using simple, English-like function chains. Includes technical indicators, flexible stock selection, portfolio construction methods (equal weighting, signal weighting, inverse volatility, hierarchical risk parity), and a compact backtesting engine for portfolio returns, drawdowns, and summary metrics.
New
ml_backtest_multi()— run ML backtests across multiple horizons/schedules.pt_collect_results()— one-call collector for coverage, IC (raw & OOS-only), turnover, perf tables, and cost sweeps.scores_oos_only()— keep scores only on OOS decision dates.
Improvements
- Vignettes stabilized on knitr/rmarkdown (no Quarto dependency during checks).
- Expanded
R/globals.Rto silence data.table NSE NOTES. - Regenerated docs with UTF-8 to avoid Non-ASCII warnings.
Compatibility
- No breaking API changes.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK12 OK2026-04-25
- ERROR11 OK, 3 ERROR2026-03-10
Documentation
- Help pages
- 137 (14 internal)includes a package overview page
- Examples that run
- 68%63 run in a plain check (1 of them under a condition) · 18 only when donttest examples are enabled (R CMD check --as-cran) · 10 never run · 1 hold no code
- Exported functions with examples
- 75%
- Documented parameters
- 97%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
Stars over time
Forks over time
Releases over time
PRs over time
Commits over time
3 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/albertopallotta/portfoliotester on 2026-10-25.
Dependencies
Installing PortfolioTesteR adds 5 packages (5 with compiled code, 7.8 MB of source tarballs). Heaviest: data.table 5.7 MB, curl 714 KB, zoo 675 KB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 0.1.4Latest2025-11-01 · current release · diff ↗ ·
added 3 exports
ml_backtest_multi, pt_collect_results, scores_oos_only - 0.1.32025-10-21 · diff ↗ ·
added 16 exports
analyze_by_period, analyze_vs_benchmark, calculate_daily_values, ml_add_interactions, ml_ic_series_on_scores, ml_make_ensemble, ml_make_model, ml_make_seq_model, ml_panel_op, ml_panel_reduce, ml_plot_ic_roll, ml_prepare_features, panel_returns_simple, perf_metrics, portfolio_returns, vol_target - 0.1.22025-09-30 · diff ↗ ·
added 31 exports
bucket_returns, calc_rolling_correlation, calc_stochrsi, cap_exposure, cap_turnover, carry_forward_weights, combine_scores, coverage_by_date, cv_tune_seq, demo_sector_map, evaluate_scores, ic_series, join_panels, make_labels, membership_stability, ml_backtest, ml_backtest_seq, panel_lag, rebalance_calendar, roll_fit_predict, roll_fit_predict_seq, roll_ic_stats, select_top_k_scores, select_top_k_scores_by_group, transform_scores, tune_ml_backtest, turnover_by_date, validate_group_map, validate_no_leakage, weight_from_scores and 1 more - 0.1.12025-09-22
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2025-09-22
- Total releases
- 4 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.5.0
- Bundled data
- 55 KB / 3 files
- Download size
- 401 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("PortfolioTesteR")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.