The general idea is to select Dayang Line and Yin Da Line first, and judge whether there is consolidation between Dayang Line and Yin Da Line, and require consolidation for more than 18 days and less than 50 days.
YXA:= C & gt; O & amp& amp high/low> 1.07;
YXB:= CL & gt; 1.07;
AY:= bars last(YXA);
BY:= bars last(YXB);
PZ:=HHV(H,BY)/LLV(L,BY);
XG:IF(AY = 0 & amp; & by> 10. & by & lt50 & amp& ampREF(PZ,1)1.13,1,0);