Description Usage Arguments Details Functions Note
Functions are only used in defining indicator expr.
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")
)
|
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" |
In order to facilitate defining indicator expr, there are two kinds of expr functions:
expr_funs to define customized indicator:
calling function to generate a result series, like
Lag
, GrowthRate
, Ratio
,
Demean
, Quarter_TTM
, Beta
, etc.
expr_funs to define dynamic indicator:
RiskFreeRate
provides dynamic time series from database.
Lag
: lag a series at k period.
(k>0 lag behind, k<0 lag ahead)
GrowthRate
: compute growth rate of a series.
Ratio
: compute ratio of two series.
Demean
: substract mean from a series.
Quarter_TTM
: make a quarterly TTM(Trial Twelve Month)
series.
Beta
: compute beta between two variable series
RiskFreeRate
: provide timeseries of dynamic indicator of
riskfree rate.
In order to be different form normal R function, we use CamelCase style for functions name.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.