咱们得给KDJ.CCI找个柺棍【ZIG】使他们的信号能够去伪存真.(TXT.副图解释)
我们炒股的人可以说人人皆知.天天都要用的. 大名鼎鼎的KDJ.和CCI. 可就是这两个指标.经常弄得我们哭笑不得.无数次被假信号欺骗.就说KDJ大于100不一定要卖.小于零也买不得.卖了还涨.买了就跌.是经常的事.CCI背离之后.还有背离.那就是说背离也不可靠.更不要说大于100.小于-100了.咱们要买卖而他们只能是参考指标.
【怎么办】现在我们抓住了他们的把柄.帮助他们找了个【不倒翁】类型的柺棍.-----ZIG-----用他配合KDJ.CCI来佐证他们信号的可靠性.
【1】ZIG受未来变化的飘逸性 【2】KDJ.CCI.有虚假.二次背离的欺骗性 . 现在我们把他们栓在一起.咱们【看他们的共性信号】.用ZIG来佐证没有未来飘逸的KDJ.CCI.咱们来个取长补短.相补相成.我是说【以KDJ.CCI为主导】.用ZIG证明.就可以防止.禰补KDJ.CCI的假信号.假背离.和ZIG的飘逸给咱们带来的伤害.我也是想到这就编辑了.还是需要时间的考验.再进一步修改完善.发布出来大家共同研究研究.必有收获.
=============================================================================================
INPUT:ZF(10,0,50); {大盘KDJ} =============================================================================================== {ZIG-CCI} {顶底背离} High1:=PEAK(4,ZF,1); =======================================================================================
DRAWGBKlast(DATE>900101,strip(RGB(0,0,100),RGB(0,0,40),0));0,COLORff9900;
var9:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(var9,3,1),COLOR00FFFF,DOTLINE;
D:SMA(K,3,1),COLOR00FF00,DOTLINE;
J:(3*K-2*D),COLOR0000FF,LINETHICK2;
High1:=PEAK(4,ZF,1);
Low1:=TROUGH(4,ZF,1);
DRAWTEXT(CROSS(REF(High1,1),High1),100,''+NUMTOSTRN(High1 ,2)+''),ALIGN1,Color00ffFF,linethick1;
DRAWTEXT(CROSS(Low1,REF(Low1,1)),20,''+NUMTOSTRN(Low1 ,2)+''),ALIGN1,Color00FFff,linethick1;
VERTLINE(CROSS(REF(High1,1),High1),2),Color0000FF,LAYER0;
VERTLINE(CROSS(Low1,REF(Low1,1)),2),Color00FF00,LAYER0;
持有:LAST(ZIG(4,ZF)>ref(ZIG(4,ZF),1)),COLOR0000FF ,STICK,LINETHICK2;
空仓:LAST(ZIG(4,ZF)
DRSV:=(INDEXC-LLV(INDEXL,9))/(HHV(INDEXH,9)-LLV(INDEXL,9))*100;
DK:=SMA(DRSV,3,1);
DD:=SMA(DK,3,1);
DJ:(3*DK-2*DD),COLOR00FFFF;
PARTLINE(DJ,(DJ>REF(DJ,1))-1,rgb(0,255,0),1,rgb(255,0,0) ),POINTDOT,LINETHICK6,LAYER1;
INPUT:ZF(10,0,50);
DRAWGBKlast(DATE>900101,strip(RGB(0,0,100),RGB(0,0,40),0));100;-100;0,COLORFF9900;
TYB:= (HIGH + LOW + 2*CLOSE)/4;
CCIA:=(TYB-MA(TYB,14))/(0.015*AVEDEV(TYB,14));
CCIB:=(TYB-MA(TYB,28))/(0.015*AVEDEV(TYB,28));
CCIC:=(TYB-MA(TYB,42))/(0.015*AVEDEV(TYB,42));
CCI:WMA((CCIA+CCIB+CCIC)/3,3);
PARTLINE(cci,cci>REF(cci,1),rgb(255,0,0),cci<=REF(cci,1),rgb(0,255,0) ),LINETHICK2;
{1.MACD}
A1:=BARSLAST(REF(CROSS("MACD.DIFF","MACD.DEA"),1));
B1:=REF(C,A1+1)>C AND REF("MACD.DIFF",A1+1)<"MACD.DIFF" AND CROSS("MACD.DIFF","MACD.DEA");
DRAWTEXT(B1>0,-100,'M底背'),COLOR00FFFF,LINETHICK1;{MACD底背离};
C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIFf"),1));
D1:=REF(C,C1+1)
DRAWTEXT(D1>0,95,'M顶背'),COLOR0077FF,LINETHICK1;{MACD顶背离};
{2.KDJ}
A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");
DRAWTEXT(B2,-50,'J9底背'),COLOR00FFFF,LINETHICK1;{KDJ底背离};
C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
D2:=REF(C,C2+1)
DRAWTEXT(D2>0,80,'J9顶背'),COLOR0077FF,LINETHICK1;{KDJ顶背离};
{3.RSI}
A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");
DRAWTEXT(B3>0,-80,'R底背'),COLOR00FFFF,LINETHICK1;{RSI底背离}
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
D3:=REF(C,C3+1)
DRAWTEXT(D3>0,65,'R顶背'),COLOR0077FF,LINETHICK1;{RSI顶背离};
{4.CCI}
TYB:= (HIGH + LOW + 2*CLOSE)/4;
CCI4:=(TYB-MA(TYB,28))/(0.015*AVEDEV(TYB,28));
B4:=LAST(MA(C,5)
XG:=((B1 AND B2) OR (B2 AND B3) OR (B1 AND B3) OR ( B4 AND CCI4<-90) ) AND "KDJ.D"<30;
DRAWTEXT(LAST(MA(C,5)
Low1:=TROUGH(4,ZF,1);
DRAWTEXT(CROSS(REF(High1,1),High1),150,''+NUMTOSTRN(High1 ,2)+''),ALIGN1,Color00ffFF,linethick1;
DRAWTEXT(CROSS(Low1,REF(Low1,1)),-50,''+NUMTOSTRN(Low1 ,2)+''),ALIGN1,Color00FFff,linethick1;
VERTLINE(CROSS(REF(High1,1),High1),2),Color0000FF,LAYER0;
VERTLINE(CROSS(Low1,REF(Low1,1)),2),Color00FF00,LAYER0;
持有:LAST(ZIG(4,ZF)>ref(ZIG(4,ZF),1))*3,COLOR0000FF ,STICK,LINETHICK2;
空仓:LAST(ZIG(4,ZF)