Skip to content
Prev 301132 / 398506 Next

quantstrat questions

You need to code a function which returns either a 1 for long and a 0 for flat based on any conditions like, so something like


MASig <- function(MA1, MA2, MA3){
k <- 0
if((MA1 > MA2) && (MA2 > MA3)){k <- 1}
return(k)
}

you then use this in your signalfunction in quantstrat.

dont nail me for the syntax, but something like this is what you looking for. i think...

But pls check with R-SIG finance again.



Am 24 Jul 2012 um 21:22 schrieb "R. Michael Weylandt" <michael.weylandt at gmail.com>: