[R-SIG-Finance] quantstrat & custom indicators

algotr8der algotr8der at gmail.com
Wed May 4 01:36:11 CEST 2011

So I re-wrote the code to accommodate 2 portfolio objects, 2 strategy objects
and rules that utilize position limits. Unfortunately, I cant seem to get it
working. I've used debug() to walk through applyRules (and other functions)
and for some reason it doesnt seem to be checking for position limits (or at
least not that I can determine).

I have attached a copy of my code. It is fairly clean to read. If anyone
wants to take a stab at running it I would be grateful. 


> out<-try(applyStrategy(strategy=longBasket, portfolios=portfolio1.st))
[1] "2007-08-10 IBM 10000 @ 112.64"
Error in orderqty == 0 : 
  comparison (1) is possible only for atomic and list types
In addition: Warning messages:
1: In match.names(columns, colnames(data)) :
  all columns not located in Close ma10 for IBM.Open IBM.High IBM.Low
IBM.Close IBM.Volume IBM.Adjusted ma10 close.gt.ma10
2: In max(i) : no non-missing arguments to max; returning -Inf

View this message in context: http://r.789695.n4.nabble.com/quantstrat-custom-indicators-tp3491259p3493901.html
Sent from the Rmetrics mailing list archive at Nabble.com.

More information about the R-SIG-Finance mailing list