下偏离值:6.4;
上偏离值:5.4;
上轨:EMA(H,55);
下轨:EMA(L,55);
当前股价:C,colorwhite;
STICKLINE(C>上轨,C,上轨,1),colorred;
STICKLINE(C<下轨,C,下轨,1),colorgreen;
STICKLINE(C>下轨 AND C<上轨,C,下轨,2),coloryellow;
DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26))*100;DEA:=EMA(DIF,9);MACD:=(DIF-DEA)*2;
//神龙抄底13号
CDYH:=DIF/C<-下偏离值 AND DIF/C<0;
抄底一号:=MACD>REF(MACD,1) AND DIF<REF(DIF,1)*1.01 AND CDYH,colorwhite;
底一号:=抄底一号 AND REF(抄底一号,1)=0,colorwhite;
//DRAWTEXT(底一号,L*0.99,'←偏离'),colormagenta;
JJCC:=CROSS(DIF,DEA);
X0ZHH:=BARSLAST(CROSS(0,DIF))+1;
SCCTS:=BARSLAST(CROSS(DEA,DIF))+1,NODRAW;
DIFZDZ1:=LLV(DIF,SCCTS),NODRAW;
GJJZDZ:=LLV(L,SCCTS),NODRAW;
DIFZDZ2:=LLV(DIF,X0ZHH),NODRAW;
DIFWS0ZZ:=HHV(DIF,SCCTS)<-0.08;
LGLJXX:=REF(MACD,1)<0 AND REF(MACD,2)<0;
BLLL:=LGLJXX AND DIFWS0ZZ AND (DIFZDZ1>=REF(DIFZDZ1,SCCTS) OR DIFZDZ1>=REF(DIFZDZ2,SCCTS)) AND GJJZDZ<=REF(GJJZDZ,SCCTS);
三号:=JJCC AND DIF<0 AND BLLL,colormagenta;
//DRAWTEXT(三号,L*0.99,'←背离'),colormagenta;
//神龙逃顶13号
CCDD1:=DIF/C>上偏离值 AND DIF/C>0;
逃顶一号:=MACD<REF(MACD,1) AND DIF>REF(DIF,1) AND CCDD1,colorwhite;
顶一号:=逃顶一号 AND REF(逃顶一号,1)=0,colorwhite;
//DRAWTEXT(顶一号,H*1.0,'←偏离'),colorgreen;
JJC:=CROSS(DEA,DIF);
X0ZHHL:=BARSLAST(CROSS(DIF,0))+1;
SCCTSS:=BARSLAST(CROSS(DIF,DEA))+1,NODRAW;
DIFZDZ11:=HHV(DIF,SCCTSS),NODRAW;
GJJZDZZ:=HHV(H,SCCTSS),NODRAW;
DIFZDZ2:=HHV(DIF,X0ZHH),NODRAW;
DIFWS0ZZZ:=HHV(DIF,SCCTSS)>0.08;
LGLJXXX:=REF(MACD,1)>0 AND REF(MACD,2)>0;
BLLLL:=LGLJXXX AND DIFWS0ZZZ AND (DIFZDZ11<=REF(DIFZDZ11,SCCTSS) OR DIFZDZ11<=REF(DIFZDZ2,SCCTSS)) AND GJJZDZZ>=REF(GJJZDZZ,SCCTSS);
顶三号:=JJC AND DIF>0 AND BLLLL,colormagenta;
//DRAWTEXT(顶三号,H*1.0,'←背离'),colorgreen;
DRAWICON(底一号,L*0.98,1);
DRAWICON(顶一号,H*1,2);
DRAWICON(顶三号,H*1.0,2);
DRAWICON(三号,L*0.99,1);
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
//DRAWICON(CROSS(J,0),L*0.98,5);
//DRAWICON(CROSS(100,J),H*1.02,6);