fg_RegimeChange: Event_Helpers

View source: R/event_helpers.R

fg_RegimeChangeR Documentation

Event_Helpers

Description

Wrapper around the function RegimeChange::detect_regimes() to create events for fgts_dygraph()

Usage

fg_RegimeChange(indta, usereturns = TRUE, series = NULL, ...)

Arguments

indta

Time series data.table with a date as the first column and a value series as the second column.

usereturns

(default TRUE) LOgical to take log returns before changepoint calculations.

series

Which series in indta to apply changepoints to

...

Parameters passed to RegimeChange::detect_regimes()

Details

Event Helpers : fg_RegimeChange https://cran.r-project.org/web/packages/RegimeChange/vignettes/introduction.html

Value

data.table suitable for passing into fgts_dygraph() via the event_ds parameter

Examples

if (requireNamespace("RegimeChange", quietly = TRUE)) {
dta <- tail(eqtypx[,.(date,QQQ,TLT)],260)
eventdt = fg_RegimeChange(dta,bootstrap_reps=50)
fgts_dygraph(dta,event_ds=eventdt,title="With Breakouts")
}

FinanceGraphs documentation built on June 22, 2026, 5:08 p.m.