create_indicator_def_fun: Create definition function of indicator for computing...

Description Usage Arguments Value See Also

View source: R/indicator-define.R

Description

Use indicator params to create a definition function for computing indicator. The definition function is used by create_indicator to compute indicator timeseries of stocks.

Usage

1
2
3
4
5
6
7
create_indicator_def_fun(
  indicator_code,
  indicator_expr,
  rolly_window = 0,
  period = c("day", "month", "quarter", "year"),
  fillna_method = c("ffill", "bfill", "nfill")
)

Arguments

indicator_code

A character for indicator code.

indicator_expr

A expr as a formula to compute indicator.

rolly_window

A numeric as rolly computing window, default 0 means no rolling.

period

A periodicity of indicator, e.g. "day", "month", "quarter", "year".

fillna_method

A method to fill NA , e.g. "ffill", "bfill", "nfill". Default "ffill" means to use value before NAs to fill NAs; "bfill" means to use data behind NAs to fill NAs; "nfill" means to don't fill NAs.

Value

A function of indicator definition to compute indicator if succeed, otherwise NULL.

See Also

Other indicator define functions: create_attribute_def_fun(), get_indicator_defs(), get_indicator_vars(), ind_attr_def_indcd(), ind_attr_def_trdstat(), parse_indicator_vars(), prioritize_indicator_defs(), related_indicator_defs()


chriszheng2016/zstmodelr documentation built on June 13, 2021, 8:59 p.m.