match_constraints: Limit constraints to respect reservations

Description Usage Arguments Value Examples

View source: R/match_constraints.R

Description

This function allows to adapt constraints not only for a single index but for a range of indexes and a range of values.

Usage

1
match_constraints(constraints, fixed_schedule, untradeable = NULL)

Arguments

constraints

A data.frame with constraints.

fixed_schedule

A numeric vector describing which amounts should be applied to schedule. It is implicitly assumed that these values do not exceed the limits of the constraints.

untradeable

A numeric vector of indexes in which no trades can occur, so constraints are adapted accordingly.

Value

A data.frame of adapted, more limited constraints

Examples

1
2
3
4
some_constraints <- build_constraints(5, 2, 6, 1, 3)
already_scheduled <- c(0, 2, 2, 1, 0)
untradeable <- c(3, 4)
match_constraints(some_constraints, already_scheduled, untradeable)

henobe/flexoptr documentation built on March 11, 2021, 6:04 p.m.