NUMBER:=5;
PL5:=IF(PERIOD>=7,ZIG(3,1),IF(PERIOD=3,ZIG(1,2),ZIG(1,2)));
{S说明:如果周月以上的选5%转向,如果日线选3%转向,如果日线以下周期选2%转向 }
PL10:=IF(PERIOD>=7,ZIG(3,30),IF(PERIOD=3,ZIG(1,10),ZIG(1,10)));
{S说明:如果周月以上的选10%转向,如果日线选5%转向,如果日线以下周期选4%转向 }
PL20:=IF(PERIOD>=7,ZIG(1,10),IF(PERIOD=3,ZIG(1,30),ZIG(1,20)));
{S说明:如果周月以上的选15%转向,如果日线选8%转向,如果日线以下周期选7%转向 }
EN1:=PL5> REF(PL5,1) AND REF(PL5,1)<=REF(PL5,2) AND REF(PL5,2)<=REF(PL5,3);
EX1:=PL5< REF(PL5,1) AND REF(PL5,1)>=REF(PL5,2) AND REF(PL5,2)>=REF(PL5,3);
EN2:=PL10> REF(PL10,1) AND REF(PL10,1)<=REF(PL10,2) AND REF(PL10,2)<=REF(PL10,3);
EX2:=PL10< REF(PL10,1) AND REF(PL10,1)>=REF(PL10,2) AND REF(PL10,2)>=REF(PL10,3);
EN3:=PL20> REF(PL20,1) AND REF(PL20,1)<=REF(PL20,2) AND REF(PL20,2)<=REF(PL20,3);
EX3:=PL20< REF(PL20,1) AND REF(PL20,1)>=REF(PL20,2) AND REF(PL20,2)>=REF(PL20,3);
走强1:=BARSLAST(PL5< REF(PL5,1));
走弱1:=BARSLAST(PL5> REF(PL5,1));
走强2:=BARSLAST(PL10< REF(PL10,1));
走弱2:=BARSLAST(PL10> REF(PL10,1));
走强3:=BARSLAST(PL20< REF(PL20,1));
走弱3:=BARSLAST(PL20> REF(PL20,1));
ZTJZ5:=IF(PL10> REF(PL10,1),COUNT(EN1,走强2),0);
ZTJD5:=IF(PL10> REF(PL10,1),COUNT(EX1,走强2),0);
DTJZ5:=IF(PL10< REF(PL10,1),COUNT(EN1,走弱2),0);
DTJD5:=IF(PL10< REF(PL10,1),COUNT(EX1,走弱2),0);
ZTJZ10:=IF(PL20> REF(PL20,1),COUNT(EN2,走强3),0);
ZTJD10:=IF(PL20> REF(PL20,1),COUNT(EX2,走强3),0);
DTJZ10:=IF(PL20< REF(PL20,1),COUNT(EN2,走弱3),0);
DTJD10:=IF(PL20< REF(PL20,1),COUNT(EX2,走弱3),0);
XG1:=EX2;
XG2:=PL20> REF(PL20,3);
XG3:=ZTJZ10=3;
VAR0:=(MA(C,7));
VAR1:=(FORCAST(VAR0,7));
VAR2:=(FORCAST(VAR0,14));
VAR3:=(FORCAST(VAR0,70));
VAR4:=(FORCAST(VAR3,28));
VAR5:=(FORCAST(VAR3,56));
VAR6:=(BARSCOUNT(C));
VAR7:=(MOD(VAR6,2));
VAR8:=((MA(C,42)) * 0.45);
VTX0:=BARSCOUNT(C)=1;
VTX1:=BARSLAST(VTX0);
VTX2:=MOD(VTX1+1,2);
VAR13:=(IF(VAR1 < VAR8,VAR8,VAR1));
VAR14:=(IF(VAR2 < VAR8,VAR8,VAR2));
VAR15:=(IF(VAR3 < VAR8,VAR8,VAR3));
VAR16:=(IF(VAR4 < VAR8,VAR8,VAR4));
VAR17:=(IF(VAR5 < VAR8,VAR8,VAR5));
VAR18:=IF(VTX2 = 1 AND VAR16> VAR17,VAR17,VAR16);
VAR19:=IF(VTX2 = 1 AND VAR15< VAR16 AND VAR15> VAR17,VAR15,VAR16);
VAR20:=IF(VTX2 = 1 AND VAR15< VAR17 AND VAR15> VAR16,VAR15,VAR16);
VAR21:=IF(VAR15< VAR16 AND VAR15> VAR17,VAR19,VAR18);
VAR22:=IF(VAR15< VAR17,VAR20,VAR18);
V4:=IF(VAR17> VAR16,VAR17,VAR21);
V5:=IF(VAR22 VAR16,VAR17,VAR21),VAR22,IF(VAR17> VAR16,VAR17,VAR21));
DINUM:=BARSLAST(EN2 AND ZTJZ5=1);
DINUM>NUMBER AND
COUNT(EX2 AND (PL10> REF(PL10,1) OR REF(PL10> REF(PL10,1),1) OR ZTJD10=1),DINUM)=0 AND
COUNT(C<=V4 AND C<=V5, DINUM)=DINUM;