perfstats: Compute performance statistics on equity curves

Description Usage Arguments Value

Description

Returns a dataframe containing performance stats on one or multiple equity curves. May also plot it on the graphic device.

Usage

1
2
3
4
perfstats(data, on = "days", plotout = TRUE, value = TRUE,
  percent = TRUE, digits = 2, top = 2,
  main = "Performance Summary", scaling = "auto",
  title_size = "auto", ulcerthresh = 0, drawdown_dates = FALSE, ...)

Arguments

data

An xts matrix of equity curves, each column being one equity curve.

on

The periodicity (scale) of the xts data matrix to compute the stats. "days", "weeks", "months", "quarters" and "years" are valid and correspond to the following scales for table.AnnualizedReturns respectively: 252, 52.18, 12, 4 or 1.

plotout

Logical. Indicates whether to plot the result on the graphic console. using function plot_df. Default is TRUE.

value

Logical (default TRUE) to indicate whether a dataframe is returned

percent

Logical to indicate whether to multiple by 100 to get percentages (default TRUE).

digits

Number of digits to show on the screen / file and returned dataframe.

top

The number of drawdowns to calculate, starting from the maximum drawdown.

main

The title of the table to plot on the graphic console. Default is "Performance Summary".

scaling

Table scaling factor to plot on the graphic console. Default is "auto", which automatically calculates a reasonable value based on the number of columns in the xts data matrix.

title_size

Title scaling factor passed on to plot_df. Default is "auto", which calculates a reasonable value based on the number of coumns in the xts data matrix.

ulcerthresh

The drawdown minimum threshold used in the Ulcer Performance Index calculation for each period's return to be considered in the calculation. In other words, drawdowns smaller than this number do not count. Default is zero and it may be expressed as either a positive or negative number.

drawdown_dates

Logical. IF TRUE, return a list containing two dataframes. The first is a dataframe of all performance statistics, and the second is a dataframe of drawdown dates (Start, End, Trough) Default is FALSE, which means only the dataframe of performance statistics is returned.

...

Additional arguments passed on to plot_df. For example, the title text and size, and footnote size may be modified using this.

Value

Either a list of two dataframes (drawdown_dates is TRUE) or a single dataframe (drawdown_dates is FALSE) that shows the summary performance of the equity curves. The annualized return, the maximum drawdown and, by default the second and third drawdowns, the annualized standard deviation, the annualized Sharpe ratio (rf = 0 the MAR ratio, the ulcer index and the percentage of positive rolling years. See parameter drawdown_dates for the specification of the list.


jeanmarcgp/xtsanalytics documentation built on May 19, 2019, 12:38 a.m.