Man pages for PortfolioTesteR
Test Investment Strategies with English-Like Code

align_to_timeframeAlign Data to Strategy Timeframe
analyze_by_periodPeriod-level summary statistics
analyze_drawdownsAnalyze Drawdown Characteristics
analyze_performanceAnalyze Backtest Performance with Daily Monitoring
analyze_vs_benchmarkBenchmark-relative performance statistics
apply_regimeApply Market Regime Filter
apply_weighting_methodApply Weighting Method to Values
as_selectionConvert Conditions to Selection Format
backtest_metricsCalculate Comprehensive Backtest Metrics
bucket_returnsBucketed label analysis by score rank
calc_cciCalculate Commodity Channel Index (CCI)
calc_distanceCalculate Distance from Reference
calc_market_breadthCalculate Market Breadth Percentage
calc_momentumCalculate Price Momentum
calc_moving_averageCalculate Moving Average
calc_relative_strength_rankCalculate Cross-Sectional Ranking of Indicators
calc_rolling_correlationRolling correlation of each symbol to a benchmark
calc_rolling_volatilityCalculate Rolling Volatility
calc_rsiCalculate Relative Strength Index (RSI)
calc_sector_breadthCalculate Market Breadth by Sector
calc_sector_relative_indicatorsCalculate Indicators Relative to Sector Average
calc_stochastic_dCalculate Stochastic D Indicator
calc_stochrsiStochastic RSI (StochRSI) for multiple price series
calculate_annualized_returnCalculate Annualized Return
calculate_cluster_variance_optimizedOptimized cluster variance calculation
calculate_daily_valuesDaily equity curve from positions and daily prices
calculate_drawdownsCalculate Portfolio Drawdowns
calculate_drawdown_seriesCalculate Drawdown Time Series
calculate_enhanced_metricsCalculate Enhanced Performance Metrics
calculate_erc_weightsCalculate Equal Risk Contribution weights (simplified)
calculate_hrp_weightsCalculate HRP weights for a given returns matrix
calculate_max_div_weightsCalculate Maximum Diversification Portfolio weights
cap_exposureApply post-weight exposure caps
cap_turnoverCap turnover sequentially across dates
carry_forward_weightsCarry-forward weights between rebalances (validation helper)
combine_filtersCombine Multiple Filter Conditions
combine_scoresCombine multiple score panels (mean / weighted / rank-average...
combine_weightsCombine Multiple Weighting Schemes
convert_to_nweeksConvert Data to N-Week Frequency
coverage_by_dateCount finite entries per date
create_regime_bucketsConvert Continuous Indicator to Discrete Regimes
csv_adapterLoad Price Data from CSV File
cv_tune_seqPurged/embargoed K-fold CV for sequence models (inside IS...
demo_sector_mapDemo sector (group) map for examples/tests
dot-wf_make_splitsCreate Window Splits for Walk-Forward
download_sp500_sectorsDownload S&P 500 Sector Mappings from Wikipedia
ensure_dt_copyEnsure Data.Table Without Mutation
evaluate_scoresEvaluate scores vs labels (IC and hit-rate)
filter_aboveFilter Stocks Above Threshold
filter_belowFilter Stocks Below Threshold
filter_betweenFilter Stocks Between Two Values
filter_by_percentileFilter by Percentile
filter_rankSelect Top or Bottom N Stocks by Signal
filter_thresholdFilter by Threshold Value
filter_top_nSelect Top N Stocks by Signal Value
filter_top_n_whereSelect Top N from Qualified Stocks
get_data_frequencyDetect Data Frequency from Dates
ic_seriesInformation Coefficient time series
invert_signalInvert Signal Values for Preference Reversal
join_panelsJoin multiple panels on intersecting dates (unique symbol...
limit_positionsLimit per-date selections to top-K (legacy API)
list_examplesList available example scripts
load_mixed_symbolsLoad Mixed Symbols Including VIX
make_labelsMake future-return labels aligned to the decision date
manual_adapterAdapter for User-Provided Data
membership_stabilityMembership stability across dates
metric_sharpeCalculate Sharpe Ratio with Frequency Detection
ml_add_interactionsAdd interaction panels to a feature list
ml_backtestOne-call backtest wrapper (tabular features)
ml_backtest_multiRun multi-horizon ML backtests (pooled or sector-neutral)
ml_backtest_seqOne-call backtest wrapper (sequence features)
ml_ic_series_on_scoresRank-IC series computed on score (rebalance) dates
ml_make_ensembleNA-tolerant ensemble blender (row-wise)
ml_make_modelModel factory for tabular cross-sectional learners
ml_make_seq_modelDeterministic sequence model factory (GRU/LSTM/CNN1D with...
ml_panel_opPanel-safe binary operation on aligned wide panels
ml_panel_reduceReduce multiple panels with a binary operator
ml_plot_ic_rollRolling rank-IC plot (rebalance dates; leakage-safe)
ml_prepare_featuresPrepare tabular features (weekly + aligned daily volatility)
panel_lagLag each symbol column by k steps
panel_returns_simplePanel simple returns from prices
perf_metricsPortfolio performance metrics
plot.backtest_resultPlot Backtest Results
plot.param_grid_resultPlot Parameter Grid Results (1D/2D/3D and Facets)
plot.performance_analysisPlot Performance Analysis Results
plot.wf_optimization_resultPlot Walk-Forward Results
portfolio_returnsPortfolio returns from weights and prices (CASH-aware)
PortfolioTesteR-packagePortfolioTesteR: Test Investment Strategies with English-Like...
print.backtest_resultPrint Backtest Results
print.param_grid_resultPrint a param_grid_result
print.performance_analysisPrint Performance Analysis Results
print.wf_optimization_resultPrint a wf_optimization_result
pt_collect_resultsCollect diagnostics from two 'ml_backtest_multi()' runs
rank_within_sectorRank Indicators Within Each Sector
rebalance_calendarRebalance calendar (rows with non-zero allocation)
recursive_bisection_optimizedOptimized recursive bisection for HRP
roll_fit_predictRolling fit/predict for tabular features (pooled / per-symbol...
roll_fit_predict_seqRolling fit/predict for sequence models (flattened steps-by-p...
roll_ic_statsRolling IC mean, standard deviation, and ICIR
run_backtestRun Portfolio Backtest
run_exampleRun an Example Script
run_param_gridRun Parameter Grid Optimization (safe + ergonomic)
run_walk_forwardWalk-Forward Optimization Analysis
safe_anySafe ANY Operation with NA Handling
safe_divideSafe Division with NA and Zero Handling
sample_prices_dailySample Daily Stock Prices
sample_prices_weeklySample Weekly Stock Prices
sample_sp500_sectorsS&P 500 Sector Mappings
scores_oos_onlyMask score tables to out-of-sample decision dates
select_top_k_scoresSelect top-K scores per date
select_top_k_scores_by_groupSelect top-k symbols per group by score
sql_adapterLoad Price Data from SQL Database
sql_adapter_adjustedLoad Adjusted Price Data from SQL Database
standardize_data_formatStandardize Data to Library Format
summary.backtest_resultSummary method for backtest results
switch_weightsSwitch Between Weighting Schemes
transform_scoresPer-date score transform (z-score or rank)
tune_ml_backtestQuick grid tuning for tabular pipeline
turnover_by_dateTurnover by date
update_vix_in_dbUpdate VIX data in database
validate_data_formatValidate Data Format for Library Functions
validate_group_mapValidate a symbol-to-group mapping
validate_no_leakageQuick leakage guard: date alignment & NA expectations
validate_performance_inputsValidate Performance Analysis Inputs
vol_targetVolatility targeting (row-wise) with optional down-only cap
weight_by_hrpHierarchical Risk Parity Weighting
weight_by_rankRank-Based Portfolio Weighting
weight_by_regimeRegime-Based Adaptive Weighting
weight_by_risk_parityRisk Parity Weighting Suite
weight_by_signalSignal-Based Portfolio Weighting
weight_by_volatilityVolatility-Based Portfolio Weighting
weight_equallyEqual Weight Portfolio Construction
weight_from_scoresMap scores to portfolio weights
wf_reportGenerate Walk-Forward Report
wf_stitchStitch Out-of-Sample Results (overlap-safe)
wf_sweep_tabularWalk-forward sweep of tabular configs (window-wise...
yahoo_adapterDownload Price Data from Yahoo Finance
PortfolioTesteR documentation built on Nov. 5, 2025, 5:23 p.m.