View source: R/genericStrategy.R
addIndicators | R Documentation |
Define variable via expr and name it via name. It will be recalculated each lookforward steps.
addIndicators(this, expr, name, lookback, args, lookforward, vars) addIndicator(this, expr, name, lookback, args, lookforward, vars) ## S3 method for class 'Strategy' addIndicators( this, expr, name, lookback = NULL, args = list(), lookforward = NULL, vars = NULL )
this |
model |
expr |
expression |
name |
character, name of signal |
lookback |
numeric / expression, how many periods is needed for calculation signal |
args |
list, parameters for a signal |
lookforward |
numeric / expression. If it is numeric then after that number of points all indicators will be recalculated. If it is expression then it should return logical. It will indicate recalculate indicators or not. |
vars |
character vector, which names are defined in expr. This field is necessary for definition of indicators dependencies. Update of one indicator trigger another indicators for update. |
If it needs multiple variables it can also be done via expr, but names should be pointed in vars.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.