您现在的位置:好股网 >> 股票公式 >> 通达信公式 >> 一键转帖:MACD底图 加几个背离指标组合而成

MACD底图 加几个背离指标组合而成


指标功能:[B]国产软件[/B]
指标类型:简体中文
所需积分:0
推荐星级:
授权方式:共享版
公式大小:0 Bytes
更新时间:2017-02-08 14:42:00
公式简介:

MACD底图 加几个背离指标组合而成


DIF:EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:2*(DIF-DEA),COLORSTICK;
TRR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
PDM:= SUM(IF(HD>0 AND HD>LD,HD,0),14);
MDM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);
PDI:= PDM*100/TRR;
MDI:= MDM*100/TRR;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIF,A1+1)<DIF AND CROSS(DIF,DEA);
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));
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
C1:=BARSLAST(REF(CROSS(DEA,DIF),1));
D1:=REF(C,C1+1)<C AND REF(DIF,C1+1)>DIF AND CROSS(DEA,DIF);
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));
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
C4:=BARSLAST(REF(CROSS(MDI,PDI),1));
D4:=REF(C,C+1)<C AND REF(MDI,C4+1)>MDI AND CROSS(MDI,PDI);
A4:=BARSLAST(REF(CROSS(PDI,MDI),1));
B4:=REF(C,A4+1)>C AND REF(PDI,A4+1)<PDI AND CROSS(PDI,MDI);
MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;
KDJ底背:IF(B2>0,-0.1,0),COLORFF00FF,POINTDOT;
RSI底背:IF(B3>0,-0.1,0),COLORYELLOW,POINTDOT;
DMI底背:IF(B4>0,-0.1,0),COLOR0099FF,POINTDOT;
MACD顶背:IF(D1>0,0.1,0),COLOR00FF00,POINTDOT;
KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;
RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;
DMI顶背:IF(D4>0,0.1,0),COLORBLUE,POINTDOT;
STICKLINE(B1>0,-0.03,0,1,0),COLORRED;
DRAWTEXT(B1>0,-0.03,'MACD底背'),COLORRED;
STICKLINE(B2>0,-0.06,0,1,0),COLORFF00FF;
DRAWTEXT(B2>0,-0.06,'KDJ底背'),COLORFF00FF;
STICKLINE(B3>0,-0.09,0,1,0),COLORYELLOW;
DRAWTEXT(B3>0,-0.09,'RSI底背'),COLORYELLOW;
STICKLINE(B4>0,-0.12,0,1,0),COLOR0099FF;
DRAWTEXT(B4>0,-0.12,'DMI底背'),COLOR0099FF;
STICKLINE(D1>0,0.04,0,0.5,0),COLOR00FF00;
DRAWTEXT(D1>0,0.03,'MACD顶背'),COLOR00FF00;
STICKLINE(D2>0,0.06,0,1,0),COLORFFCC66;
DRAWTEXT(D2>0,0.06,'KDJ顶背'),COLORFFCC66;
STICKLINE(D3>0,0.09,0,1,0),COLORWHITE;
DRAWTEXT(D3>0,0.09,'RSI顶背'),COLORWHITE;
STICKLINE(D4>0,0.12,0,1,0),COLORBLUE;
DRAWTEXT(D4>0,0.12,'DMI顶背'),COLORBLUE;

平空开多:=CROSS(MACD,0);
平多开空:=CROSS(0,MACD);
DRAWICON(平空开多,DIF,1);
DRAWICON(平多开空,DIF,2);
AUTOFILTER;


低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;
STICKLINE(低位金叉,0,0.12,4,0),COLORYELLOW;
DRAWTEXT(低位金叉,0.05,' 低位金叉'),COLORWHITE;
JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,30)=1;
STICKLINE(二次金叉,0,0.06,4,0),COLORFF00FF;
DRAWICON(二次金叉,DEA*0.9,1) ;
DRAWTEXT(二次金叉,0.1,' 二次金叉'),COLORYELLOW;
A8:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A8+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA) AND DEA<0;
STICKLINE(底背离,0,0.03,5,0),COLOR00FF00;

DRAWTEXT_FIX(1,0.04,0.1,0,'小心牛眼和熊眼'),COLORYELLOW;



[url=http://www.goodgupiao.com/gupiaogongshi/44172.html][B]MACD底图 加几个背离指标组合而成[/B][/url]