通达信macd,kdj日周月顶底背离源码副图

2015-10-31 22:44:00来源:本站整理浏览:824

{XXXXXX BY SHUHONG}

{}
DRAWGBK(C>0, RGB(36,36,36),RGB(36,36,36),0,'0',0);
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26),NODRAW;
DEA:=EMA(DIF,9),NODRAW;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
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);
STICKLINE(A,65,85,3,0),COLORYELLOW;
STICKLINE(A,20,40,3,0),COLORYELLOW;
DRAWICON(A,80,25);
DRAWICON(A,35,25);
DRAWTEXT(A,80,' ★macd_kdj金叉共振'),COLORYELLOW;
低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;
STICKLINE(低位金叉,95,105,3,0),COLORWHITE;
DRAWTEXT(低位金叉,100,' MACD低位金叉'),COLORWHITE;
JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,115,105,3,0),COLORYELLOW;
DRAWTEXT(二次金叉,110,' MACD二次金叉'),COLORYELLOW;
{}
{DIF:EMA(CLOSE,12) - EMA(CLOSE,26),LINETHICK0;}
{DEA:EMA(DIF,9),LINETHICK0;}
{MACD:2*(DIF-DEA);}
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));
STICKLINE(B1>0,85,95,3,0),COLORRED;
DRAWTEXT((B1>0),90,' MACD底背离'),COLORRED;
STICKLINE(D1>0,85,95,3,0),COLORFF8000;
DRAWTEXT((D1>0),90,' MACD顶背离'),COLORFF8000;
STICKLINE(B2>0,-10,0,3,0),COLOR8000FF;
DRAWTEXT((B2>0),-5,' KDJ底背离'),COLOR8000FF;
STICKLINE(D2>0,-10,0,3,0),COLORGREEN;
DRAWTEXT((D2>0),-5,' KDJ顶背离'),COLORGREEN;
STICKLINE(B3>0,-20,-10,3,0),COLORRED;
DRAWTEXT((B3>0),-16,' RSI底背离'),COLORRED;
STICKLINE(D3>0,-20,-10,3,0),COLORCYAN;
DRAWTEXT((D3>0),-16,' RSI顶背离'),COLORCYAN;
{}
日DIF:="MACD.DIF#DAY",NODRAW;
日DEA:="MACD.DEA#DAY",NODRAW;
日死叉:STICKLINE(日DIF<日DEA,70,75,3,0),COLORFF8000;
日金叉:STICKLINE(日DIF>日DEA,70,75,3,0),COLORRED;
DRAWTEXT(ISLASTBAR,72,'__日MACD'),COLORYELLOW;
周DIF:="MACD.DIF#WEEK"(12,26,9),NODRAW;
周DEA:="MACD.DEA#WEEK"(12,26,9),NODRAW;
周死叉:STICKLINE(周DIF<周DEA,60,65,3,0),COLORFF8064;
周金叉:STICKLINE(周DIF>周DEA,60,65,3,0),COLOR3232FF;
DRAWTEXT(ISLASTBAR,62,'__周MACD'),COLORYELLOW;
月DIF:="MACD.DIF#MONTH"(12,26,9),NODRAW;
月DEA:="MACD.DEA#MONTH"(12,26,9),NODRAW;
月死叉:STICKLINE(月DIF<月DEA,50,55,3,0),COLORFF808C;
月金叉:STICKLINE(月DIF>月DEA,50,55,3,0),COLOR5032FF;
DRAWTEXT(ISLASTBAR,52,'__月MACD'),COLORYELLOW;
{}
DIF日:="MACD.DIF",NODRAW;
DEA日:="MACD.DEA",NODRAW;
MACD日金叉:=IF(CROSS(DIF日,DEA日),20,0),NODRAW;
DIF周:="MACD.DIF#WEEK",NODRAW;
DEA周:="MACD.DEA#WEEK",NODRAW;
MACD周金叉:=IF(CROSS(DIF周,DEA周),40,0),NODRAW;
STICKLINE((MACD周金叉 AND MACD日金叉),75,85,3,0)COLORYELLOW;
DRAWTEXT((MACD周金叉 AND MACD日金叉),80,' ★MACD日周共振'),COLORYELLOW;
DRAWICON(MACD周金叉 AND MACD日金叉,80,25);
{}
N:=1;
日K:=KDJ.K,NODRAW;
日D:=KDJ.D,NODRAW;
日J:=KDJ.J,NODRAW;
周K:=KDJ.K#WEEK,NODRAW;
周D:=KDJ.D#WEEK,NODRAW;
周J:=KDJ.J#WEEK,NODRAW;
月K:=KDJ.K#MONTH,NODRAW;
月D:=KDJ.D#MONTH,NODRAW;
月J:=KDJ.J#MONTH,NODRAW;
K日金叉:=CROSS(日K,日D) AND (日D<40 OR 日D>60);
K周金叉:=CROSS(周K,周D) AND (周D<40 OR 周D>60);
K月金叉:=CROSS(月K,月D) AND (月D<40 OR 月D>60);
共振KDJ:=(K周金叉 AND K日金叉) OR (K周金叉 AND K月金叉) OR (K日金叉 AND K月金叉)OR (K日金叉 AND K周金叉 AND K月金叉);
STICKLINE(共振KDJ,0,40,3,0),COLORMAGENTA;{柱}
DRAWICON(共振KDJ,35,24);{图标}
DRAWTEXT((K周金叉 AND K日金叉) OR (K周金叉 AND K月金叉) OR (K日金叉 AND K月金叉)OR (K日金叉 AND K周金叉 AND K月金叉),
35,' ★KDJ(日/周/月)共振'),COLORMAGENTA;{字}
NOTEXT月K:=IF(N=3,月K,DRAWNULL),COLORWHITE,NODRAW;

[1] [2]  下一页

股票公式栏目导航

精品指标推荐

最新热门

本类随机推荐

相关公式