cusum_filter: cusum_filter

Description Usage Arguments Value Examples

View source: R/filtering.R

Description

Advances in Financial Machine Learning, Snippet 2.4, page 39. The Symmetric Dynamic/Fixed CUSUM Filter.

Usage

1
cusum_filter(price, threshold, return_datetime = TRUE)

Arguments

price

vector of prices

threshold

scalar or numeric vector of same size as price. When the change is larger than the threshold, the function captures it as an even

return_datetime

Should the function return datetime object or index of cusum filter

Value

vector of cusum events or datetime of cusum events

Examples

1
2
data("spy")
cusum_events <- cusum_filter(subset(spy, select = c("index", "close")), 0.001)

MislavSag/mlfinance documentation built on Sept. 14, 2021, 1:11 p.m.