[R-SIG-Finance] Quantstrat - Error while applying strategy

soren wilkening me at censix.com
Wed Jan 25 10:00:55 CET 2012


Hi

what the randPos() function does is apply the .randPos() function
"nrow(x)" times so the result is a vector of the same length as x. Of
that result, only the last value is used in the strategy, i think. All
the results are the same. so "i" is just a counter that the 'sapply'
function needs. It does not do anything else.

Looking at it agin now, I am thinking that this is a particularly ugly
way of doing this. maybe just use "rep" instead of "sapply".

see ?rep and ?sapply


-----
http://censix.com
--
View this message in context: http://r.789695.n4.nabble.com/Quantstrat-Error-while-applying-strategy-tp3472438p4326718.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list