indicator_expr_funs: Utils functions to facilitate defining indicator expr

Description Usage Arguments Details Functions Note

Description

Functions are only used in defining indicator expr.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
Lag(x, k = 1)

GrowthRate(x)

Ratio(x_numerator, y_denominator)

Demean(x)

Quarter_TTM(date, x, accumulated = TRUE)

Beta(y_dependent, x_independent)

RiskFreeRate(
  stock_db,
  indicator_code,
  period = c("day", "month", "quarter", "year")
)

Arguments

x

A numeric vector or array to compute.

k

A numeric to indicate lag direction, k>0 lag behind, k<0 lag ahead.

x_numerator

A numeric as numerator of ratio.

y_denominator

A non-zero numeric as denominator of ratio.

date

A date vector or array.

accumulated

A logic about whether specified data series is accumulated or not. Default is TRUE.

y_dependent

A dependent variable.

x_independent

A independent variable.

stock_db

A stock database object to operate.

indicator_code

A character code of indicator.

period

A character period of rate, e.g. "day", "month", "quarter", "year". Default is "day"

Details

In order to facilitate defining indicator expr, there are two kinds of expr functions:

Functions

Note

In order to be different form normal R function, we use CamelCase style for functions name.


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