{周MACD柱线}
MACD周:=MACD.MACD#WEEK,NODRAW;
STICKLINE(MACD周>=0,0,MACD周,4.2,0),COLOR0080FF;
STICKLINE(MACD周>=0 AND MACD周STICKLINE(MACD周<0,0,MACD周,4.2,0),COLORLIBLUE;
STICKLINE(MACD周<0 AND MACD周>REF(MACD周,WEEKDAY),0,MACD周,4.2,0),COLOR0080FF;
{日MACD的柱线}
MACD2:=2*("MACD.DIF" - "MACD.DEA");
STICKLINE(MACD2>=0,0,MACD2,1.4,0),COLOR000096;
STICKLINE(MACD2>=0,0,MACD2,1.2,0),COLOR0000A5;
STICKLINE(MACD2>=0,0,MACD2,1.0,0),COLOR0000B4;
STICKLINE(MACD2>=0,0,MACD2,0.8,0),COLOR0000C3;
STICKLINE(MACD2>=0,0,MACD2,0.6,0),COLOR0000D2;
STICKLINE(MACD2>=0,0,MACD2,0.4,0),COLOR0000E1;
STICKLINE(MACD2>=0,0,MACD2,0.2,0),COLOR0000F0;
STICKLINE(MACD2>=0,0,MACD2,0.05,0),COLOR0000FF;
STICKLINE(MACD2>=0 AND MACD2STICKLINE(MACD2>=0 AND MACD2STICKLINE(MACD2>=0 AND MACD2STICKLINE(MACD2>=0 AND MACD2STICKLINE(MACD2>=0 AND MACD2STICKLINE(MACD2>=0 AND MACD2STICKLINE(MACD2>=0 AND MACD2STICKLINE(MACD2>=0 AND MACD2STICKLINE(MACD2<0,0,MACD2,1.4,0),COLOR009600;
STICKLINE(MACD2<0,0,MACD2,1.2,0),COLOR00A500;
STICKLINE(MACD2<0,0,MACD2,1.0,0),COLOR00B400;
STICKLINE(MACD2<0,0,MACD2,0.8,0),COLOR00C300;
STICKLINE(MACD2<0,0,MACD2,0.6,0),COLOR00D200;
STICKLINE(MACD2<0,0,MACD2,0.4,0),COLOR00E100;
STICKLINE(MACD2<0,0,MACD2,0.2,0),COLOR00F000;
STICKLINE(MACD2<0,0,MACD2,0.05,0),COLOR00FF00;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,1.4,0),COLOR000096;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,1.2,0),COLOR0000A5;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,1.0,0),COLOR0000B4;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,0.8,0),COLOR0000C3;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,0.6,0),COLOR0000D2;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,0.4,0),COLOR0000E1;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,0.2,0),COLOR0000F0;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,0.05,0),COLOR0000FF;
{周DIF,周DEA}
周DIF:MACD.DIF#WEEK,COLORGRAY,NODRAW;
周DEA:MACD.DEA#WEEK,COLORGRAY,NODRAW;
周金叉:=周DIF>周DEA;
周死叉:=周DIF<周DEA;
STICKLINE(周金叉,周DIF,周DEA,0,0),COLOR008080;
STICKLINE(周死叉,周DIF,周DEA,0,0),COLORBLUE;
{MACD周线的背离}
ZA1:=BARSLAST(REF(CROSS(周DIF,周DEA),1));
周底背离:=REF(CLOSE,ZA1+1)>CLOSE AND 周DIF>REF(周DIF,ZA1+1) AND CROSS(周DIF,周DEA);
ZA2:=BARSLAST(REF(CROSS(周DEA,周DIF),1));
周顶背离:=REF(CLOSE,ZA2+1)
DRAWTEXT(周底背离,周DIF*1.02,'周底背'),COLORWHITE;
DRAWTEXT(周顶背离,周DIF*1.02,'周顶背'),COLORGREEN;
{日线DIF和DEA}
DIF:EMA(CLOSE,12)-EMA(CLOSE,26)COLORLIMAGENTA,LINETHICK2;
DEA:EMA(DIF,9)COLORFF0080;
MACD:2*(DIF-DEA)COLORWHITE,NODRAW;
{MACD日线底背离}
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
DRAWTEXT(底背离,DIF*1,'日底背'),COLORWHITE;
{MACD日线顶背离}
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)
DRAWTEXT(顶背离,DIF*1,'日顶背'),COLORGREEN;
{MACD_KDJ的金叉共振}
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);
DRAWTEXT(A,DIF*1.5,'MACD_KDJ金叉共振'),COLORWHITE;
Copyright 2018- www.dyjian.com/ 大宇股票知识网 海口美兰韩哲棚百货商行 版权所有 琼ICP备2023001966号
免责声名:本站所发表的内容仅用于学术交流和学习,内容所带来的一切后果均与本站无关。若您发现本站存在您非授权的原创作品,请第一时间联系本站删除!