weight_transform: Weight Transform

Description

Returns transformed position weights for a given list of symbols. This metric is commonly used for creating position constraints during portfolio optimization.

Usage

1
weight_transform(portfolio,transformType=c('sum_abs_weight','equiweight'),symbols=NULL)

Arguments

portfolio

Portfolio object created using portfolio_create( ) function

transformType

Transform applied to position weights: "sum_abs_weights" - sum of absolute position weights, "equiweight" - equal position weights

symbols

List of symbols

Value

Metric object

Author(s)

Kostin Andrey <andrey.kostin@portfolioeffect.com>

See Also

portfolio_create

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
portfolio<-portfolio_create("SPY", "2014-11-19 09:30:00", "2014-11-19 16:00:00")
portfolio_settings(portfolio,portfolioMetricsMode="price",resultsSamplingInterval='1m')
position_AAPL=position_add(portfolio,"AAPL",1000)
position_GOOG=position_add(portfolio,"GOOG",1000)
position_SPY=position_add(portfolio,"SPY",1000)

optimizer=optimization_goal(variance(portfolio),direction="min")
optimizer=optimization_constraint(optimizer,value(portfolio),'=',10^9)
optimizer=optimization_constraint(optimizer,weight_transform(portfolio,
"sum_abs_weight",c(position_AAPL,position_GOOG)),">=",0.5)
plot(optimization_run(optimizer))

optimizer=optimization_goal(weight_transform(portfolio,"equiweight"))
plot(optimization_run(optimizer))

## End(Not run)

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.