Hi Mike, That's exactly what I was looking for:) Works perfectly.
Thanks. Angus --- In [email protected], "Mike" <sfclimb...@...> wrote: > > Hi, > > I suspect that what you are looking for is to use the array S1 when > SetupIdentifier is 1, S2 when SetupIdentifier is 2, etc. > > If so, you can use dynamic variables instead of nested IIF. > > e.g. > SetupIdentifier = Optimize("Setup",1,1,4,1); > Setuptype = VarGet("S" + SetupIdentifier); > > Buy = Newday AND Setuptype; > > Mike > > --- In [email protected], "gucytribe" <angus@> wrote: > > > > Hi, > > > > I want to isolate specific price conditions and then use the optimizer to > > generate the results in order to automate data mining somewhat. > > > > E.g.: > > > > Newday = DateNum() != Ref(DateNum(),-1); > > S1 = Ref(O,-1) > Ref(C,-1); > > S2 = Ref(C,-1) > Ref(C,-2); > > S3 = Ref(O,-1) > Ref(O,-2); > > S4 = Ref(H,-1) > Ref(H,-2); > > > > Setuptype = IIf(S1,1,IIf(S2,2,IIf(S3,3,IIf(S4,4,0)))); > > SetupIdentifier = Optimize("Setup",1,1,4,1); > > > > Buy = Newday AND Setuptype == SetupIdentifier; > > Sell = Close; > > > > This works fine as long as S1, S2, S3 or S4 never occur at the same time > > (which in the above case they do). When they occur at the same time the Iif > > statement exits on the first occurrence resulting in a lot of occurrences > > of S2, S3, etc. not being included in the backtest. > > > > Can anyone suggest another way to do this? > > > > Many thanks. > > > > Angus > > >
