Skip to content

quantstrat questions

3 messages · Bos, Roger, R. Michael Weylandt, Sven Duve

#
Quantstrat is under active development so you should probably ask on
the R-SIG-Finance list where the developers hang out.

Michael
On Tue, Jul 24, 2012 at 3:17 PM, Bos, Roger <roger.bos at rothschild.com> wrote:
#
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>: