背離準(zhǔn)確率100%的指標(biāo)
N:=60;
K值:="KDJ.K";
DD:=C=LLV(C,N);{60日最低點(diǎn)}
DDSJ:=BARSLAST(REF(DD,1));{上一低點(diǎn)時(shí)間}
DDGJ:=REF(CLOSE,DDSJ1)>CLOSE;
KDZB:=REF(K值,DDSJ 1);
K底背離:=DDGJ AND KDZB;
GD:=C=HHV(C,N);{60日最高點(diǎn)}
GDSJ:=BARSLAST(REF(GD,1));{上一高點(diǎn)時(shí)間}
GDGJ:=REF(CLOSE,GDSJ 1);
KGZB:=REF(K值,GDSJ 1)>K值;
K頂背離:=GDGJ AND KGZB;
MACD:="MACD.MACD";
MDZB:=REF(MACD,DDSJ 1);
M底背離:=DDGJ AND MDZB;
MGZB:=REF(MACD,GDSJ1)>MACD;
M頂背離:=GDGJ AND MGZB;
RSI:="RSI.RSI1";
RDZB:=REF(RSI,DDSJ 1);
R底背離:=DDGJ AND RDZB;
RGZB:=REF(RSI,GDSJ 1)>RSI;
R頂背離:=GDGJ AND RGZB;
TYP:=(HIGH LOW CLOSE)/3;
CCI:=(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N));
CDZB:=REF(CCI,DDSJ 1);
C底背離:=DDGJ AND CDZB;
CGZB:=REF(CCI,GDSJ 1)>CCI;
C頂背離:=GDGJ AND CGZB;
REFLINE: -5,15,30,COLORBLACK;
DRAWTEXT(K頂背離,IF(ISLASTBAR,27.5,25),'◆'),LINETHICK2;
DRAWTEXT(M頂背離,(ISLASTBAR,24.5,20),'◆'),LINETHICK2;
DRAWTEXT(R頂背離,(ISLASTBAR,20.5,15.1),'◆'),LINETHICK2;
DRAWTEXT(C頂背離,(ISLASTBAR,16.6,10.1),'◆'),LINETHICK2;
DRAWTEXT(ISLASTBAR,10.1 ,'CCI'),LINETHICK2,COLORGREEN;
DRAWTEXT(C底背離,IF(ISLASTBAR,12,10.1),'◆'),LINETHICK2,COLORRED;
DRAWTEXT(ISLASTBAR,15,'RSI'),LINETHICK2,COLORRED;
DRAWTEXT(R底背離,IF(ISLASTBAR,8.5,15),'◆'),LINETHICK2,COLORRED;
DRAWTEXT(ISLASTBAR,20,'MACD'),LINETHICK2,COLORMAGENTA;
DRAWTEXT(M底背離,IF(ISLASTBAR,4.5,20),'◆'),LINETHICK2,COLORRED;
DRAWTEXT(ISLASTBAR,25,'KDJ'),LINETHICK2,COLORRED;
DRAWTEXT(K底背離,IF(ISLASTBAR,1.5,25),'◆'),LINETHICK2,COLORRED;