cyc13:=0.01*EMA(AMOUNT,13)/EMA(V,13);
CYS:(C-CYC13)/CYC13*100,COLORWHITE,LINETHICK2;
绝对风险区:10,COLORRED,DOTLINE,LINETHICK1;
风险区:5,COLORMAGENTA,DOTLINE,LINETHICK1;
中线值:0,COLORYELLOW,DOTLINE,LINETHICK2;
买入区:-5,COLORLIBLUE,DOTLINE,LINETHICK1;
安全区:-10,COLORGREEN,DOTLINE;
NOTEXT:IF(cys>=0,CYS,DRAWNULL),COLORRED,LINETHICK2;
NOTEXT2:IF(CYS>=10,CYS,DRAWNULL),COLORYELLOW,LINETHICK2;
{
N:=5;
底背离:=REF(C,BArslAST(REF(FILTER(BacKSET(REF(CYS,N)=LLV(CYS,2*N+1),N+1),N) AND CYS=LLV(CYS,N+1),1))+1)>C AND REF(CYS,BARSLAST(REF(FILTER(BACKSET(REF(CYS,N)=LLV(CYS,2*N+1),N+1),N) AND CYS=LLV(CYS,N+1),1))+1)<CYS AND FILTER(BACKSET(REF(CYS,N)=LLV(CYS,2*N+1),N+1),N) AND CYS=LLV(CYS,N+1),COLORWHITE,NODRAW;
DRAWLINE(FILTER(BACKSET(REF(CYS,N)=LLV(CYS,2*N+1),N+1),N) AND CYS=LLV(CYS,N+1),CYS,FILTER(底背离>0,5),CYS,0),COLORYELLOW;
DRAWTEXT(底背离,CYS,'↑底背离'),COLORYELLOW;
顶背离:=REF(C,BARSLAST(REF(FILTER(BACKSET(REF(CYS,N)=HHV(CYS,2*N+1),N+1),N) AND CYS=HHV(CYS,N+1),1))+1)<C AND REF(CYS,BARSLAST(REF(FILTER(BACKSET(REF(CYS,N)=HHV(CYS,2*N+1),N+1),N) AND CYS=HHV(CYS,N+1),1))+1)>CYS AND FILTER(BACKSET(REF(CYS,N)=HHV(CYS,2*N+1),N+1),N) AND CYS=HHV(CYS,N+1),COLORGREEN,NODRAW;
DRAWLINE(FILTER(BACKSET(REF(CYS,N)=HHV(CYS,2*N+1),N+1),N) AND CYS=HHV(CYS,N+1),CYS,FILTER(顶背离>0,5),CYS,0),COLORYELLOW;
DRAWTEXT(顶背离,CYS,'↓顶背离'),COLORYELLOW;
};