tradeStats: 'tradeStats'

Description Usage Arguments Value Author(s) Examples

View source: R/tradeStats.R

Description

Compute list of risk reward metrics

Usage

1
tradeStats(x, Rf = 0)

Arguments

x

Univariate xts object of returns or dataframe with date and return variable.

Rf

Risk-free rate

Value

List of risk/reward metrics.

Author(s)

Philippe Cote

Examples

1
2
3
4
5
library(tidyverse)
library(tidyquant)
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)

RTL documentation built on June 12, 2021, 5:06 p.m.