顶底分型背离公式
通达信顶底分型线段缠论主图指标公式
通达信顶底分型线段缠论主图指标公式局部低点预选A:=BACKSET(LLV(L,5)<REF(LLV(L,4),1),4);局部低点预选B:=BACKSET(局部低点预选A=0 AND REF(局部低点预选A,1)=1,2);局部低点预选C:=IF(局部低点预选B=1 AND REF(局部低点预选B,1)=0,-1,0);局部高点预选A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);局部高点预选B:=BACKSET(局部高点预选A=0 AND REF(局部高点预选A,1)=1,2);局部高点预选C:=IF(局部高点预选B=1 AND REF(局部高点预选B,1)=0,1,0);缺口判断:=IF(L>REF(H,1),1,IF(H<REF(L,1),-1,0));距前高天:=BARSLAST(局部高点预选C=1);距前低天:=BARSLAST(局部低点预选C=-1);小值周期:=LOWRANGE(L);大值周期:=TOPRANGE(H);低保留AA:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);低保留AB:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR LLV(L,距前低天+2)<REF(LLV(L,距前低天+1),1)),-1,0);低保留S:=IF((低保留AA=-1 OR 低保留AB=-1) AND L<REF(H,距前高天+1),-1,0);预判:=IF((距前低天<4 AND HHV(缺口判断,距前低天)!=1) OR REF(低保留S,距前低天)=0,1,0);判断:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND 预判=1 AND 大值周期>REF(小值周期,距前低天+1) AND 大值周期>REF(小值周期,距前低天) AND 大值周期>REF(大值周期,距前高天),1,0);高保留A:=IF(局部高点预选C=1 AND REF(距前低天,1)>REF(距前高天,1) AND HHV(H,距前低天+1)>REF(HHV(H,距前低天+1),1),1,0);高保留B:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND REF(低保留S,距前低天)=-1 AND (距前低天>=4 OR HHV(缺口判断,距前低天)=1),1,0);高保留:=IF((高保留A=1 OR 高保留B=1 OR 判断=1) AND H>REF(L,距前低天+1),1,0);预判A:=IF((距前高天<4 AND HHV(缺口判断,距前高天)!=1) OR REF(高保留,距前高天)=0,1,0);判断A:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND 预判A=1 AND 小值周期>REF(大值周期,距前高天+1) AND 小值周期>REF(大值周期,距前高天) AND 小值周期>REF(小值周期,距前低天),-1,0);低保留A:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);低保留B:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR 判断A=-1),-1,0);低保留:=IF((低保留A=-1 OR 低保留B=-1) AND L<REF(H,距前高天+1),-1,0);距前高天A:=BARSLAST(高保留=1);距前低天A:=BARSLAST(低保留=-1);预判X:=IF((距前低天A<4 AND HHV(缺口判断,距前低天A)!=1) OR REF(低保留,距前低天A)=0,1,0);判断X:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND 预判X=1 AND 大值周期>REF(小值周期,距前低天A+1) AND 大值周期>REF(小值周期,距前低天A) AND 大值周期>REF(大值周期,距前高天A),1,0);A,1)>REF(距前高天A,1) AND HHV(H,距前低天A+1)>REF(HHV(H,距前低天A+1),1),1,0);高保留XB:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND REF(低保留,距前低天A)=-1 AND (距前低天A>=4 OR HHV(缺口判断,距前低天A)=1),1,0);高保留X:=IF((高保留XA=1 OR 高保留XB=1 OR 判断X=1) AND H>REF(L,距前低天A+1),1,0);预判XA:=IF((距前高天A<4 AND HHV(缺口判断,距前高天A)!=1) OR REF(高保留XA,距前高天A)=0,1,0);判断XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND 预判XA=1 AND 小值周期>REF(大值周期,距前高天A+1) AND 小值周期>REF(大值周期,距前高天A) AND 小值周期>REF(小值周期,距前低天A),-1,0);低保留XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)>REF(距前低天A,1) AND LLV(L,距前高天A+1)<REF(LLV(L,距前高天A+1),1),-1,0);低保留XB:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND (距前高天A>=4 OR LLV(缺口判断,距前高天A)=-1 OR 判断XA=-1),-1,0);低保留X:=IF((低保留XA=-1 OR 低保留XB=-1) AND L<REF(H,距前高天A+1),-1,0);距前高天YA:=BARSLAST(高保留X=1);距前低天YA:=BARSLAST(低保留X=-1);预判YX:=IF((距前低天YA<4 AND HHV(缺口判断,距前低天YA)!=1) OR REF(低保留X,距前低天YA)=0,1,0);判断YX:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND 预判YX=1 AND 大值周期>REF(小值周期,距前低天YA+1) AND 大值周期>REF(小值周期,距前低天YA) AND 大值周期>REF(大值周期,距前高天YA),1,0);YA,1)>REF(距前高天YA,1) AND HHV(H,距前低天YA+1)>REF(HHV(H,距前低天YA+1),1),1,0);高保留YXB:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND REF(低保留X,距前低天YA)=-1 AND (距前低天YA>=4 OR HHV(缺口判断,距前低天YA)=1),1,0);高保留YX:=IF((高保留YXA=1 OR 高保留YXB=1 OR 判断YX=1) AND H>REF(L,距前低天YA+1),1,0);预判YXA:=IF((距前高天YA<4 AND HHV(缺口判断,距前高天YA)!=1) OR REF(高保留YXA,距前高天YA)=0,1,0);判断YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND 预判YXA=1 AND 小值周期>REF(大值周期,距前高天YA+1) AND 小值周期>REF(大值周期,距前高天YA) AND 小值周期>REF(小值周期,距前低天YA),-1,0);低保留YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)>REF(距前低天YA,1) AND LLV(L,距前高天YA+1)<REF(LLV(L,距前高天YA+1),1),-1,0);低保留YXB:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND (距前高天YA>=4 OR LLV(缺口判断,距前高天YA)=-1 OR 判断YXA=-1),-1,0);低保留YX:=IF((低保留YXA=-1 OR 低保留YXB=-1) AND L<REF(H,距前高天YA+1),-1,0);AAAD:=IF(高保留YX=1 AND 低保留YX=-1 AND H>REF(H,REF(距前高天YA,1)+2),1,IF(高保留YX=1 AND 低保留YX=-1 AND L<REF(L,REF(距前低天YA,1)+2),-1,0));极点保留:=IF(AAAD=0,高保留YX+低保留YX,AAAD);局部极点:IF(极点保留=-1,L,IF(极点保留=1,H,DRAWNULL)) CIRCLEDOT COLORYELLOW;DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0)COLORBLUE;DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORBLUE;DRAWICON(极点保留=-1,L-0.03,1);DRAWICON(极点保留=1,H+0.03,2);。
缠论公式——精选推荐
缠论公式主图顶周期:=TOPRANGE(H);底周期:=LOWRANGE(L);上内:=LLVBARS(H,顶周期);上外:=LLVBARS(L,顶周期);下内:=HHVBARS(L,底周期);下外:=HHVBARS(H,底周期);上⼒度:=HHV(L,上内+1)>LLV(H,上内+1);下⼒度:=HHV(L,下内+1)>LLV(H,下内+1);上包含:=COUNT(L>=REF(L,1),上外)>2 AND COUNT(H>=REF(H,1),上内)>2; 下包含:=COUNT(H<=REF(H,1),下外)>2 AND COUNT(L<=REF(L,1),下内)>2; 顶0:=顶周期 AND 上⼒度 AND 上包含 AND 上外>3;底0:=底周期 AND 下⼒度 AND 下包含 AND 下外>3;顶分天数:=BARSLAST(顶0);底分天数:=BARSLAST(底0);含中间K线:=IF(顶分天数=0,底分天数,顶分天数)>=3;顶:=顶0 AND 含中间K线 AND H=HHV(H,BARSLAST(底0));底:=底0 AND 含中间K线 AND L=LLV(L,BARSLAST(顶0));NOTEXT上笔划线: DRAWLINE(底,L,顶,H,0),COLORLIRED,LINETHICK1; NOTEXT下笔划线: DRAWLINE(顶,H,底,L,0),COLORLIGREEN,LINETHICK1;分界点:=NOTEXT上笔划线 AND NOTEXT下笔划线;位置调整:=IF(PERIOD=11,0.02,{年}IF(PERIOD=10,0.02,{季}IF(PERIOD=9,0.02, {多⽇}IF(PERIOD=8,0.001,{多分钟}IF(PERIOD=7,0.02, {⽉}IF(PERIOD=6,0.01, {周}IF(PERIOD=5,0.005, {⽇}IF(PERIOD=4,0.002,{60F}IF(PERIOD=3,0.001,{30F}IF(PERIOD=2,0.001,{15F}IF(PERIOD=1,0.0003,{5F}IF(PERIOD=0,0.0002,{1F}0))))))))))));DRAWNUMBER(分界点 AND 顶,H+H*位置调整,H),COLORLIGREEN; DRAWNUMBER(分界点 AND 底,L,L),COLORLIMAGENTA;MACD{MACD扩展公式 *暴风⾳符* }{周期放⼤开关:1为普通模式,0为放⼤模式} 倍数:=IF(PERIOD=11,1,{年}IF(PERIOD=10,4,{季}IF(PERIOD=9,6, {多⽇}IF(PERIOD=8,10,{多分钟}IF(PERIOD=7,12,{⽉}IF(PERIOD=6,5, {周}IF(PERIOD=5,5, {⽇}IF(PERIOD=4,4, {60F}IF(PERIOD=3,8, {30F}IF(PERIOD=2,4, {15F}IF(PERIOD=1,6, {5F}IF(PERIOD=0,5, {1F}1))))))))))));N1:=IF(周期放⼤,12,12*倍数);N2:=IF(周期放⼤,26,26*倍数);N3:=IF(周期放⼤,9,9*倍数);DIFF:EMA(CLOSE,N1) - EMA(CLOSE,N2),COLORWHITE,NODRAW;DEA:EMA(DIFF,N3),COLORYELLOW,NODRAW;MACD: (DIFF-DEA)*2,COLORSTICK,NODRAW;红柱⾯积:IF(MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),NODRAW,COLORRED;绿柱⾯积:ABS(IF(MACD<0,SUM(MACD,BARSLAST(MACD>0)),0)),NODRAW,COLORLIGREEN;MACD⾯积:=IF(MACD>0,红柱⾯积,绿柱⾯积),NODRAW,COLORFFFF00;位置:=MAX(HHV(DIFF,100),ABS(LLV(DIFF,100)));{柱变与交叉临界}开盘价格:=O,COLORYELLOW,NODRAW;收盘价格:=C,COLORYELLOW,NODRAW;最⾼价格:=H,COLORYELLOW,NODRAW;最低价格:=L,COLORYELLOW,NODRAW;振幅:=(H-L)/REF(C,1)*100,COLORYELLOW,NODRAW;柱变临界:REF((EMA(CLOSE,12)*1134-EMA(CLOSE,26)*910-DEA*702)/224,1),COLORLIMAGENTA,NODRAW;叉临界:351/28*(EMA(REF(DIFF,1),9)-11/13*EMA(REF(C,1),12)+25/27*EMA(REF(C,1),26)),COLORLIMAGENTA,NODRAW; 明⽇柱变临界: (EMA(CLOSE,12)*1134-EMA(CLOSE,26)*910-DEA*702)/224,COLORLIBLUE,NODRAW;明⽇交叉临界:351/28*(EMA(DIFF,9)-11/13*EMA(C,12)+25/27*EMA(C,26)),COLORLIBLUE,NODRAW;{MACD重建-避免遮挡}STICKLINE(MACD>0,0,MACD,1,0),COLORRED;STICKLINE(MACD<0,0,MACD,1,0),COLORGREEN;STICKLINE(MACD>0 AND MACD<=REF(MACD,1),0,MACD,1,0),COLORYELLOW;STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLORWHITE;NOTEXTDIFF:EMA(CLOSE,N1) - EMA(CLOSE,N2),COLORWHITE;NOTEXTDEA:EMA(DIFF,N3),COLORYELLOW;{数显开关:1为打开,0为关闭}DRAWNUMBER(数显开关=1 AND LONGCROSS(DEA,DIFF,3),位置*0.8,REF(红柱⾯积,1)),COLORRED;DRAWNUMBER(数显开关=1 AND LONGCROSS(DIFF,DEA,3),0-位置*0.5,REF(绿柱⾯积,1)),COLORGREEN; NOTEXTLMH: DRAWNUMBER(数显开关=1 AND ISLASTBAR AND MACD>0,位置*0.8,红柱⾯积),COLORRED;NOTEXTLML: DRAWNUMBER(数显开关=1 AND ISLASTBAR AND MACD<0,0-位置*0.5,绿柱⾯积),COLORGREEN;三线同图上:"RSI.RSI1",COLORCYAN;中:"/doc/c768c9d1360cba1aa811da1b.html I"/5,COLORWHITE;下:"KDJ.J"-100,COLORMAGENTA;{RSI CCI KDJ 三线同图-暴风⾳符 }NOTEXT1:IF(上<20,上,DRAWNULL),COLORRED,LINETHICK2;NOTEXT2:IF(上>80,上,DRAWNULL),COLORGREEN,LINETHICK2;NOTEXT3:IF(中<-35,中,DRAWNULL),COLORRED,LINETHICK2;NOTEXT4:IF(中>35,中,DRAWNULL),COLORGREEN,LINETHICK2;NOTEXT5:IF(下>-5,下,DRAWNULL),COLORGREEN,LINETHICK2;NOTEXT6:IF(下<-95,下,DRAWNULL),COLORRED,LINETHICK2;NOTEXT7:100;NOTEXT8:50;NOTEXT9:0,COLORLIRED;NOTEXT10:-50;NOTEXT11:-100;{/doc/c768c9d1360cba1aa811da1b.html }T1:=EXIST(上< 120,3) AND 上>REF(上,1);T2:=EXIST(中<-35,3) AND 中>REF(中,1);T3:=EXIST(下<-95,3) AND 下>REF(下,1);T4:=REF(V,1)暴风CCI副图:TYP:= (HIGH+LOW+CLOSE)/3;BFCCI: (TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14)),COLORWHITE;红抄粉吸:BFCCI<-150 OR REF(BFCCI,1)<-150 AND BFCCI>REF(BFCCI,1),COLORLIRE D,NODRAW;绿清黄减:BFCCI>150 OR REF(BFCCI,1)>150 AND BFCCICCI底背离:EXIST(CCI<-200,4) AND CCI>REF(CCI,1) AND L=LLV(L,3) AND H>REF(L,2) AND LCCI顶背离:EXIST(CCI>200,4) AND CCIREF(H,1)*1.01 AND H>REF(HHV(H,3),1)*1.01,COLORGREEN,NODRAW; STICKLINE(BFCCI>150 OR REF(BFCCI,1)>150 AND BFCCISTICKLINE(BFCCI>200 OR REF(BFCCI,1)>200 AND BFCCISTICKLINE(BFCCI<-150 OR REF(BFCCI,1)<-150 AND BFCCI>REF(BFCCI,1),-200,-250,3,0),COLORLIRED; STICKLINE(BFCCI<-200 OR REF(BFCCI,1)<-200 AND BFCCI>REF(BFCCI,1),-200,-250,3,0),COLORRED; STICKLINE(CCI底背离,-200,200,0,-1),COLORLIMAGENT A;STICKLINE(CCI顶背离,-200,200,0,-1),COLORGREEN;NOTEXTCCIS200:200,COLORCY AN,LINETHICK2;NOTEXTCCIX200:-200,COLORLIRED,LINETHICK2;NOTEXTBFCCI:BFCCI,COLORWHITE,LINETHICK2;选股:TYP:= (HIGH+LOW+CLOSE)/3;CCI:= (TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));CCI底背离:EXIST(CCI<-200,4) AND CCI>REF(CCI,1) AND L=LLV(L,3) AND H>REF(L,2) AND L。
MACD背离公式和主图叠加均线变色公式
MACD背离公式和主图叠加均线变色公式MACD背离全项DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIFF,9);MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK2;金叉:=CROSS(DIFF,DEA);DRAWICON(金叉,DEA-0.02,1);死叉:=CROSS(DEA,DIFF);DRAWICON(死叉,DEA+0.02,2);低位金叉:=金叉 AND DIFF<-0.1;STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;DRAWTEXT(低位金叉,0.16,' 低位金叉'),COLORWHITE;JCCOUNT:=COUNT(金叉,BARSLAST(DEA>=0));二次金叉:=金叉 AND DEA<0 AND COUNT(JCCOUNT=2,21)= 1;STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;DRAWICON(二次金叉,DEA*0.9,1) ;DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;A1:=BARSLAST(REF(金叉,1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+ 1) AND 金叉 ANDDEA<0;STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;底背:DRAWLINE(A1=0,REF(DIFF,3),底背离,REF(DIFF,3),0),COL ORRED,LINETHICK1;DRAWTEXT(底背离,REF(DIFF,3)-0.01,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(死叉,1));顶背离:=REF(CLOSE,A2+1)DIFF AND 死叉 AND DEA>0;顶背:DRAWLINE(A2=0,REF(DIFF,3),顶背离,REF(DIFF,3),0),COL ORGREEN,LINETHICK1;DRAWTEXT(顶背离,REF(DIFF,3)+0.01,' 顶背离'),COLOR40FF00;DRAWTEXT(低位金叉AND 二次金叉AND底背离,0.25,'三全项'),COLOR0000FF,LINETHICK2;JC := DEA-DIFF;绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);本次最低价:=LLV(L,BARSLAST(JC<0));本次最高价:=HHV(H,BARSLAST(JC>0));X1:=IF (MACD<0,BARSLAST(CROSS(DIFF,DEA)),0);前次绿柱面积:=REF(绿柱面积,X1+1);前次最低价:=REF(本次最低价,X1+1);Y1:=IF((绿柱面积<0 AND ABS(绿柱面积)AND 本次最低价<前次最低价 ),1,0);RS1:= MACD<0 AND REF(MACD,1)<0 AND C<前次最低价AND ABS(绿柱面积)面积底背驰:= IF (CROSS(DIFF,DEA),REF(Y1,1),0);DRAWTEXT(面积底背驰,-0.2,'面积底背离'),COLOR0000FF;STICKLINE(面积底背驰,0,-0.2,4,0),COLOR0000FF;DRAWICON(面积底背驰,0,23),COLORYELLOW;X2:=IF (MACD>0,BARSLAST(CROSS(DEA,DIFF)),0);前次红柱面积:=REF(红柱面积,X2+1);前次最高价:=REF(本次最高价,X2+1);Y2:=IF((红柱面积>0 AND 红柱面积<前次红柱面积 AND 本次最高价>前次最高价),1,0);RS2:= MACD>0 AND REF(MACD,1)>0 AND C>前次最高价 A NDABS(红柱面积)面积顶背驰:= IF (CROSS(DEA,DIFF),REF(Y2,1),0);DRAWICON(面积顶背驰,0,19),COLOR00FF00;STICKLINE(面积顶背驰,0,0.2,4,0),COLOR00FF00;DRAWTEXT(面积顶背驰,0.2,'面积顶背离'),COLOR40FF00;绿柱变短:=REF(MACD,1)<0 AND REF(MACD,1)REF(MACD,1) AND MACD<0 ANDDEA<0;红柱变短:=REF(MACD,1)>0 AND REF(MACD,1)>REF(MACD,2) AND MACD0 ANDDEA>0;C1:=BARSLAST(REF(绿柱变短,1));柱线底背:=REF(CLOSE,C1+1)>CLOSE AND MACD>REF(MAC D,C1+1) AND绿柱变短;STICKLINE(柱线底背,0,-0.03,6,0),COLOR0000FF;柱线底背离:DRAWLINE(C1=0,REF(MACD,1),柱线底背,REF(MA CD,1),0),COLORRED,LINETHICK1;DRAWTEXT(柱线底背,REF(MACD,1),' 柱线底背离'),COLORFF00 FF;C2:=BARSLAST(REF(红柱变短,1));柱线顶背:=REF(CLOSE,C2+1)STICKLINE(柱线顶背,0,0.03,6,0),COLOR40FF00;柱线顶背离:DRAWLINE(C2=0,REF(MACD,1),柱线顶背,REF(MA CD,1),0),COLOR40FF00,LINETHICK1;DRAWTEXT(柱线顶背,REF(MACD,1),' 柱线顶背离'),COLOR80FF 00;3主图叠加KDJ均线变色公式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;A1:=J>=100;A2:=J<=0;LC:=REF(CLOSE,1);RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1) *100;B1:=RSI1>=80;B2:=RSI<=20;PSY:=COUNT(CLOSE>REF(CLOSE,1),12)/12*100;C1:=PSY>=75;C2:=PSY<=25;MA5:MA(CLOSE,5)COLORWHITE;IF(A1,MA5,DRAWNULL),COLORGREEN,LINETHICK3;IF(A2,MA5,DRAWNULL),COLORRED,LINETHICK3;MA10:MA(CLOSE,10)COLORYELLOW;IF(B1,MA10,DRAWNULL),COLORGREEN,LINETHICK3;IF(B2,MA10,DRAWNULL),COLORRED,LINETHICK3;MA20:MA(CLOSE,20)COLORGREEN;MA30:MA(CLOSE,30)COLORMAGENTA;IF(C1,MA30,DRAWNULL),COLORGREEN,LINETHICK3;IF(C2,MA30,DRAWNULL),COLORRED,LINETHICK3;MA60:MA(CLOSE,60)COLORBROWN;MA120:MA(CLOSE,120)COLORLIBLUE;MA250:MA(CLOSE,250)COLORRED;MACD背离2DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIFF,9);MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK2;低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCO UNT=2,21)=1;STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;DRAWICON(二次金叉,DEA*0.9,1);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+ 1) ANDCROSS(DIFF,DEA);STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINET HICK4;DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)DIFF AND CROSS(DEA,DIFF);顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LIN ETHICK4;DRAWTEXT(低位金叉AND 二次金叉AND底背离,0.25,'三全项'),COLOR0000FF,LINETHICK2;死叉:=CROSS(DEA,DIFF) AND DIFF>0.1;STICKLINE(死叉,0,0.08,6,0),COLORGREEN;DRAWICON(死叉,DEA*0.9,2);MACD 多周期多头共振选股一,15分钟,60分钟,日线MACD共振 DIF := EMA(CLOSE,1 2) -EMA(CLOSE,26);DEA := EMA(DIF,9);MACD:=2*(DIF-DEA);DIF60:='MACD.DIF#MIN60'(12,26,9);DIF15:='MACD.DIF#MIN15'(12,26,9);DEA60:='MACD.DEA#MIN60'(12,26,9);DEA15:='MACD.DEA#MIN15'(12,26,9);选股:CROSS(DIF,DEA) AND CROSS(DIF60,DEA60) ANDCROSS (DIF15,DEA15);二,60分钟,日线,周线MACD共振DIF := EMA(CLOSE,12) - EMA(CLOSE,26);DEA := EMA(DIF,9);MACD:=2*(DIF-DEA);DIF5:='MACD.DIF#week'(12,26,9);DEA5:='MACD.DEA#week'(12,26,9);DIF60:='MACD.DIF#MIN60'(12,26,9);DEA60:='MACD.DEA#MIN60'(12,26,9);选股:CROSS(DIF,DEA) AND CROSS(DIF60,DEA60) ANDCROSS (DIF5,DEA5);三,月线,周线,日线MACD共振DIF := EMA(CLOSE,12) - EMA(CLOSE,26);DEA := EMA(DIF,9);MACD:=2*(DIF-DEA);DIF周:='MACD.DIF#week'(12,26,9);DEA周:='MACD.DEA#week'(12,26,9);DIF月:='MACD.DIF#month'(12,26,9);DEA月:='MACD.DEA#month'(12,26,9);。
通达信顶底分型主图指标公式
通达信顶底分型主图指标公式重心线:(H+L+O+C*3)/6;NX:=(3*CLOSE+LOW+OPEN+HIGH)/6;牛线:(20*NX+19*REF(NX,1)+18*REF(NX,2)+17*REF(NX,3)+16*REF( NX,4)+15*REF(NX,5)+14*REF(NX,6)+13*REF(NX,7)+12*REF(NX,8) +11*REF(NX,9)+10*REF(NX,10)+9*REF(NX,11)+8*REF(NX,12)+7*REF(NX,13 )+6*REF(NX,14)+5*REF(NX,15)+4*REF(NX,16)+3*REF(NX,17)+2*REF(NX,18)+REF(NX,20))/210;牛熊线:MA(牛线,6),COLORGREEN,LINETHICK2;顶:=BBI+3*STD(BBI,13),COLOR004AFF;底:=BBI-3*STD(BBI,13),COLOR67FF00;KU1:=IF(HIGH=HHV(HIGH,3),1,0);KD1:=IF(LOW=LLV(LOW,3),1,0);UL:=IF(REF(KU1,2)=1 AND REF(KU1,1)=0ANDKU1=0,REF(HIGH,2),REF(HIGH,2+BARSLAST(REF(KU1,2)=1 AND REF(KU1,1)=0 AND KU1=0)));DL:=IF(REF(KD1,2)=1 AND REF(KD1,1)=0ANDKD1=0,REF(LOW,2),REF(LOW,2+BARSLAST(REF(KD1,2)=1AND REF(KD1,1)=0 AND KD1=0)));HV:=H>UL AND H>REF(H,1);LV:=L<DL AND L<REF(L,1);GP:=BARSLAST(HV);DP:=BARSLAST(LV);IP:=IF(GP=0,DP,GP)>3;HHV1:=HV AND IP AND H>=HHV(H,BARSLAST(LV));LV1:=LV AND IP AND L<=LLV(L,BARSLAST(HV));V00:=HIGH<REF(HIGH,1) AND LOW<REF(LOW,1);V01:=HIGH<REF(HIGH,1) AND LOW>REF(LOW,1);V02:=HIGH>REF(HIGH,1) AND LOW<REF(LOW,1);V03:=HIGH>REF(HIGH,1) AND LOW>REF(LOW,1);V04:=REF(HIGH,2)<HIGH AND REF(LOW,2)<LOWAND REF(HIGH,2)>REF(HIGH,1) AND REF(LOW,2)<REF(LOW,1);V1:=COUNT(V00,6)>=3 AND COUNT(V01 OR V02,5)=0 AND LLVBARS(LOW,6)=1 AND HHVBARS(HIGH,6)>=5 AND V03;V2:=COUNT(V00,7)>=3 AND COUNT(V01 OR V02,6)=1 AND LLVBARS(LOW,7)=2 AND HHVBARS(HIGH,7)>=6 AND V04;V3:=COUNT(V00,7)>=3 AND COUNT(V01 OR V02,6)=1 AND LLVBARS(LOW,7)=1 AND HHVBARS(HIGH,7)>=6 AND V03;V4:=COUNT(V00,8)>=3 AND COUNT(V01 OR V02,7)<=2 AND LLVBARS(LOW,8)=2 AND HHVBARS(HIGH,8)>=7 AND V04;V5:=COUNT(V00,8)>=3 AND COUNT(V01 OR V02,7)<=2 AND LLVBARS(LOW,8)=1 AND HHVBARS(HIGH,8)>=7 AND V03;V6:=COUNT(V00,9)>=3 AND COUNT(V01 OR V02,8)<=3 AND LLVBARS(LOW,9)=2 AND HHVBARS(HIGH,9)>=8 AND V04;V7:=COUNT(V00,9)>=3 AND COUNT(V01 OR V02,8)<=3 AND LLVBARS(LOW,9)=1 AND HHVBARS(HIGH,9)>=8 AND V03;V8:=COUNT(V00,10)>=3 AND COUNT(V01 OR V02,9)<=4AND LLVBARS(LOW,10)=2 AND HHVBARS(HIGH,10)>=9 AND V04;V9:=COUNT(V00,10)>=3 AND COUNT(V01 OR V02,9)<=4 AND LLVBARS(LOW,10)=1 AND HHVBARS(HIGH,10)>=9 AND V03;V10:=COUNT(V00,11)>=3 AND COUNT(V01 OR V02,10)<=5 AND LLVBARS(LOW,11)=2 AND HHVBARS(HIGH,11)>=10 AND V04;XG:=V1 OR V2 OR V3 OR V4 OR V5 OR V6 OR V7 OR V8 OR V9 OR V10;HV00:=HIGH>REF(HIGH,1) AND LOW>REF(LOW,1);HV01:=HIGH<REF(HIGH,1) AND LOW>REF(LOW,1);HV02:=HIGH>REF(HIGH,1) AND LOW<REF(LOW,1);HV03:=HIGH<REF(HIGH,1) AND LOW<REF(LOW,1);HV04:=REF(HIGH,2)>HIGH AND REF(LOW,2)>LOW AND REF(HIGH,2)>REF(HIGH,1) AND REF(LOW,2)<REF(LOW,1);HV1:=COUNT(HV00,6)>=3 AND COUNT(HV01 OR HV02,5)=0 AND HHVBARS(HIGH,6)=1 AND LLVBARS(LOW,6)>=5 AND HV03;HV2:=COUNT(HV00,7)>=3 AND COUNT(HV01 OR HV02,6)=1 AND HHVBARS(HIGH,7)=2 AND LLVBARS(LOW,7)>=6 AND HV04;HV3:=COUNT(HV00,7)>=3 AND COUNT(HV01 OR HV02,6)=1 AND HHVBARS(HIGH,7)=1 AND LLVBARS(LOW,7)>=6 AND HV03;HV4:=COUNT(HV00,8)>=3 AND COUNT(HV01 OR HV02,7)<=2 AND HHVBARS(HIGH,8)=2 AND LLVBARS(LOW,8)>=7 AND HV04;HV5:=COUNT(HV00,8)>=3 AND COUNT(HV01 OR HV02,7)<=2 AND HHVBARS(HIGH,8)=1 ANDLLVBARS(LOW,8)>=7 AND HV03;HV6:=COUNT(HV00,9)>=3 AND COUNT(HV01 OR HV02,8)<=3 AND HHVBARS(HIGH,9)=2 AND LLVBARS(LOW,9)>=8 AND HV04;HV7:=COUNT(HV00,9)>=3 AND COUNT(HV01 OR HV02,8)<=3 AND HHVBARS(HIGH,9)=1 AND LLVBARS(LOW,9)>=8 AND HV03;HV8:=COUNT(HV00,10)>=3 AND COUNT(HV01 OR HV02,9)<=4 AND HHVBARS(HIGH,10)=2 AND LLVBARS(LOW,10)>=9 AND HV04;HV9:=COUNT(HV00,10)>=3 AND COUNT(HV01 OR HV02,9)<=4 AND HHVBARS(HIGH,10)=1 AND LLVBARS(LOW,10)>=9 AND HV03;HV10:=COUNT(HV00,11)>=3 AND COUNT(HV01 OR HV02,10)<=5 AND HHVBARS(HIGH,11)=2 AND LLVBARS(LOW,11)>=10 AND HV04;HXG:=HV1 OR HV2 OR HV3 OR HV4 OR HV5 OR HV6 OR HV7 OR HV8 OR HV9 OR HV10;底分型:FILTER(XG=1,5) AND 重心线<10.5 AND 牛线<12 AND 牛熊线<10.2,COLORYELLOW,NODRAW;顶分型:FILTER(HXG=1,3),NODRAW;DRAWBAND(BBI,RGB(97,95,00),顶,RGB(97,95,00));DRAWBAND(BBI,RGB(25,75,150),底,RGB(25,75,250));DRAWTEXT_FIX(1,0.02,0,0,'☆微信公众号:({更多指标关注微信公众号:爱指标源码}) ☆'),COLORRED;{用DRAWLINE函数(属于未来函数)绘制直线段,不喜欢的可以删除下面两句公式}DRAWLINE(LV1,LOW,HHV1,HIGH,0),COLORYELLOW,LINETHI CK2;DRAWLINE(HHV1,HIGH,LV1,LOW,0),COLORMAGENTA,LINETHICK2;STICKLINE(CLOSE>REF(CLOSE,1),HIGH,LOW,0,1),COLORRED;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,3,0),COLOR00 0055;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,2.7,0),COLOR 000077;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,2.1,0),COLOR 000099;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,1.5,0),COLOR 0000BB;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,0.9,0),COLOR 0000DD;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,0.3,0),COLOR 0000FF;STICKLINE(CLOSE=REF(CLOSE,1),HIGH,LOW,0,1),COLORWHI TE;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,3,0),COLOR55 5555;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,2.7,0),COLOR 777777;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,2.1,0),COLOR 999999;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,1.5,0),COLOR BBBBBB;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,0.9,0),COLOR DDDDDD;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,0.3,0),COLORF FFFFF;STICKLINE(CLOSE<REF(CLOSE,1),HIGH,LOW,0,1),COLORCYA N;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,3,0),COLOR99 0000;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,2.7,0),COLOR CC0000;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,2.1,0),COLORF F4400;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,1.5,0),COLORF F8800;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,0.9,0),COLORF FCC00;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,0.3,0),COLOR CYAN;DRAWTEXT(FILTER(XG=1,5) AND 重心线<10.5 AND 牛线<12 AND 牛熊线<10.2,L*0.97,'底分型'),COLORYELLOW;DRAWTEXT(FILTER(HXG=1,3),H*1.02,'顶分型');。
macdkdjrsi三合一顶底背离卖出指标公式
macdkdjrsi三合一顶底背离卖出指标公式【最新版】目录1.通达信 MACDKDJRSI 三合一顶底背离指标公式概述2.MACD 顶背离和底背离的概念及作用3.如何利用 MACDKDJRSI 三合一顶底背离指标公式进行卖出操作4.实战案例分析5.总结与建议正文一、通达信 MACDKDJRSI 三合一顶底背离指标公式概述通达信 MACDKDJRSI 三合一顶底背离指标公式是一种股票技术分析工具,它结合了 MACD、KDJ 和 RSI 三个指标,用于判断股票价格的顶部和底部背离情况,帮助投资者做出更为准确的买卖决策。
二、MACD 顶背离和底背离的概念及作用1.概念:顶背离是指股票价格创新高,而 MACD 指标却没有创新高,形成一个高点比一个高点低的走势;底背离是指股票价格创新低,而 MACD 指标却没有创新低,形成一个低点比一个低点高的走势。
2.作用:顶背离通常预示着股票价格即将下跌,是卖出信号;底背离通常预示着股票价格即将上涨,是买入信号。
三、如何利用 MACDKDJRSI 三合一顶底背离指标公式进行卖出操作1.首先,打开通达信软件,输入 MACDKDJRSI 三合一顶底背离指标公式,得到一个包含 MACD、KDJ 和 RSI 三个指标的图形。
2.观察图形,找到顶背离点。
顶背离点是指股票价格创新高,而 MACD 指标却没有创新高的点。
在顶背离点出现时,投资者可以密切关注股票价格的走势,做好卖出准备。
3.当股票价格开始下跌,且 MACD 指标也跟随下跌时,投资者可以确认卖出信号,及时卖出股票,避免损失。
四、实战案例分析以某股票为例,在 2021 年 5 月 20 日,该股票价格创新高,而MACD 指标却没有创新高,形成一个顶背离点。
随后,该股票价格开始下跌,且 MACD 指标也跟随下跌,投资者可以在此时确认卖出信号,及时卖出股票。
五、总结与建议MACDKDJRSI 三合一顶底背离指标公式是一种有效的股票技术分析工具,可以帮助投资者判断股票价格的顶部和底部背离情况,做出更为准确的买卖决策。
缠论主图、附图指标,两天终于做好了,大家凑合看看!
缠论主图、附图指标,两天终于做好了,大家凑合看看!我自己学股票也是从缠论的顶底分型开始的,我学了很多年指标技术,但是最终才发现只有缠论才能仔细把股票市场解释清楚。
从原著再看微博,再到实践,这么多年我虽然一直在做价值投资,但是买卖点还是在用缠论的理论。
最近编写了一点缠论的选股,希望对大家有帮助1、缠论第三类买点选股指标公式LS:=50;A1:=HHV(H,LS*0.7){TUFENDOU};A2:=HHV(H,LS*4){TUFENDOU};A3:=REF(HHV(H,LS*4),LS*0.7){TUFENDOU};A4:=LLV(L,LS/10){TUFENDOU};选股:{TUFENDOU}A1=A2 AND A1>=A3*1.2 AND A4>A3;2、缠论分型笔线段主图指标公式MA5:MA(CLOSE,5) COLORWHITE,LINETHICK2;MA10:MA(CLOSE,10) COLORMAGENTA,LINETHICK1;MA20:MA(CLOSE,20) COLORBLUE,LINETHICK1;MA60:MA(CLOSE,60) COLORYELLOW,LINETHICK2;MA250:MA(CLOSE,250) COLORRED, LINETHICK1;老笔:=0;G:=MA(C,5);D:=MA(C,10);HH:=REF(H,5)=HHV(H,11);LL:=REF(L,5)=LLV(L,11);FG01:=BACKSET(HH,6)>BACKSET(HH,5) ;FD01:=BACKSET(LL,6)>BACKSET(LL,5) ;FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01,IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0));FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01,IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0));FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));GP:IF(FG0,H,DRAWNULL),CIRCLEDOT,COLORCYAN;DP:IF(FD0,L,DRAWNULL),CIRCLEDOT,COLORCYAN;GQ:=L>REF(H,1) AND DAY!=REF(DAY,1);DQ:=HGQL:=REF(L,BARSLAST(GQ));DQH:=REF(H,BARSLAST(DQ));FGH:=REF(H,BARSLAST(FG0));FGL:=REF(L,BARSLAST(FG0));FGH1:=REF(H,BARSLAST(FG0)+1);FGL1:=REF(L,BARSLAST(FG0)+1);FGH2:=REF(H,BARSLAST(FG0)+2);FGL2:=REF(L,BARSLAST(FG0)+2);FDH:=REF(H,BARSLAST(FD0));FDL:=REF(L,BARSLAST(FD0));FDH1:=REF(H,BARSLAST(FD0)+1);FDL1:=REF(L,BARSLAST(FD0)+1);FDH2:=REF(H,BARSLAST(FD0)+2);FDL2:=REF(L,BARSLAST(FD0)+2);FGZH:=IF(FGL<>FGZL:=IF(FGH1<><>FDZH:=IF(FDL1>FDH,FDH,IF(FDH>=FDH1,FDH2,FDH1));FDZL:=IF(FDH>=FDH1,FDL2,FDL1);FG1:=FGH>FDZH AND FG0;FD1:=FDLFG:=FG1 AND FGH>FDH AND FGL>FDL AND FGL1>FDL;FD:=FD1 AND FDL<>BH0:=(H<=ref(h,1) and="" l="">=REF(L,1)) OR (H>=REF(H,1) AND L<>BHG:=COUNT(BH0,BARSLAST(FD0));BHD:=COUNT(BH0,BARSLAST(FG0));BGQ:=COUNT(GQ,BARSLAST(FD0));BDQ:=COUNT(DQ,BARSLAST(FG0));BK0:=IF(BHG>0,BHG+2+老笔,IF(BHD,BHD+2+老笔,3));BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));G1X:=(FG AND BARSLAST(FD)>BK);D1X:=(FD AND BARSLAST(FG)>BK);G1:=(FG0 AND REF(H,BARSLAST(FG0))>=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)>BARSLAST(G1X))OR (FG1 AND COUNT(GQ,BARSLAST(FD1))>0 AND REF(H,BARSLAST(FG1))>REF(H,BARSLAST(G1X)));D1:=(FD0 AND REF(L,BARSLAST(FD0))<=ref(l,barslast(d1x)) and="" barslast(g1x)="">BARSLAST(D1X))OR (FD1 AND COUNT(DQ,BARSLAST(FG1))>0 AND REF(L,BARSLAST(FD1))<>G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G 1)),REF(H,BARSLAST(D1))),;D1L:=IF(BARSLAST(G1)>BARSLAST(D1),REF(L,BARSLAST(D1) ),REF(L,BARSLAST(G1)));G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND H>REF(H,1) AND BARSLAST(D1)>BARSLAST(G1);D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND LBARSLAST(D1);G3:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))>REF(H,BARSLAST(G2)) ANDBARSLAST(D2)>BARSLAST(G2));D3:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))BARSLAST(D2));GPB:IF(G1X,H,DRAWNULL),CIRCLEDOT,COLORYELLOW;DPB:IF(D1X,L,DRAWNULL),CIRCLEDOT,COLORYELLOW;DRAWICON(CROSS(MA20,MA60),MA60*0.98,9);DIF:=MA(CLOSE,5)-MA(CLOSE,89);DIFMA:=MA(DIF,36);XG:=CROSS(DIF,DIFMA) AND DIF<>DRAWICON(XG,H*1.03,23);{画线}NN:=G3;UU:=D3;L1:DRAWLINE(UU,L,NN,H,0),COLORLIGREEN;L2:DRAWLINE(NN,H,UU,L,0),COLORLIGREEN;{标示端点数值}DRAWNUMBER(L1 AND L2 AND NN ,H,H),COLORLIRED;DRAWNUMBER(L1 AND L2 AND UU ,L,L),COLORLIMAGENTA;{折扣价}DRAWICON(CURRBARSCOUNT=6,LOW*0.98,24);DRAWNUMBER(CURRBARSCOUNT=6,LOW*0.96,C);DRAWICON(CURRBARSCOUNT=11,LOW*0.98,25);DRAWNUMBER(CURRBARSCOUNT=11,LOW*0.96,C);DRAWICON(CURRBARSCOUNT=21,LOW*0.98,26);DRAWNUMBER(CURRBARSCOUNT=21,LOW*0.96,C);DRAWICON(CURRBARSCOUNT=61,LOW*0.98,27);DRAWNUMBER(CURRBARSCOUNT=61,LOW*0.96,C);DRAWICON(CURRBARSCOUNT=121,LOW*0.98,18);DRAWNUMBER(CURRBARSCOUNT=121,LOW*0.96,C);{量能平台}N250:=250;PT250:=CONST(HHVBARS(V,N250));T250:IF(CURRBARSCOUNT<>IF(CURRBARSCOUNT=PT250+1,T250,DRAWNULL),CIRCLED OT,COLORFF0000,LINETHICK2;DRAWTEXT(CURRBARSCOUNT=N250,T250,'250'),COLOR99 0000;N120:=120;PT120:=CONST(HHVBARS(V,N120));T120:IF(CURRBARSCOUNT<>IF(CURRBARSCOUNT=PT120+1,T120,DRAWNULL),CIRCLED OT,COLORFFFF00,LINETHICK2;DRAWTEXT(CURRBARSCOUNT=N120,T120,'120'),COLORAA AA00;N60:=60;PT60:=CONST(HHVBARS(V,N60));T60:IF(CURRBARSCOUNT<>IF(CURRBARSCOUNT=PT60+1,T60,DRAWNULL),CIRCLEDOT, COLOR00FF00,LINETHICK2;DRAWTEXT(CURRBARSCOUNT=N60,T60,'60'),COLOR00BB0 0;N30:=30;PT30:=CONST(HHVBARS(V,N30));T30:IF(CURRBARSCOUNT<>IF(CURRBARSCOUNT=PT30+1,T30,DRAWNULL),CIRCLEDOT, COLOR0000FF,LINETHICK2;DRAWTEXT(CURRBARSCOUNT=N30,T30,'30'),COLOR0000C C;N20:=20;PT20:=CONST(HHVBARS(V,N20));T20:IF(CURRBARSCOUNT<>IF(CURRBARSCOUNT=PT20+1,T20,DRAWNULL),CIRCLEDOT, COLORFF00FF,LINETHICK2;DRAWTEXT(CURRBARSCOUNT=N20,T20,'20'),COLORDD00 DD;N10:=10;PT10:=CONST(HHVBARS(V,N10));T10:IF(CURRBARSCOUNT<>IF(CURRBARSCOUNT=PT10+1,T10,DRAWNULL),CIRCLEDOT, COLOR00FFFF,LINETHICK2;DRAWTEXT(CURRBARSCOUNT=N10,T10,'10'),COLOR00EEEE;N5:=5;PT5:=CONST(HHVBARS(V,N5));T5:IF(CURRBARSCOUNT<>IF(CURRBARSCOUNT=PT5+1,T5,DRAWNULL),CIRCLEDOT,C OLORFFFFFF,LINETHICK2;DRAWTEXT(CURRBARSCOUNT=N5,T5,'5'),COLORFFFFFF;ND:=10;PTD:=CONST(LLVBARS(V,ND));TDPX:IF(CURRBARSCOUNT<=nd,const(if(ptd=0,o,ref(o,ptd)) ),drawnull),>IF(CURRBARSCOUNT=PTD+1,TDPX,DRAWNULL),CIRCLEDOT, COLOR9370DB,LINETHICK2;DRAWTEXT(ISLASTBAR,TDPX,' 地平线10'), COLOR9370DB;3、缠论背驰指标公式DIFF:EMA(CLOSE,12)-EMA(CLOSE,27);DEA:EMA(DIFF,9);MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK2;低位金叉:=CROSS(DIFF,DEA) AND DIFF<>STICKLINE(低位金叉,0,0.08,6,0),coloryellow;DRAWTEXT(低位金叉,0.16,' 低位金叉'),colorwhite;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 and="" count(jccount="">STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;DRAWICON(二次金叉,DEA*0.9,1) ;DRAWTEXT(二次金叉,0.2,' 二次金叉'),coloryellow;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),colorred,LINETHICK4;DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)DIFF AND CROSS(DEA,DIFF);顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),colorgreen,LINETHICK4;DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0.25,'三全项'),COLOR0000FF,LINETHICK2;。
顶底分型分类
*顶底分型分类A:{顶底分型}STICKLINE(1,H,L,1.5,0),COLORGREEN;{----------};{双K线的9种排列及代号的数学原理-残月08制作于2011.12.04};{8种底分型和8种顶分型的数学原理-残月08制作于2011.12.04};MA1K高:=IF(H>REF(H,1),1,IF(H=REF(H,1),0,IF(H<REF(H,1),-1,0)));MA1K低:=IF(L>REF(L,1),1,IF(L=REF(L,1),0,IF(L<REF(L,1),-1,0)));MA1K:=MA1K高+MA1K低;MA1K昨:=REF(MA1K,1);底转强:=IF(MA1K=2 AND MA1K昨<2,10,0);顶转弱:=IF(MA1K=-2 AND MA1K昨>-2,10,0);底:=IF(底转强=10 AND REF(底转强,1)=0,10,0);顶:=IF(顶转弱=10 AND REF(顶转弱,1)=0,10,0);{----------};STICKLINE(底=10,H,L,1.5,0),COLORRED;STICKLINE(顶=10,H,L,1.5,0),COLORBLUE;B:MA5:MA(C,5);MA13:MA(C,13);MA34:MA(C,34);kx:="chanlun@kxian";{这个放第一个要不会出问题滴-_-\\\~~}kxg:="chanlun@kxg";kxd:="chanlun@kxd";kxx:="chanlun@kxfx";笔:="chanlun@bi";笔周期:"chanlun@bilast",linethick0, coloryellow;bilast:="chanlun@bilast";{笔周期};段:="chanlun@duan";段周期:"chanlun@duanlast", linethick0, coloryellow;duanlast:="chanlun@duanlast"; {段周期};中枢:="chanlun@zs";zszg:="chanlun@zszg";zszd:="chanlun@zszd";zsgg:="chanlun@zsgg";zsdd:="chanlun@zsdd";zszz:="chanlun@zszz";zsks:="chanlun@zskslast";zsjs:="chanlun@zsjslast";bifx:=-REF(笔,bilast);duanfx:=-REF(段,duanlast);kxqj:="chanlun@kxqj";{画中枢Begin} {以背景方式画}STICKLINE(zszg>zszd AND duanfx=1, zszg, zszd, 20, 502), colorf00ff0;STICKLINE(zszg>zszd AND duanfx=-1, zszg, zszd, 20, 502), colore6002d;{中枢震荡监视器}DRAWLINE(zsks=1, zszz, zsjs=1, zszz, 0), coloryellow;{画中枢END}zslx:="chanlun@zslx"(段);{高级别走势类型中枢本级别走势构成的中枢}zslxA:="chanlun@zslx"(段);zslxzsA:="chanlun@zslxzs";zslxzsggA:="chanlun@zslxzsgg";zslxzsddA:="chanlun@zslxzsdd";zslxzszgA:="chanlun@zslxzszg";zslxzszdA:="chanlun@zslxzszd";zslxzszzA:="chanlun@zslxzszz";zslxzskslastA:="chanlun@zslxzskslast";zslxzsjslastA:="chanlun@zslxzsjslast";{画中枢Begin}DRAWLINE(zslxzskslastA=1, zslxzszgA, zslxzsjslastA=1, zslxzszgA, 0), colorRed, linethick2;DRAWLINE(zslxzskslastA=1, zslxzszdA, zslxzsjslastA=1, zslxzszdA, 0), colorRed, linethick2;STICKLINE(zslxzskslastA=1, zslxzszgA, zslxzszdA, 1, -501), colorRed, linethick2;STICKLINE(zslxzsjslastA=1, zslxzszgA, zslxzszdA, 1, 501), colorRed, linethick2;{中枢震荡监视器}DRAWLINE(zslxzskslastA=1, zslxzszzA, zslxzsjslastA=1, zslxzszzA, 0), colorRed;{画中枢End}{笔段走势类型}drawline(笔=1,h,笔=-1,l,0),coloryellow,linethick1;drawline(笔=-1,l,笔=1,h,0),coloryellow,linethick1;drawline(段=1,h,段=-1,l,0),colorblue,linethick1;drawline(段=-1,l,段=1,h,0),colorblue,linethick1;drawline(zslx=1, kxg, zslx=-1, kxd, 0),CIRCLEDOT,colorRed, linethick2;drawline(zslx=-1, kxd, zslx=1, kxg, 0),CIRCLEDOT,colorRed, linethick2;drawline(zslxA=1, kxg, zslxA=-1, kxd,0),CIRCLEDOT,colorMagenta, linethick2;drawline(zslxA=-1, kxd, zslxA=1, kxg, 0),CIRCLEDOT,colorMagenta, linethick2;{涨停彩色}STICKLINE((C-REF(C,1))/REF(C,1)>0.095,C,O,10,0),COLORMAGENTA;A1:=BARSLAST(REF(CROSS("MACD.DIF"(12,26,9),"MACD.DE A"(12,26,9)),1));B1:=REF(C,A1+1)>C AND REF("MACD.DIF"(12,26,9),A1+1)<"MACD.DIF"(12,26,9) AND CROSS("MACD.DIF"(12,26,9),"MACD.DEA"(12,26,9));底背离MACD:DRAWTEXT(FILTER(B1>0,5),LOW,'1'),COLORYELLOW;DRAWTEXT(FILTER(B1>0,5),LOW*0.98,'MACD底背离'),COLOR00FF00;A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));底背离KDJ:DRAWTEXT(FILTER(B2>0,5),LOW,'▲'),COLORYELLOW;DRAWTEXT(FILTER(B2>0,5),LOW*0.98,'KDJ底背离'),COLORRED;A3:=BARSLAST(REF(CROSS("RSI.RSI1"(8,55,55),"RSI.RSI2"(8, 55,55)),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(8,55,55),A3+1)<"RSI.RSI1"(8,55,55) AND CROSS("RSI.RSI1"(8,55,55),"RSI.RSI2"(8,55,55));底背离RSI:DRAWTEXT(FILTER(B3>0,5),LOW,'▲'),COLORYELLOW;DRAWTEXT(FILTER(B3>0,5),LOW*0.98,'RSI底背离'),COLORF0F000;A4:=BARSLAST(REF(CROSS("DMI.PDI"(14,6),"DMI.MDI"(14,6 )),1));B4:=REF(C,A4+1)>C AND REF("DMI.PDI"(14,6),A4+1)<"DMI.PDI"(14,6) AND CROSS("DMI.PDI"(14,6),"DMI.MDI"(14,6));底背离DMI:DRAWTEXT(FILTER(B4>0,5),LOW,'▲'),COLORYELLOW;DRAWTEXT(FILTER(B4>0,5),LOW*0.98,'DMI底背离'),COLORF00FF0;C1:=BARSLAST(REF(CROSS("MACD.DEA"(12,26,9),"MACD.DI F"(12,26,9)),1));D1:=REF(C,C1+1)<C AND REF("MACD.DIF"(12,26,9),C1+1)>"MACD.DIF"(12,26,9) AND CROSS("MACD.DEA"(12,26,9),"MACD.DIF"(12,26,9));顶背离MACD:DRAWTEXT(FILTER(D1>0,5),HIGH*1.02,'▲'),COLOR00FF0 0;DRAWTEXT(FILTER(D1>0,5),HIGH*1.04,'MACD顶背离'),COLORRED;C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));顶背离KDJ:DRAWTEXT(FILTER(D2>0,5),HIGH*1.02,'▲'),COLOR00FF00;DRAWTEXT(FILTER(D2>0,5),HIGH*1.04,'KDJ顶背离'),COLORF00FF0;C3:=BARSLAST(REF(CROSS("RSI.RSI2"(8,55,55),"RSI.RSI1"(8, 55,55)),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(8,55,55),C3+1)>"RSI.RSI1"(8,55,55) AND CROSS("RSI.RSI2"(8,55,55),"RSI.RSI1"(8,55,55));顶背离RSI:DRAWTEXT(FILTER(D3>0,5),HIGH*1.02,'▲'),COLOR00FF00;DRAWTEXT(FILTER(D3>0,5),HIGH*1.04,'RSI顶背离'),COLORYELLOW;C4:=BARSLAST(REF(CROSS("DMI.MDI"(14,6),"DMI.PDI"(14,6 )),1));D4:=REF(C,C4+1)<C AND REF("DMI.PDI"(14,6),C4+1)>"DMI.PDI"(14,6) AND CROSS("DMI.MDI"(14,6),"DMI.PDI"(14,6));顶背离DMI:DRAWTEXT(FILTER(D4>0,5),HIGH*1.02,'▲'),COLOR00FF00;DRAWTEXT(FILTER(D4>0,5),HIGH*1.04,'DMI顶背离'),COLORF0F000;{顶底分型}STICKLINE(1,H,L,1.5,0),COLORGREEN;{----------};{双K线的9种排列及代号的数学原理-残月08制作于2011.12.04};{8种底分型和8种顶分型的数学原理-残月08制作于2011.12.04};MA1K高:=IF(H>REF(H,1),1,IF(H=REF(H,1),0,IF(H<REF(H,1),-1,0)));MA1K低:=IF(L>REF(L,1),1,IF(L=REF(L,1),0,IF(L<REF(L,1),-1,0)));MA1K:=MA1K高+MA1K低;MA1K昨:=REF(MA1K,1); 底转强:=IF(MA1K=2 AND MA1K昨<2,10,0);顶转弱:=IF(MA1K=-2 AND MA1K昨>-2,10,0);底:=IF(底转强=10 AND REF(底转强,1)=0,10,0);顶:=IF(顶转弱=10 AND REF(顶转弱,1)=0,10,0);{----------};STICKLINE(底=10,H,L,1.5,0),COLORRED; STICKLINE(顶=10,H,L,1.5,0),COLORBLUE;。
macd顶背离和底背离在实战中的使用(图解、含公式)
macd顶背离和底背离在实战中的使用(图解)(附公式)顶背离当股价K线图上的股票走势一峰比一峰高,股价一直在向上涨,而MACD指标图形上的由红柱构成的图形的走势是一峰比一峰低,即当股价的高点比前一次的高点高、而MACD指标的高点比指标的前一次高点低,这叫顶背离现象。
顶背离现象一般是股价在高位即将反转转势的信号,表明股价短期内即将下跌,是卖出股票的信号。
底背离底背离一般出现在股价的低位区。
当股价K线图上的股票走势,股价还在下跌,而MACD指标图形上的由绿柱构成的图形的走势是一底比一底高,即当股价的低点比前一次低点底,而指标的低点却比前一次的低点高,这叫底背离现象。
底背离现象一般是预示股价在低位可能反转向上的信号,表明股价短期内可能反弹向上,是短期买入股票的信号。
在实践中,MACD指标的背离一般出现在强势行情中比较可靠,股价在高价位时,通常只要出现一次背离的形态即可确认位股价即将反转,而股价在低位时,一般要反复出现几次背离后才能确认。
因此,MACD指标的顶背离研判的准确性要高于底背离,这点投资者要加以留意。
我的MACD顶背离为:股价经过一段上涨,MACD的顶背离是指股价与前面的高股价平或高(宏观地看,粗看,看股价趋势)MACD指标中的DIFF不与股价同步向上反而降低或平行了(细看,比数值大小这样才有可操作性),在cdl指标中就是DIFF由红翻绿了。
股价是看趋势,不是一定要按什么最高,最低,收盘价,是看一个大概样子,而下面的DIFF是要和前面的峰比大小的,所以要精确。
发挥用法就是不看上面价,只看MACD的DIFF的最高点,只要这个新出来的高峰没有前高就算是背离了,一般往下至少有15%的跌幅。
这里要说明的就是教科书上所说的MACD背离是股价与MACD指标中的MACD比,而我这里的是股价与MACD指标的DIFF比。
例图中E40为EXPMA40,E10为EXPMA10,3MA为3日均线。
反过来,就是MACD底背离了。
缠论分型公式
缠论分型公式
缠论分型公式是一种基于分型理论和K线形态的股票分析方法。
以下是缠论分型公式的编写方法:
1. 标记所有顶分型及底分型的顶部或底部,简称“节点”。
2. 非包含关系的分型端点预选:顶分型公式H>REF(H,1) AND L>REF(L,1);底分型公式L<REF(L,1) AND H<REF(H,1)。
3. 包含关系的K线处理:凡不符合上述类型的K线,均处于包含关系之中。
包含关系分为两种,一是当前K线包含前一根K线时,需进行合并处理;
二是当前K线被前一根K线包含时,因不涉及端点,无需处理。
4. 将前述二种分型节点作为备选分型。
5. 对连续的同向分型节点,取最高点或最低点为本笔分型的节点,并向前过滤掉中间满足条件的分型。
过滤的目的是仅保留最后一次的最高最低节点分型,确保预选分型节点的唯一性。
6. 分型顶:根据预选分型节点的最高价或最低价进行处理。
如果
H=HHV(H,BARSLAST(分型底2)),则取其为本笔分型的节点;如果
L=LLV(L,BARSLAST(分型顶2)),则取其为本笔分型的节点。
7. 分型底:根据预选分型节点的最高价或最低价进行处理。
如果
L=LLV(L,BARSLAST(分型顶2)),则取其为本笔分型的节点;如果
H=HHV(H,BARSLAST(分型底2)),则取其为本笔分型的节点。
8. 最后画出符合顶分型和底分型的黄色K线即可。
如需获取完整的缠论分型公式代码和操作流程,建议查阅缠论相关书籍或咨询专业人士。
通达信实用macd真正的MACD背离公式
通达信实用macd真正的MACD背离公式DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);macd:(DIF-DEA)*2,COLORSTICK;{底部信号}BB值:=EMA(100*(C-LLV(LOW,34))/(HHV(H,34)-LLV(LOW,34)),3);AAA:=EMA(CLOSE,12)-EMA(CLOSE,26);DRAWTEXT(CROSS(BB值,9),0, '‘底部'),COLORYELLOW;DRAWICON(CROSS(BB值,9),0,41);STICKLINE(CROSS(BB值,9),AAA,0,2,0),COLORYELLOW;{DRAWICON(REF(DIF,1)>REF(DIF,2) AND DIF<REF(DIF,1) AND DIF>0 AND DIF>DEA,DIF*1.1,2),COLORGREEN;DRAWICON(CROSS(DEA,DIF) AND DIF>0,DIF,37),COLORGREEN;DRAWICON(REF(DIF,1)<REF(DIF,2) AND DIF>REF(DIF,1) AND DIF<0 AND DIF<DEA,DIF*1.1,1),COLORRED;DRAWICON(CROSS(DIF,DEA) AND DIF<0,DIF,36),COLORRED;} X_2:=BARSLAST(REF(MACD,1)<0 AND MACD>0);X_3:=LLVBARS(MACD,X_2+20);X_4:=IF(X_3>X_2,REF(MACD,X_3),0);X_5:=MACD<0 AND MACD>X_4 AND LOW=LLV(LOW,X_2+20) AND X_4<0;X_6:=REF(X_5,1)=1 AND MACD>REF(MACD,1) AND REF(DIF,X_3)<0 AND MACD<0;低背:DRAWLINE(X_4=X_3,MACD,X_6,MACD,0),COLORRED,LINETHI CK2;DRAWICON(X_6,MACD*1.2,26);X_7:=HHVBARS(MACD,X_2+20);X_8:=IF(X_7>X_2,REF(MACD,X_7),0);X_9:=MACD>0 AND MACD<X_8 AND HIGH=HHV(HIGH,X_2+20) AND X_8>0;X_10:=REF(X_9,1)=1 AND MACD>REF(MACD,1) AND REF(DIF,X_7)>0;顶背:DRAWLINE(X_8=X_7,MACD,X_10,MACD,0),COLORGREEN,LINE THICK2;DRAWICON(X_10,MACD*1.2,15);X_11:=CLOSE/MA(CLOSE,40)*100<78;X_12:=CLOSE/MA(CLOSE,60)*100<74;X_13:=HIGH>LOW*1.051;X_14:=X_13 AND COUNT(X_13,5)>1;X_15:=IF(X_14 AND (X_11 OR X_12),2,0);X_16:=CLOSE/REF(CLOSE,25)<=1.1;X_17:=SMA(MAX(CLOSE-REF(CLOSE,2),0),7,1)/SMA(ABS(CLOSE-REF(CLOSE,2)),7,1)*100<15;X_18:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100;X_19:=SMA(X_18,2,1);X_20:=SMA(X_19,2,1);X_21:=IF(X_19>REF(X_19,1) AND REF(X_19,1)<REF(X_19,2) AND X_19<23,1.5,0);抄底:X_16 AND X_15 AND X_17 AND X_21 ,COLORWHITE;{X_22:=100-100*(HHV(HIGH,5*8)-CLOSE)/(HHV(HIGH,5*8)-LLV(LOW,5*8));X_23:=MA(CLOSE,5);X_24:=IF(CLOSE>SAR(10,2,20),1,0);X_25:=IF(CLOSE<SAR(10,2,20),(-1),0);X_26:=ATAN((X_23/REF(X_23,1)-1)*100)*180/3.1416;X_27:=IF(X_26>30,1,0);X_28:=IF(X_26<(-30),(-1),0);X_29:=X_24+X_27+X_25+X_28;}{线变色}{IF(X_29<(-1) OR X_22<25.01,DIF,DRAWNULL),COLORGREEN,LINETHICK1;IF(X_22>74.989998 OR X_29>0,DIF,DRAWNULL),COLORRED,LINETHICK1;}VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1);VA2:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(VA1,1)+2),0.5);前高:DRAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1),COLORYEL LOW,POINTDOT ;VA3:=LLVBARS(MACD,BARSLAST(MACD>0)+1);VA4:=CROSS(BACKSET(CROSS(MACD,0) OR (ISLASTBAR AND MACD<0),REF(VA3,1)+2),0.5);前低:DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1),COLORYEL LOW,POINTDOT ;启动点:=MACD<0 AND MACD>REF(MACD ,1) AND REF(MACD ,1)<REF(MACD ,2)AND REF(MACD ,2)<REF(MACD ,3)AND REF(MACD ,3)<REF(MACD ,4);STICKLINE(启动点,0.2,MACD,0.3,0),COLORYELLOW COLORYELLOW;{STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1.8,0),COLOR000055;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1.1,0),COLOR000099;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0.6,0),COLOR0000BB;}启动点A:0,COLORYELLOW;{DRAWICON(启动点,2,11);}{MACD&KDJ 金叉共振}{DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);}RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9));K:=SMA(RSV,9,3),NODRAW;D:=SMA(K,9,3),NODRAW;J:=3*K-2*D,NODRAW;A:=CROSS(DIF,DEA) AND CROSS(K,D) AND CROSS(J,D);DRAWICON(A,DEA*1.2,25);DRAWTEXT(A,DEA*1.2, ' 金叉共振'),COLORYELLOW;0,COLORGRAY,DOTLINE;{RSI买入}WRSI:=SMA(MAX(CLOSE-REF(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),6,1)*100;相对强弱RSI买入:=CROSS(WRSI,20),STICK,LINETHICK2,COLORYELLOW;{RSI买入:STICKLINE(CROSS(WRSI,20),0,70,0,0),LINETHICK2,COLORYELL OW;}STICKLINE(相对强弱RSI买入,0-0.1,MACD-0.1,0.3,0),COLORRED;DRAWTEXT(相对强弱RSI买入,MACD-0.1, '‘入'),COLORYELLOW;{背离}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,-0.3,'RSI底离'),COLORCYAN;{RSI底背离};C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1");DRAWTEXT(D3>0,0.5,'RSI顶离'),COLORGREEN;{RSI顶背离};。
通达信OVB-MACD看透顶底背离通达信指标公式源码
OBV0:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),0); OBV:=OBV0/100000;MA30:=MA(OBV,21);OBV1:=OBV-MA30;长均:EMA(OBV1,100),COLORWHITE;中均:EMA(OBV1,20)COLORYELLOW;短均:EMA(OBV1,5),COLORRED;STICKLINE(中均>长均AND REF(中均,1)<REF(短均,1) AND 短均<=中均,中均,0,2,0)COLORGREEN,NODRAW;STICKLINE(REF(中均,1)>REF(短均,1) AND 短均>=中均AND OBV1>REF(OBV1,1),中均,0,2,0),COLORRED;TY:=OBV1;AA1:=REF(TY,10)=HHV(TY,2*10+1); B1:=FILTER(AA1,10); HD:=FILTER(B1,10);AA2:=REF(TY,10)=LLV(TY,2*10+1); B2:=FILTER(AA2,10); LD:=FILTER(B2,10);AB:=REF(OBV1,BARSLAST(HD));T1:=BARSLAST(HD)<BARSLAST(LD) AND NOT(HD) ;T2:=BARSLAST(HD)>BARSLAST(LD) AND NOT(LD);峰:=IF(T1,AB,AB),COLORYELLOW,LINETHICK1;DIFF:=EMA(CLOSE,5)-EMA(CLOSE,13);DEA:=EMA(DIFF,9),COLORFFFF00;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA); MACD底背离:IF(底背离,HHV(OBV1,50)*0.5,0),LINETHICK2,COLORRED;DRAWTEXT(底背离,HHV(OBV1,50)*0.4,'←底背离'),COLORRED;OVC1:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(C,OVC1+1)<C AND REF(DIFF,OVC1+1)>DIFF AND CROSS(DEA,DIFF),COLORFF00FF,LINETHICK2;MACD顶背离:IF(顶背离,HHV(OBV1,50)*0.4,0),LINETHICK2,COLORGREEN; DRAWTEXT(顶背离>0,HHV(OBV1,50)*0.4,'←顶背离'),COLORGREEN;OOBV:0,LINETHICK2,COLORBLUE;。
分时背离指标
通达信KDJ,MACD,RSI 顶底背离分时指标公式来源:Internet,编辑:股旁网,2016-09-19 DRAWGBK(C>0,RGB(50,60,250),RGB(17,21,89),0,'11',0);H1:=MAX(DYNAINFO(3),DYNAINFO(5));L1:=MIN(DYNAINFO(3),DYNAINFO(6));P1:=H1-L1;阻力:=L1+P1*7/8,COLORGREEN;支撑:=L1+P1*0.5/8,COLORRED;中线:=(支撑+阻力)/2,COLORWHITE,POINTDOT;V11:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L, 55))*100,5,1)-2*SMA(SMA((C-LLV(L,55))/(HHV (H,55)-LLV(L,55))*100,5,1),3,1);趋势线:EMA(V11,3),LINETHICK2,COLORLIMAGENTA; V12:=(趋势线-REF(趋势线,1))/REF(趋势线,1)*100; 准备买入:STICKLINE(趋势线<11,趋势线,11,5,0),COLORYELLOW;AA:=(趋势线<11) AND FILTER((趋势线<=11),15)AND C<中线;BB0:=REF(趋势线,1)<11 AND CROSS(趋势线,11) AND C<中线;BB1:=REF(趋势线,1)<11 AND REF(趋势线,1)>6 AND CROSS(趋势线,11);BB2:=REF(趋势线,1)<6 AND REF(趋势线,1)>3 AND CROSS(趋势线,6);BB3:=REF(趋势线,1)<3 AND REF(趋势线,1)>1 AND CROSS(趋势线,3);BB4:=REF(趋势线,1)<1 AND REF(趋势线,1)>0 AND CROSS(趋势线,1);BB5:=REF(趋势线,1)<0 AND CROSS(趋势线,0); BB:=BB1=1 OR BB2=1 OR BB3=1 OR BB4=1 OR BB5=1;下单买入:STICKLINE(BB=1 AND C<中线,11,50,5,0),COLORRED;DRAWICON(BB=1 AND C<中线,55,1); DRAWTEXT(BB0,60,'★买'),COLORRED; DRAWTEXT(AA,16,'准备买入'),COLORYELLOW;准备卖出:STICKLINE(趋势线>89,趋势线,89,5,0),COLORWHITE;CC:=(趋势线>89) AND FILTER((趋势线>89),15) AND C>中线;DD0:=REF(趋势线,1)>89 AND CROSS(89,趋势线) AND C>中线;DD1:=REF(趋势线,1)>89 AND REF(趋势线,1)<94 AND CROSS(89,趋势线);DD2:=REF(趋势线,1)>94 AND REF(趋势线,1)<97 AND CROSS(94,趋势线);DD3:=REF(趋势线,1)>97 AND REF(趋势线,1)>99 AND CROSS(97,趋势线);DD4:=REF(趋势线,1)>99 AND REF(趋势线,1)<100 AND CROSS(99,趋势线);DD5:=REF(趋势线,1)>100 AND CROSS(100,趋势线);DD:=DD1=1 OR DD2=1 OR DD3=1 OR DD4=1 OR DD5=1;下单卖出:STICKLINE(DD=1 AND C>中线,89,50,5,0),COLORGREEN;DRAWICON(DD=1 AND C>中线,45,2);DRAWTEXT(DD0,40,'★卖'),COLORGREEN; DRAWTEXT (CC,84,'准备卖出'),COLORWHITE; 顶:89,COLORGREEN;底:11,COLORRED;中:50,POINTDOT,COLORWHITE;DRAWTEXT(ISLASTBAR,顶,'顶'),COLORGREEN; DRAWTEXT(ISLASTBAR,底,'底'),COLORRED; DRAWTEXT(ISLASTBAR,中,'中'),COLORWHITE; {上出下买+三背}A:=MA(CLOSE,17)+ABS(MA(CLOSE,17)-REF(M A(CLOSE,17),1));B:=MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CL OSE,17),1);分水岭:IF(MA(CLOSE,17)<B,B,MA(CLOSE,17)),COLO RFF00FF;操作线:分水岭-(EMA(C,3)-分水岭),COLOR00FFFF; PM:MA(C,5),COLORWHITE;IF(PM> REF(PM,1),PM,DRAWNULL),COLORRED; IF(PM=REF(PM,1),PM,DRAWNULL),COLORRED;IF(PM<REF(PM,1),PM,DRAWNULL),COLORFF990 0;S:=(PM> 操作线);DD11:=分水岭<REF(分水岭,1);IF(DD11,分水岭,DRAWNULL),COLOR00FF00;IF(S,分水岭,DRAWNULL),COLOR00FF00; DRAWICON(CROSS(分水岭,操作线),分水岭-0.1,1);{买入红箭头}A1:=BARSLAST(REF(CROSS("MACD.DIF","MAC D.DEA"),1));B1:=REF(C,A1+1)> C ANDREF("MACD.DIF",A1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA"); DRAWTEXT(B1> 0,L-0.02,'MACD底背离'),COLOR00FFFF;{MACD底背离}A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1 ));B2:=REF(C,A2+1)> C ANDREF("KDJ.K",A2+1)<"KDJ.K" ANDCROSS("KDJ.K","KDJ.D");DRAWTEXT(B2,L-0.10,'KDJ底背离'),COLORFF00FF;{KDJ底背离}A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.R SI2"),1));B3:=REF(C,A3+1)> C ANDREF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");DRAWTEXT(B3> 0,L-0.18,'RSI底背离'),COLOR0000FF;{RSI底背离}C1:=BARSLAST(REF(CROSS("MACD.DEA","MAC D.DIF"),1));D1:=REF(C,C1+1)<C ANDREF("MACD.DIF",C1+1)> "MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF"); DRAWTEXT(D1> 0,H+0.16,'MACD顶背离'),COLOR00FF00;{MACD顶背离}C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1 ));D2:=REF(C,C2+1)<C AND REF("KDJ.K",C2+1)> "KDJ.K" AND CROSS("KDJ.D","KDJ.K");DRAWTEXT(D2> 0,H+0.08,'KDJ顶背离'),COLORFFFFCC;{KDJ顶背离}C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.R SI1"),1));D3:=REF(C,C3+1)<C ANDREF("RSI.RSI1",C3+1)> "RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1"); DRAWTEXT(D3> 0,H+0.04,'RSI顶背离'),COLORFF9900;{RSI顶背离};。
通达信MACD顶底背离副图指标公式源码
通达信MACD顶底背离副图指标公式源码
{MACD顶底背离}
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),COLORSTICK;
B3:=REF(C,A3+1)>C AND REF('RSI.RSI1'(6,12,24),A3+1)<'RSI.RSI1'(6,12,24) ANDCROSS('RSI.RSI1'(6,12,24),'RSI.RSI2'(6,12,24));
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;
STICKLINE(D1>0,0பைடு நூலகம்1,0,2,0),COLOR00FF00;
STICKLINE(D2>0,0.1,0,2,0),COLORFFCC66;
STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;
KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;
RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;
STICKLINE(B1>0,-0.1,0,2,0),COLORRED;
STICKLINE(B2>0,-0.1,0,2,0),COLORFF00FF;
MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;
顶底分型公式
顶底分型公式顶底分型公式是一种技术分析工具,广泛应用于股票、期货、外汇等金融市场。
它用于判断股票价格或交易品种的趋势转折点,帮助投资者做出买入或卖出的决策。
顶底分型公式通过观察价格走势形成的顶部和底部形态来预测未来价格的走势。
顶底分型公式的基本原理是,市场价格在上升和下降过程中会形成一些明显的高点和低点。
在上升趋势中,市场会出现一系列连续的高点,而在下降趋势中会出现一系列连续的低点。
这些高点和低点形成的形态被称为顶底分型。
顶底分型公式的核心思想是,当市场价格形成连续的高点时,意味着买盘逐渐减少,卖盘逐渐增多,市场开始出现卖压,上升趋势可能即将结束;当市场价格形成连续的低点时,意味着卖盘逐渐减少,买盘逐渐增多,市场开始出现买压,下降趋势可能即将结束。
顶底分型公式的具体判断方法是,观察价格走势形成的顶部和底部形态。
在上升趋势中,如果当前的高点比前一个高点低,形成了一个“M”形的顶部形态,这时就可以判断市场可能即将反转为下降趋势。
在下降趋势中,如果当前的低点比前一个低点高,形成了一个“W”形的底部形态,这时就可以判断市场可能即将反转为上升趋势。
顶底分型公式的应用需要结合其他技术分析工具和市场条件进行综合判断。
例如,可以结合均线、成交量等指标来确认顶底分型的有效性。
同时,还需要考虑市场的整体趋势以及其他重要的影响因素,避免单纯依靠顶底分型公式进行交易决策。
顶底分型公式在实际应用中有一定的局限性。
首先,顶底分型公式只能判断趋势的转折点,不能精确预测价格的具体走势。
其次,顶底分型公式对于市场的短期波动和噪音有一定的容忍度,需要结合其他指标进行确认。
此外,顶底分型公式也可能受到市场操纵和异常行为的干扰。
总结起来,顶底分型公式是一种常用的技术分析工具,通过观察价格走势形成的顶部和底部形态来预测未来价格的走势。
它可以辅助投资者进行买卖决策,但需要结合其他指标和市场条件进行综合判断。
在应用顶底分型公式时,投资者应保持谨慎,并结合自身的风险承受能力和投资目标进行决策。
顶底分型背离公式
顶底分型背离公式MA1:MA(C,5);MA2:MA(C,10);MA3:MA(C,30);A1:=BARSLAST(REF(CROSS("MACD.DIF"(12,26,9),"MACD.DE A"(12,26,9)),1));B1:=REF(C,A1+1)>C AND REF("MACD.DIF"(12,26,9),A1+1)<"MACD.DIF"(12,26,9) AND CROSS("MACD.DIF"(12,26,9),"MACD.DEA"(12,26,9));底背离MACD:DRAWTEXT(FILTER(B1>0,5),LOW,'1'),COLORYELLOW;DRAWTEXT(FILTER(B1>0,5),LOW*0.98,'MACD底背离'),COLOR00FF00;A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));底背离KDJ:DRAWTEXT(FILTER(B2>0,5),LOW,'▲'),COLORYELLOW;DRAWTEXT(FILTER(B2>0,5),LOW*0.98,'KDJ底背离'),COLORRED;A3:=BARSLAST(REF(CROSS("RSI.RSI1"(8,55,55),"RSI.RSI2"(8, 55,55)),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(8,55,55),A3+1)<"RSI.RSI1"(8,55,55) AND CROSS("RSI.RSI1"(8,55,55),"RSI.RSI2"(8,55,55));底背离RSI:DRAWTEXT(FILTER(B3>0,5),LOW,'▲'),COLORYELLOW;DRAWTEXT(FILTER(B3>0,5),LOW*0.98,'RSI底背离'),COLORF0F000;A4:=BARSLAST(REF(CROSS("DMI.PDI"(14,6),"DMI.MDI"(14,6 )),1));B4:=REF(C,A4+1)>C AND REF("DMI.PDI"(14,6),A4+1)<"DMI.PDI"(14,6) AND CROSS("DMI.PDI"(14,6),"DMI.MDI"(14,6));底背离DMI:DRAWTEXT(FILTER(B4>0,5),LOW,'▲'),COLORYELLOW;DRAWTEXT(FILTER(B4>0,5),LOW*0.98,'DMI底背离'),COLORF00FF0;C1:=BARSLAST(REF(CROSS("MACD.DEA"(12,26,9),"MACD.DI F"(12,26,9)),1));D1:=REF(C,C1+1)"MACD.DIF"(12,26,9) AND CROSS("MACD.DEA"(12,26,9),"MACD.DIF"(12,26,9));顶背离MACD:DRAWTEXT(FILTER(D1>0,5),HIGH*1.02,'▲'),COLOR00FF0 0;DRAWTEXT(FILTER(D1>0,5),HIGH*1.04,'MACD顶背离'),COLORRED;C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));D2:=REF(C,C2+1)"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));顶背离KDJ:DRAWTEXT(FILTER(D2>0,5),HIGH*1.02,'▲'),COLOR00FF00;DRAWTEXT(FILTER(D2>0,5),HIGH*1.04,'KDJ顶背离'),COLORF00FF0;C3:=BARSLAST(REF(CROSS("RSI.RSI2"(8,55,55),"RSI.RSI1"(8, 55,55)),1));D3:=REF(C,C3+1)"RSI.RSI1"(8,55,55) AND CROSS("RSI.RSI2"(8,55,55),"RSI.RSI1"(8,55,55));顶背离RSI:DRAWTEXT(FILTER(D3>0,5),HIGH*1.02,'▲'),COLOR00FF00;DRAWTEXT(FILTER(D3>0,5),HIGH*1.04,'RSI顶背离'),COLORYELLOW;C4:=BARSLAST(REF(CROSS("DMI.MDI"(14,6),"DMI.PDI"(14,6 )),1));D4:=REF(C,C4+1)"DMI.PDI"(14,6) AND CROSS("DMI.MDI"(14,6),"DMI.PDI"(14,6));顶背离DMI:DRAWTEXT(FILTER(D4>0,5),HIGH*1.02,'▲'),COLOR00FF00;DRAWTEXT(FILTER(D4>0,5),HIGH*1.04,'DMI顶背离'),COLORF0F000;。
各种指标背离公式
各种指标背离公式CCI顶底背离{参数n 1 100 14}TYP:=(HIGH LOW CLOSE)/3; CCI:(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N));RSI1:=CCI;AA:=REF(RSI1,N)=HHV(RSI1,2*N 1);BB:=BACKSET(AA,N 1);CC:=FILTER(BB,N) AND RSI1=HHV(RSI1,N 1);A1:=BARSLAST(REF(CC,1));顶背离:=REF(CLOSE,A1 1)RSI1 AND CC; DRAWLINE(CC,RSI1,FILTER(顶背离>0,5),RSI1,0),COLORGREEN,LINETHICK2;AA2:=REF(RSI1,N)=LLV(RSI1,2*N 1);BB2:=BACKSET(AA2,N 1);CC2:=FILTER(BB2,N) AND RSI1=LLV(RSI1,N 1);A2:=BARSLAST(REF(CC2,1));底背离:=REF(CLOSE,A2 1)>CLOSE AND REF(RSI1,A2 1)0,5),RSI1,0),COLORMAGENTA,LINETHICK2;CCI买卖点(通达信)N:=14;M:=210;TYP:=(HIGH LOW CLOSE)/3;CCI:(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N));TYP15:=(HHV(HIGH,15) LLV(LOW,15) CLOSE)/3;CCI15:(TYP15-MA(TYP15,M))/(0.015*AVEDEV(TYP15,M) ),COLORRED;AA:=REF(CCI,3)=HHV(CCI,2*3 1);BB:=BACKSET(AA,3 1);CC:=FILTER(BB,3) AND CCI=HHV(CCI,3 1);A1:=BARSLAST(REF(CC,1));顶背离:=REF(CLOSE,A1 1)CCI AND CC;DRAWLINE(CC,CCI,FILTER(顶背离>0,5),CCI,0),COLORRED,LINETHICK3;AA2:=REF(CCI,3)=LLV(CCI,2*3 1);BB2:=BACKSET(AA2,3 1);CC2:=FILTER(BB2,3) AND CCI=LLV(CCI,3 1);AA2A:=BARSLAST(REF(CC2,1));底背离:=REF(C,AA2A 1)>CLOSE AND REF(CCI,AA2A 1)0,5),CCI,0),COLORRED,LINETHICK4;-100;0;100;用法提示:1)选好股票;2)用1分钟K线图;3)按照CCI指标的用法,15分钟线看走势、看范围(-100至100为正常区,>100为强势区,100的强势区,1'在正常区,有一定效益.点,看1'线和15'线的位置,不看上穿-100或100线时,因为此处不是买点!卖点的掌握:1) 15'线和1'线都在CCI>100的强势区;2) 卖点应以15'线的顶拐点为准,1'线的顶拐点有时与15'线的顶拐点谐振而同时出现,大多是先于15'线出现,但此处不是卖点,须等15'线拐点出现才是卖点;DMI(通达信)TR:=SMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOS E,1))),ABS(LOW-REF(CLOSE,1))),N,1);HD:=HIGH-REF(H IGH,1);LD:=REF(LOW,1)-LOW;DMP:=SMA(IF(HD>0 AND HD>LD,HD,0),N,1);DMM:=SMA(IF(LD>0 ANDLD>HD,LD,0),N,1);PDI:DMP*100/TR,COLORRED;MDI:D MM*100/TR,COLORGREEN;ADX:SMA(ABS(MDI-PDI)/(M DI PDI)*100,N,1),COLORYELLOW;16;30; 其中参数N 取默认值14, N 2 100 14。
均线无敌公式顶底背离信号公式均线支撑公式
均线无敌公式顶底背离信号公式均线支撑公式MA5 :MA(CLOSE5);MA10:MA(CLOSE10);MA20:MA(CLOSE20);MA30:MA(CLOSE30);MA60:MA(CLOSE60);MA120:MA(CLOSE120);Z1:=STRCAT(HYBLOCK' ');Z2:=STRCAT(Z1DYBLOCK);Z3:=STRCAT(Z2' ');{-------黄托底买进,洋红压顶卖出。
-------}VAR1:=(CLOSE>REF(CLOSE1) AND CLOSE>REF(CLOSE2));VAR2:=(REF(VAR11) AND CLOSE<=REF(CLOSE1) AND CLOSE>=REF(CLOSE2));VAR3:=(REF(VAR21) AND CLOSE>=REF(CLOSE1) AND CLOSE<=REF(CLOSE2));VAR4:=(REF(VAR31) AND CLOSE<=REF(CLOSE1) AND CLOSE>=REF(CLOSE2));VAR5:=(REF(VAR41) AND CLOSE>=REF(CLOSE1) AND CLOSE<=REF(CLOSE2));VAR6:=(REF(VAR51) AND CLOSE<=REF(CLOSE1) AND CLOSE>=REF(CLOSE2));VAR7:=(REF(VAR61) AND CLOSE>=REF(CLOSE1) AND CLOSE<=REF(CLOSE2));VAR8:=(REF(VAR71) AND CLOSE<=REF(CLOSE1) AND CLOSE>=REF(CLOSE2));VAR9:=(REF(VAR81) AND CLOSE>=REF(CLOSE1) AND CLOSE<=REF(CLOSE2)); VARA:=(REF(VAR91) AND CLOSE<=REF(CLOSE1) AND CLOSE>=REF(CLOSE2));VARB:=(REF(VARA1) AND CLOSE>=REF(CLOSE1) AND CLOSE<=REF(CLOSE2)); VARC:=(REF(VARB1) AND CLOSE<=REF(CLOSE1) AND CLOSE>=REF(CLOSE2)); VARD:=(CLOSE<ref(close2));<="" p="">VARE:=(REF(VARD1) AND CLOSE>=REF(CLOSE1) AND CLOSE<=REF(CLOSE2)); VARF:=(REF(VARE1) AND CLOSE<=REF(CLOSE1) AND CLOSE>=REF(CLOSE2));VAR1A:=((REF(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR VAR8 OR VAR9 OR VARA OR VARB OR VARC1)) AND VARD);VAR10:=(REF(VARF1) AND CLOSE>=REF(CLOSE1) AND CLOSE<=REF(CLOSE2));VAR11:=(REF(VAR101) AND CLOSE<=REF(CLOSE1) AND CLOSE>=REF(CLOSE2));VAR12:=(REF(VAR111) AND CLOSE>=REF(CLOSE1) AND CLOSE<=REF(CLOSE2));VAR13:=(REF(VAR121) AND CLOSE<=REF(CLOSE1) AND CLOSE>=REF(CLOSE2));VAR14:=(REF(VAR131) AND CLOSE>=REF(CLOSE1) AND CLOSE<=REF(CLOSE2));VAR15:=(REF(VAR141) AND CLOSE<=REF(CLOSE1) AND CLOSE>=REF(CLOSE2));VAR16:=(REF(VAR151) AND CLOSE>=REF(CLOSE1) AND CLOSE<=REF(CLOSE2));VAR17:=(REF(VAR161) AND CLOSE<=REF(CLOSE1) AND CLOSE>=REF(CLOSE2));VAR18:=(REF(VAR171) AND CLOSE>=REF(CLOSE1) AND CLOSE<=REF(CLOSE2));VAR19:=((REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17OR VAR181)) AND VAR1);CO:=(C-O);洋红离场:=VAR1ACOLORMAGENTANODRAW;STICKLINE(洋红离场OO+CO/330)COLORFF0033;STICKLINE(洋红离场OO+CO/32.40)COLORFF0066;STICKLINE(洋红离场OO+CO/31.80)COLORFF0099;STICKLINE(洋红离场OO+CO/320)COLORFF00CC;STICKLINE(洋红离场OO+CO/30.80)COLORFF00FF;黄色低买:=VAR19COLOR33AACCNODRAW;STICKLINE(黄色低买OO+CO/330)COLOR3335FF;STICKLINE(黄色低买OO+CO/32.60)COLOR0064FF;STICKLINE(黄色低买OO+CO/31.50)COLOR0093FF;STICKLINE(黄色低买OO+CO/31.20)COLOR00C2FF;STICKLINE(黄色低买OO+CO/30.50)COLOR00FFFF;{涨跌停显示III}STICKLINE(CLOSE>REF(CLOSE1)*1.0985 ANDCLOSE=HIGHCLOSEOPEN3.20)COLOR0099FF;STICKLINE(CLOSE<="" p="">CLOSE=LOWCLOSEOPEN3.20)COLORGREEN;{=========短均线>长均线\\变色========}IF(MA5>=REF(MA51) AND MA5>=MA10MA5DRAWNULL)COLORMAGENTALINETHICK1;IF(MA10>=REF(MA101) AND MA10>=MA20MA10DRAWNULL)COLOR990066LINETHICK2;IF(MA20>=REF(MA201) ANDMA20>=MA30MA20DRAWNULL)COLOR3333CCLINETHICK 2;IF(MA5<=REF(MA51) AND MA5<=MA10MA5DRAWNULL)COLORDDDDDDLINETHICK1;IF(MA30>=REF(MA301) AND MA30>=MA30 ANDC>MA30MA30DRAWNULL)COLOR00CCFFLINETHICK3;散户:=EMA((VAR2-VAR4)/(VAR5-VAR4)*1004)*VAR3;庄家:=EMA(0.667*REF(散户1)+0.333*散户2)*VAR3;DRAWTEXT(CROSS(散户庄家) AND 散户<30L-0.05'←低吸')COLORLIRED;DRAWTEXT(CROSS(庄家散户) AND 散户>70H+0.05'←高抛')COLORGREEN;DRAWICON(CROSS(散户庄家) AND 散户<30L-0.051);DRAWICON(CROSS(庄家散户) AND 散户>70H+0.052);卖出:=IF(VARA>0 AND CROSS(VARCVARA)90100);DRAWICON(卖出<0H+0.0515); 买线:=EMA(CLOSE2);卖线:=EMA(SLOPE(CLOSE21)*20+CLOSE42);B1:IF(CROSS(买线卖线)L-0.02DRAWNULL)CROSSDOTLINETHICK3COLORMAGENTA;S1:IF(CROSS(80RSI)*30H+0.02DRAWNULL)CROSSDOTLINET HICK3COLORYELLOW; VC:=((CLOSE-MA(CLOSE6))/MA(CLOSE6)*100+(CLOSE-MA(CLOSE24))/MA(CLOSE24)*100+(CLOSE-MA (CLOSE32))/MA(CLOSE32)*100)/3;S2:=IF(VC>20 AND FILTER(VC<REF(VC1)5)H+0.02DRAWNULL)CIRCLEDOTLINETHICK3COLO RGREEN;A0:=(L+H+C*2)/4;A1:EMA(A013)COLORBLUELINETHICK2;A2:=EMA(A024)COLORLIBLUELINETHICK2;A1X:=(A1-REF(A11))/REF(A11)*100NODRAW;A2X:=(A2-REF(A21))/REF(A21)*100NODRAW;看多:IF(A1X>=0 ANDBARSLAST(CROSS(A1X0))>0REF((C+O)/2BARSLAST(CROSS( A1X0)))DRAWNULL)COLO RMAGENTA{LINETHICK2};逃顶:IF(A1X<0 ANDBARSLAST(CROSS(0A1X))>0REF((C+O)/2BARSLAST(CROSS( 0A1X)))DRAWNULL)COLO RCYAN{LINETHICK2};买入持股:IF(A1X>=0A1DRAWNULL)COLORREDLINETHICK3;卖出空仓:IF(A1X<0 AND A2X<0A1DRAWNULL)COLORGREENLINETHICK3;空:=EMA(C5);均衡:=EMA(空5)COLORWHITE;中轨:=HHV(MA(H13)13)COLORYELLOWLINETHICK1;趋势:=LLV(MA(H13)1)COLORREDLINETHICK1;VARAZ:=(CLOSE-REF(OPEN29))/REF(OPEN29)*100;VARBZ:=EMA(0.667*REF(VARAZ1)+0.333*VARAZ5);VARCZ:=SMA(MAX(CLOSE-REF(C1)0)61)/SMA(ABS(CLOSE-REF(C1))61)*100;VAR1Z:=(HIGH+LOW+OPEN+2*CLOSE)/5;VAR2Z:=REF(VAR1Z1);VAR3Z:=SMA(MAX(VAR1Z-VAR2Z0)101)/SMA(ABS(VAR1Z-VAR2Z)101)*100;VAR4Z:=FILTER(IF(COUNT(VAR3Z<205)>=1 AND COUNT(VAR1Z=LLV(VAR1Z10)10)>=1 ANDCLOSE>=OPEN*1.038 AND VOL>MA(VOL5)*1.210)5);DRAWICON(VAR4ZLOW25);VAR5Z:=FILTER(均衡>REF(均衡1)AND 中轨REF(C1)11); DRAWTEXT(VAR5ZLOW*0.985'进')COLORYELLOW;DRAWTEXT(VAR5ZLOW*0.995'^' )COLORYELLOW;{买}VARMACD1:=3;VARMACD3:=(3)*(SMA(((CLOSE - LLV(LOW27))/(HHV(HIGH27) - LLV(LOW27)))*(100)51)) - (2)* (SMA(SMA(((CLOSE - LLV(LOW27))/(HHV(HIGH27) -LLV(LOW27)))*(100)51)31));DRAWICON(CROSS(VARMACD3VARMACD1)L*0.9525);ZA1:=C*2-REF(C8.5/2);ZA2:=REF(C19/3)*2-C;短期对称:=(ZA1+ZA2)/2;关键点:=HHV(短期对称27/2);M1:=L*2-REF(H27/2);M2:=REF(H27/2)*2-L;M3:=(M1+M2)/2;中期对称:=FORCAST(M321);趋势判断:=MA(M327*2)COLOR0000FFNODRAW;ZA5:=趋势判断-REF(趋势判断1);{通达信版}IF(ZA5<0趋势判断DRAWNULL)COLOR00FF00POINTDOTLINETHICK4;IF(ZA5>0趋势判断DRAWNULL)COLOR0000FFPOINTDOTLINETHICK4;IF(ZA5=0趋势判断DRAWNULL)COLOR00FFFFPOINTDOTLINETHICK4;TOWERC:=FORCAST(EMA((3*CLOSE+2*OPEN+HIGH+LOW) /73)6); DIRECTIONMAX:=MAX(REF(TOWERC1)REF(TOWERC1));DIRECTIONMIN:=MIN(REF(TOWERC1)REF(TOWERC1));HV:=HHV(V5)=V OR V/REF(V1)>=5;FT:=BARSLAST(HV);量能平台:=IF(HVCREF(CFT));DRAWTEXT(量能平台>REF(量能平台1)AND CREF(C1)L'*缩量涨')COLORYELLOW; DRAWTEXT(量能平台>REF(量能平台1) AND C>REF(C1) AND C>MA(C13) ANDC=HHV(C20) AND C/REF(C1)>1.05L'*突破量')COLORMAGENTA;拉升线:IF(CURRBARSCOUNT=1 AND REF(C1)REF(C1) ANDMA5>REF(MA51)CONST(REF(C1)*1.01)DRAWNULL)COLORY ELLOW;V1:STICKLINE(CURRBARSCOUNT=1 AND C>=REF(C1)拉升线拉升线*0.998200)COLORYELLOW;DRAWTEXT(CURRBARSCOUNT=1 AND 拉升线=CONST(REF(C1)*1.01)L*0.99'上穿此线介入')COLORYELLOW;DRAWKLINE(H拉升线LC);{顶底背离}LC:=REF(CLOSE1);RSI:=((SMA(MAX((CLOSE - LC)0)31) / SMA(ABS((CLOSE - LC))31)) * 100);FF:=EMA(CLOSE3);MA15:=EMA(CLOSE21);DRAWTEXT(CROSS(FFMA15)(LOW * 0.99)'底背离')COLORFF8000;{DRAWICON(CROSS(FFMA15)(LOW * 0.99)7); }{顶背离}RSI1:=((SMA(MAX((CLOSE - (REF(CLOSE1)))0)31) / SMA(ABS((CLOSE -(REF(CLOSE1))))31))* 100);DRAWTEXT(CROSS(88RSI1) AND (MA(C3))>(EMA(C3)) (HIGH + 0.3)'顶背离')COLORGREEN;{DRAWICON(CROSS(88RSI1) AND (MA(C3))>(EMA(C3)) (HIGH + 0.3)8); };DRAWTEXT(REF(CBARSLAST(REF(CROSS("MACD.DIF""MAC D.DEA")1))+1)>C AND REF("MACD.DIF"BARSLAST(REF(CROSS("MACD.DIF""MACD.DEA")1))+1) <"MACD.DIF" AND CROSS("MACD.DIF""MACD.DEA") >0L-0.02'MACD底背离')COLORFF8000;{MACD底背离}DRAWTEXT(REF(CBARSLAST(REF(CROSS("KDJ.K""KDJ.D")1)) +1)>C AND REF("KDJ.K"BARSLAST(REF(CROSS("KDJ.K""KDJ.D")1))+1)<"KDJ.K " AND CROSS("KDJ.K""KDJ.D")L-0.10'KDJ底背离')COLORBLUE;{KDJ底背离} DRAWTEXT(REF(CBARSLAST(REF(CROSS("RSI.RSI1""RSI.RSI2")1)) +1)>C AND REF("RSI.RSI1"BARSLAST(REF(CROSS("RSI.RSI1""RSI.RSI2")1))+1) <"RSI.RSI1" AND CROSS("RSI.RSI1""RSI.RSI2")>0L-0.18'RSI底背离');{RSI底背离};DRAWTEXT(REF(CBARSLAST(REF(CROSS("MACD.DEA""MAC D.DIF")1))+1)"MACD.DIF" AND CROSS("MACD.DEA""MACD.DIF")>0H+0.16'MACD顶背离')COLORGREEN;{MACD顶背离};DRAWTEXT(REF(CBARSLAST(REF(CROSS("KDJ.D""KDJ.K")1)) +1)<c< p="">ANDREF("KDJ.K"BARSLAST(REF(CROSS("KDJ.D""KDJ.K")1))+1) >"KDJ.K" AND CROSS("KDJ.D""KDJ.K")>0H+0.08'KDJ顶背离');{KDJ顶背离}; {涨跌提示}涨停:=IF((C-REF(C1))*100/REF(C1)>=(10-0.01*100/REF(C1))10);STICKLINE(涨停OPENCLOSE1.50)COLORYELLOW;跌停:=IF((REF(C1)-C)*100/REF(C1)>=(10-0.01*100/REF(C1))10);STICKLINE(跌停OPENCLOSE1.50)COLORWHITE;</c<>。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
顶背离DMI:DRAWTEXT(FILTER(D4>0,5),HIGH*1.02,'▲'),COLOR00FF00;
MA1:MA(C,5);
MA2:MA(C,10);
MA3:MA(C,30);
A1:=BARSLAST(REF(CROSS("MACD.DIF"(12,26,9),"MACD.DEA"(12,26,9)),1));
B1:=REF(C,A1+1)>C AND REF("MACD.DIF"(12,26,9),A1+1)<"MACD.DIF"(12,26,9) AND CROSS("MACD.DIF"(12,26,9),"MACD.DEA"(12,26,9));
DRAWTEXT(FILTER(B2>0,5),LOW*0.98,'KDJ底背离'),COLORRED;
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(8,55,55),"RSI.RSI2"(8,55,55)),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(8,55,55),A3+1)<"RSI.RSI1"(8,55,55) AND CROSS("RSI.RSI1"(8,55,55),"RSI.RSI2"(8,55,55));
DRAWTEXT(FILTER(D4>0,5),HIGH*1.04,'DMI顶背离'),COLORF0F000;
B4:=REF(C,A4+1)>C AND REF("DMI.PDI"(14,6),A4+1)<"DMI.PDI"(14,6) AND CROSS("DMI.PDI"(14,6),"DMI.MDI"(14,6));
底背离DMI:DRAWTEXT(FILTER(B4>0,5),LOW,'▲'),COLORYELLOW;
顶背离MACD:DRAWTEXT(FILTER(D1>0,5),HIGH*1.02,'▲'),COLOR00FF00;
DRAWTEXT(FILTER(D1>0,5),HIGH*1.04,'MACD顶背离'),COLORRED;
C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
底背离KDJ:DRAWTEXT(FILTER(B2>0,5),LOW,'▲'),COLORYELLOW;
D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
顶背离KDJ:DRAWTEXT(FILTER(D2>0,5),HIGH*1.02,'▲'),COLOR00FF00;
底背离RSI:DRAWTEXT(FILTER(B3>0,5),LOW,'▲'),COLORYELLOW;
DRAWTEXT(FILTER(B3>0,5),LOW*0.98,'RSI底背离'),COLORF0F000;
A4:=BARSLAST(REF(CROSS("DMI.PDI"(14,6),"DMI.MDI"(14,6)),1));
顶背离RSI:DRAWTEXT(FILTER(D3>0,5),HIGH*1.02,'▲'),COLOR00FF00;
DRAWTEXT(FILTER(D3>0,5),HIGH*1.04,'RSI顶背离'),COLORYELLOW;
C4:=BARSLAST(REF(CROSS("DMI.MDI"(14,6),"DMI.PDI"(14,6)),1));
底背离MACD:DRAWTEXT(FILTER(B1>0,5),LOW,'1'),COLORYELLOW;
DRAWTEXT(FILTER(B1>0,5),LOW*0.98,'MACD底背离'),COLOR00FF00;
A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
DRAWTEXT(FILTER(D2>0,5),HIGH*1.04,'KDJ顶背离'),COLORF00FF0;
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(8,55,55),"RSI.RSI1"(8,55,55)),1));
D3:=REF(C,C3+1)<C REF("RSI.RSI1"(8,55,55),C3+1)>"RSI.RSI1"(8,55,55) AND CROSS("RSI.RSI2"(8,55,55),"RSI.RSI1"(8,55,55));
DRAWTEXT(FILTER(B4>0,5),LOW*0.98,'DMI底背离'),COLORF00FF0;
C1:=BARSLAST(REF(CROSS("MACD.DEA"(12,26,9),"MACD.DIF"(12,26,9)),1));
D1:=REF(C,C1+1)<C AND REF("MACD.DIF"(12,26,9),C1+1)>"MACD.DIF"(12,26,9) AND CROSS("MACD.DEA"(12,26,9),"MACD.DIF"(12,26,9));