input:n1(14),n(3);LC := REF(CLOSE,1);1:(MAX(CLOSE-LC,0),N1,1)/SMA(A(CLOSE-LC),N1,1)*100;ty:=rsi1;A1:=REF(ty,N)=HHV(ty,2*N+1); B1:=FILTER(A1,N); C1:=BKSET(B1,N+1); D1:=FILTER(C1,N);{高}A2:=REF(ty,N)=LLV(ty,2*N+1); B2:=FILTER(A2,N); C2:=BACKSET(B2,N+1); D2:=FILTER(C2,N);{低}H1:=(D1 AND NOT(D2)) OR BARSTATUS=2 OR BARSCOUNT(C)=1;L1:=(D2 AND NOT(D1)); H2:=D1 AND NOT(D2);X1:=REF(BAAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,L,10000),X1));G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF