Learn R Programming

RTL (version 1.0.0)

tradeStats: Risk-reward statistics for quant trading

Description

Compute list of risk reward metrics

Usage

tradeStats(x, Rf = 0)

Arguments

x

Univariate xts object of returns OR dataframe with date and return variables.

Rf

Risk-free rate

Value

List of risk/reward metrics.

Examples

Run this code
# NOT RUN {
library(PerformanceAnalytics)
x <- tidyquant::tq_get("SPY") %>% dplyr::mutate(ret = log(adjusted / dplyr::lag(adjusted)))
x <- x %>%
  stats::na.omit() %>%
  dplyr::select(date, ret)
tradeStats(x = x, Rf = 0)
# }

Run the code above in your browser using DataLab