promptBeta: 'promptBeta'

Description Usage Arguments Value Author(s) Examples

View source: R/promptBeta.R

Description

Returns betas of futures contracts versus front futures contract.

Usage

1
promptBeta(x = x, period = "all", betatype = "all", output = "chart")

Arguments

x

Wide dataframe with date column and multiple series columns (multivariate).

period

"all" or numeric period of time in last n periods as character eg "100".

betatype

"all" "bull" "bear".

output

"betas" or "chart"

Value

betas data frame or plotly chart of betas

Author(s)

Philippe Cote

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
x <- dflong %>% dplyr::filter(grepl("CL",series))
x <- x %>% dplyr::mutate(series = readr::parse_number(series)) %>% dplyr::group_by(series)
x <- RTL::returns(df = x,retType = "abs",period.return = 1,spread = TRUE)
x <- RTL::rolladjust(x = x,commodityname = c("cmewti"),rolltype = c("Last.Trade"))
x <- x %>% dplyr::filter(!grepl("2020-04-20|2020-04-21",date))
promptBeta(x = x,period = "all",betatype = "all",output = "chart")
promptBeta(x = x,period = "all",betatype = "all",output = "betas")
promptBeta(x = x,period = "100",betatype = "all",output = "betas")

## End(Not run)

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