Re: [R] quantstrat questions

2012-07-24 Thread Sven Duve
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 th

Re: [R] quantstrat questions

2012-07-24 Thread R. Michael Weylandt
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 wrote: > Quantstrat useRs, > > I have a number of questions about how to use quantstrat that I have > accumulated since

[R] quantstrat questions

2012-07-24 Thread Bos, Roger
Quantstrat useRs, I have a number of questions about how to use quantstrat that I have accumulated since I have begun playing with it. First, can the orderqty be dynamic? All of the examples I have seen are based on placing an order for 100 shares when a rule is triggered. Is it possible to