Description Usage Arguments Details Value Examples
step_zigzag
creates a specification of a recipe
step that will extract ZigZag features from an asset price
historical data.
1 2 3 4 5 6 7 | step_zigzag(recipe, ..., change = 1, percent = TRUE, retrace = FALSE,
state = FALSE, span = c(0, 0), prefix = "zigzag", h = NULL,
l = NULL, c = NULL, type = NULL, role = "predictor",
trained = FALSE, skip = FALSE, id = rand_id("zigzag"))
## S3 method for class 'step_zigzag'
tidy(x, info = "terms", ...)
|
recipe |
A recipe object. The step will be added to the sequence of operations for this recipe. |
... |
Either three or one (unquoted) column name(s). If three columns
are given, it will represent the |
change |
A |
percent |
A |
retrace |
A |
state |
An option to specify whether to return
the current states of the ZigZag. Defaults to |
span |
A |
prefix |
A |
h |
A container for the names of |
l |
A container for the names of |
c |
A container for the names of |
type |
A container for the final series type that
would be used ( |
role |
For model terms created by this step, what analysis
role should they be assigned? By default, the function assumes
that the created columns will be used
as |
trained |
A logical to indicate if the necessary informations for preprocessing have been estimated. |
skip |
A logical. Should the step be skipped when the
recipe is baked by bake()? While all operations are baked
when prep() is run, some operations may not
be able to be conducted on new data (e.g. processing
the outcome variable(s)). Care should be taken when using |
id |
A character string that is unique to this step to identify it. |
x |
A |
info |
Options for |
The output from this step are several new columns which contains the extracted moving average features.
For basic output, this step will produces:
value
: the estimated ZigZag value
If state
argument is TRUE
, it will also produces:
trend
: current trend
swing
: swing points; either "up"
, "down"
, or "hold"
Note that the "up"
and "down"
are positioned at the time before
the trend
change; you can control its wide and position using
span
arguments.
An updated version of recipe
with the new step
added to the sequence of existing steps (if any).
1 2 3 4 5 6 7 8 9 10 11 | # import libs
library(quantrecipes)
# basic usage
rec <- recipe(. ~ ., data = btcusdt) %>%
step_zigzag(close) %>%
step_naomit(all_predictors()) %>%
prep()
# get preprocessed data
juice(rec)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.