addIndicators: Add multiple indicators to strategy

View source: R/genericStrategy.R

addIndicatorsR Documentation

Add multiple indicators to strategy

Description

Define variable via expr and name it via name. It will be recalculated each lookforward steps.

Usage

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
)

Arguments

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.

Details

If it needs multiple variables it can also be done via expr, but names should be pointed in vars.


Vitalic57/stratbuilder3gen documentation built on March 30, 2022, 6:58 a.m.