[Returnanalytics-commits] r2409 - pkg/PortfolioAnalytics/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jun 23 20:37:25 CEST 2013


Author: rossbennett34
Date: 2013-06-23 20:37:24 +0200 (Sun, 23 Jun 2013)
New Revision: 2409

Modified:
   pkg/PortfolioAnalytics/R/constraints.R
Log:
added enabled as argument in constraint_v2 constructor in constraint functions

Modified: pkg/PortfolioAnalytics/R/constraints.R
===================================================================
--- pkg/PortfolioAnalytics/R/constraints.R	2013-06-23 18:18:37 UTC (rev 2408)
+++ pkg/PortfolioAnalytics/R/constraints.R	2013-06-23 18:37:24 UTC (rev 2409)
@@ -326,7 +326,7 @@
     max[which(tmp_max < max)] <- tmp_max[which(tmp_max < max)]
   }
   
-  Constraint <- constraint_v2(type=type, ...)
+  Constraint <- constraint_v2(type=type, enabled=enabled, ...)
   Constraint$min <- min
   Constraint$max <- max
   return(Constraint)
@@ -368,7 +368,7 @@
   }
   if (length(group_max) != ngroups) stop(paste("length of group_max must be equal to 1 or the length of groups:", ngroups))
   
-  Constraint <- constraint_v2(type, ...)
+  Constraint <- constraint_v2(type, enabled=enabled, ...)
   Constraint$groups <- groups
   Constraint$cLO <- group_min
   Constraint$cUP <- group_max
@@ -388,7 +388,7 @@
 #' @author Ross Bennett
 #' @export
 weight_sum_constraint <- function(type, min_sum=0.99, max_sum=1.01, enabled=FALSE, ...){
-  Constraint <- constraint_v2(type, ...)
+  Constraint <- constraint_v2(type, enabled=enabled, ...)
   Constraint$min_sum <- min_sum
   Constraint$max_sum <- max_sum
   return(Constraint)
@@ -483,7 +483,7 @@
 #' @author Ross Bennett
 #' @export
 turnover_constraint <- function(type, max.turnover, enabled=FALSE, ...){
-  Constraint <- constraint_v2(type, ...)
+  Constraint <- constraint_v2(type, enabled=enabled, ...)
   Constraint$toc <- max.turnover
   return(Constraint)
 }



More information about the Returnanalytics-commits mailing list