N:=30;
ZBDT:=(C-REF(C,1))/REF(C,1)<=-0.0985 && C==L;
KCDT:=(C-REF(C,1))/REF(C,1)<=-0.1980 && C==L;
FZBBK:=DATE>1200823 AND (IF(CODELIKE('300'),1,0) OR IF(CODELIKE('688'),1,0));
KPZBDT:=O=L && C>L;
KPKCDT:=O=L && C>L;
DT:=IF(FZBBK,KCDT,ZBDT);
KPDT:=IF(FZBBK,KPKCDT,KPZBDT);
KB:=COUNT(DT,4)=3 AND KPDT AND C>O;
买:=crOSS(C,HHV(REF(H,1),2));
卖:=CROSS(LLV(REF(L,1),2),C);
B2:=BArslAST(买);
S2:=BARSLAST(卖);
FBUY:=CROSS(S2,B2);
FSELL:=CROSS(B2,S2);
买入:=买 AND FBUY;
卖出:=卖 AND FSELL;
红色预警:KB,COLORRED,NODRAW;
STICKLINE(KB,0,1,2,0),COLORRED;
SD:=(REF((O+C)/2,BARSLAST(KB))-C)/REF((C+O)/2,BARSLAST(KB))*100>=N;
黄色预警:FILTER(SD ,1000),COLORYELLOW,NODRAW;
STICKLINE(黄色预警,0,1,2,0),COLORYELLOW;
买点:FILTER(买入,20) AND EXIST(SD,20),COLORGREEN,NODRAW;
STICKLINE(买点,0,1,2,0),COLORGREEN;