sum_data: Summarize data for the overall portfolio

View source: R/sum_data.R

sum_dataR Documentation

Summarize data for the overall portfolio

Description

This function takes in a data set and returns the summary for each day's net market value, profit and loss, contract number and return rate.

Usage

sum_data(x, sector.selected = NULL, capital.num = NULL)

Arguments

x

A data frame that contains data for individual commodities.

sector.selected

The sector that the function is doing summarization for. When "sector.selected = NULL", the function performs summarization across the whole data set.

capital.num

The constant number of allocated capital to calculate return, number. Default value is NULL. When "capital.num = NULL", the function uses gross market value to calculate return rates for each row.

Value

A data frame that summarizes the market values and returns across all commodities.


knightsay/backtestGraphics documentation built on Jan. 27, 2025, 10:35 a.m.