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
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
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
3 matches
Mail list logo