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.
sum_data(x, sector.selected = NULL, capital.num = NULL)
A data frame that summarizes the market values and returns across all commodities.
A data frame that contains data for individual commodities.
The sector that the function is doing summarization for. When "sector.selected = NULL", the function performs summarization across the whole data set.
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.