Here is someting closer to Linda's requirements:
momentum had to have happened before adx cross over 30
adx has to be above 25
close trend has to be increasing
close has to be above 10 day low and below 25 day high
low has to have dipped below 20 EMA after momentum and adx signal:
p1 := Mov(C,3,S)-Mov(C,10,S);
p2 := ADX(14);
p3 := Mov(C,20,E);
p4 := C-Ref(C,-3);
a1:= BarsSince(Cross(p1,0)=1);
a2:= BarsSince(Cross(p2,30)=1);
a3:= BarsSince(Cross(L,p3)=1);
a4:= If((C>LLV(C,10)) AND (C<HHV(C,25)) AND
(TroughBars(1,C,5)<PeakBars(1,C,5)),1,0);
b1:= If((a1<24),1,0)*
If((a2>a1),1,0)*
If((a3<a2),1,0)*
If((p4>0),1,0)*
If((p2>25),1,0)*a4;
e1:= If((b1=1) AND (Ref(b1,-1)=0),1,0);
e2:= Cross(C,ValueWhen(1,e1=1,C)*1.05);
e2
============================
To test I used a exploration like below to see what happens 6 days after the signal:
Col A: Close CLOSE
Col B: backbb Fml("holy_grail_xx_00")
Col C: R1 (C-Ref(C,-1))*
Ref(Fml("holy_grail_xx_00"),-1)
Col D: R2 (C-Ref(C,-2))*
Ref(Fml("holy_grail_xx_00"),-2)
Col E: R4 (C-Ref(C,-4))*
Ref(Fml("holy_grail_xx_00"),-4)
+
(C-Ref(C,-3))*
Ref(Fml("holy_grail_xx_00"),-3)
Col F: R6 (C-Ref(C,-6))*
Ref(Fml("holy_grail_xx_00"),-6)
+
(C-Ref(C,-5))*
Ref(Fml("holy_grail_xx_00"),-5)
Filter When(HHV(Fml("holy_grail_xx_00"),6)=1)
Filter enabled Yes
Periodicity Daily
Records required 750