Learn R Programming

PortfolioTesteR (version 0.1.4)

plot.backtest_result: Plot Backtest Results

Description

S3 plot method for visualizing backtest performance.

Usage

# S3 method for backtest_result
plot(x, type = "performance", ...)

Value

NULL (creates plot)

Arguments

x

backtest_result object

type

Plot type: "performance", "drawdown", "weights", or "all"

...

Additional plotting parameters

Examples

Run this code
data("sample_prices_weekly")
mom <- calc_momentum(sample_prices_weekly, lookback = 12)
sel <- filter_top_n(mom, n = 10)
W   <- weight_equally(sel)
res <- run_backtest(sample_prices_weekly, W)
if (interactive()) plot(res, type = "performance")

Run the code above in your browser using DataLab