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