RuleClass: Rule constructor

RuleR Documentation

Rule constructor

Description

This class serves for describing moments when model should open position or exit from it.

Usage

Rule(
  type = "enter",
  block,
  pathwise = FALSE,
  position = NULL,
  position_const = NULL,
  price = NULL,
  on_success = NULL,
  reopen = FALSE,
  ...
)

Arguments

type

character, 'exit' or 'enter'

block

character, it is needed for combining bunch of rules in one namespace. For example rule with type exit will be triggered only if it has the same block variable as entry rule.

pathwise

logical, whether expr will be calculated on each iteration or not. In other words if pathwise is FALSE then expr will be calculated once with indicators, it should return logical vector, then in each iteration element of this vector will be used, if pathwise is TRUE then expr will be calculated at each iteration, it should return logical scalar.

position

numeric vector, what position for each instrument should be at each iteration when model in position

position_const

numeric vector, what position for each instrument should be at entry to position

price

numeric vector, what prices should be used for change position

reopen

logical, whether rule can be reopened on the same bar

...

args passed to Signal


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