transaction_cost_constraint: constructor for transaction_cost_constraint

Description Usage Arguments Details Value Author(s) See Also Examples

Description

The transaction cost constraint specifies a proportional cost value. This function is called by add.constraint when type="transaction_cost" is specified, see add.constraint.

Usage

1
2
transaction_cost_constraint(type = "transaction_cost", assets, ptc,
  enabled = TRUE, message = FALSE, ...)

Arguments

type

character type of the constraint

assets

number of assets, or optionally a named vector of assets specifying initial weights

ptc

proportional transaction cost value

enabled

TRUE/FALSE

message

TRUE/FALSE. The default is message=FALSE. Display messages if TRUE.

...

any other passthru parameters to specify box and/or group constraints

Details

Note that with the ROI solvers, proportional transaction cost constraint is currently only supported for the global minimum variance and quadratic utility problems with ROI quadprog plugin.

Value

an object of class 'transaction_cost_constraint'

Author(s)

Ross Bennett

See Also

add.constraint

Examples

1
2
3
4
5
6
data(edhec)
ret <- edhec[, 1:4]

pspec <- portfolio.spec(assets=colnames(ret))

pspec <- add.constraint(portfolio=pspec, type="transaction_cost", ptc=0.01)

Example output

Loading required package: zoo

Attaching package:zooThe following objects are masked frompackage:base:

    as.Date, as.Date.numeric

Loading required package: xts
Loading required package: foreach
Loading required package: PerformanceAnalytics

Attaching package:PerformanceAnalyticsThe following object is masked frompackage:graphics:

    legend

PortfolioAnalytics documentation built on May 1, 2019, 10:56 p.m.