The data of the Performance tab: the chart of
plot_performance() and its CSV file. The indices without a currency, the
VIX, are left out, as it measures the fear in the market rather than the
value of shares, and so are the indices without the change, such as those
younger than the period.
Arguments
- summary
The result of
index_summary().- indices
Data frame of indices from
get_indices().- period
"day","week","month","month3","month6","month9"(3, 6 and 9 months),"ytd"(year to date) or"year".
Value
A data frame with a row per index, the best first: label,
region, currency, date and close of the last day, and
change_pct, the change over the period in percent.
Examples
summary <- data.frame(
label = c("S&P 500", "DAX", "VIX"), date = as.Date("2026-11-06"), close = c(6700, 23500, 19),
day_pct = c(0.4, -0.8, 5), week_pct = 1, month_pct = 2, month3_pct = 4, month6_pct = 8,
month9_pct = 12, ytd_pct = c(14, 18, -10), year_pct = 15
)
golemstockindices:::performance_data(summary, get_indices(), "day")
#> label region currency date close change_pct
#> 1 S&P 500 US USD 2026-11-06 6700 0.4
#> 2 DAX Europe EUR 2026-11-06 23500 -0.8