DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26); DEA:=EMA(DIFF,9); A1:=BARSLAST(REF(CROSS(DIFF,DEA),1)); 底背離:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA); N:=5; DIFF底背:=REF(C,BARSLAST(REF(FILTER(BACKSET(REF(DIFF,N)=LLV(DIFF,2*N+1),N+1),N) AND DIFF=LLV(DIFF,N+1),1))+1)>C AND REF(DIFF,BARSLAST(REF(FILTER(BACKSET(REF(DIFF,N)=LLV(DIFF,2*N+1),N+1),N) AND DIFF=LLV(DIFF,N+1),1))+1) DIFF=LLV(DIFF,N+1),COLORWHITE; VAR1:=FILTER(BACKSET(REF(DIFF,N)=LLV(DIFF,2*N+1),N+1),N) AND DIFF=LLV(DIFF,N+1); VAR2:=BARSLAST(CROSS(DEA,DIFF)); VAR3:=REF(C,VAR2+1); VAR4:=BARSLAST(VAR1); VAR5:=IF(DIFF底背 AND VAR1,REF(REF((LLV(L,VAR2+1)/VAR3-1)*100,VAR4),1),IF(DIFF底背 AND VAR1=0,REF((LLV(L,VAR2+1)/VAR3-1)*100,VAR4),0)); VAA5:=IF(DIFF底背 AND VAR1,REF(VAR4+1,1),IF(DIFF底背 AND VAR1=0,VAR4+1,0));{DIFF兩點之間小于50天} VAR6:=BARSLAST(A1=0); VAR7:=IF(底背離 AND A1=0,REF(REF((LLV(L,VAR2+1)/VAR3-1)*100,VAR6),1),IF(底背離 AND A1!=0,REF((LLV(L,VAR2+1)/VAR3-1)*100,VAR6),0)); VAA7:=IF(底背離 AND A1=0,REF(VAR6+1,1),IF(底背離 AND A1!=0,VAR6+1,0));{底背離兩點之間小于50天} VAS6:=IF(DIFF底背 AND VAR1,REF(COUNT(H>MA(C,20),VAR4)>=1,1),IF(DIFF底背 AND VAR1=0,COUNT(H>MA(C,20),VAR4)>=1,0));{DIFF兩點之間最高價大于20日線} VAS7:=COUNT(H>MA(C,20),VAR6)>=1;{底背離兩點之間最高價大于20日線} VAR8:=DIFF底背 AND VAR5<=-9 and="">=-9><=50 and="">=50> VAR9:=底背離 AND VAR7<=-9 and="">=-9><=50 and="">=50> VAR8 OR VAR9 ; |
|