通达信指标公式源码超级无敌MACD

合集下载

MACD逃顶抄底必备通达信指标公式源码

MACD逃顶抄底必备通达信指标公式源码

最有实战价值的macd指标结合kdj 。

在指标发出命令当日或者第二日操作,可以轻松实现逃顶抄底。

N1:=5;N2:=10;LC:=REF(CLOSE,1);A0:=(2*C+H+L)/4;均线:=MA(A0,3)>REF(MA(A0,3),1);安全线:2,COLORLIGRAY,POINTDOT,LINETHICK4;A1:=(CLOSE-LLV(LOW,7))/(HHV(HIGH,7)-LLV(LOW,7))*10;K:MA(3*SMA(A1,6,1)-2*SMA(SMA(A1,5,1),5,1),3),LINETHICK1,COLORF00FF0;D:MA(K,3),COLORFF0000,LINETHICK1;J:3*K-2*D,LINETHICK1,COLORF00FF0;DRAWBAND(K,RGB(155,50,50),D,RGB(0,100,50));VAR1:=C-REF(C,1);VAR2:=100*EMA(EMA(VAR1,6),6)/EMA(EMA(ABS(VAR1),6),6);MA5:=EMA(C,5);MA13:=EMA(C,13);UP:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(MA13,MA5))+1),LLV(L,BARSLAST(CROSS(MA13,MA5))+1),H=HHV(H,BARSLAST(CROSS(MA5,MA13))+1),HHV(H,BARSLAST(CROSS(MA5,MA13))+1),0),COLOR0000FF;DOWN:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(MA5,MA13))+1),HHV(H,BARSLAST(CR OSS(MA5,MA13))+1),L=LLV(L,BARSLAST(CROSS(MA13,MA5))+1),LLV(L,BARSLAST(CROSS (MA13,MA5))+1),0),COLOR00FF00;BT:=(LLV(VAR2,2)=LLV(VAR2,7) AND COUNT(VAR2<0,2) ANDCROSS(VAR2,MA(VAR2,2))) ANDREF(DOWN,1)<REF(DOWN,2) AND UP>REF(DOWN,1);底线:0,COLORFF00FF;顶线:10,COLORFF0000;STICKLINE(UP,0,0.2,3,0),COLOR0000FF;STICKLINE(DOWN,0,0.2,3,0),COLOR00FF00;STICKLINE(BT,0,3,2,0),COLOR000088;STICKLINE(BT,0,3,1,0),COLOR0000CC;STICKLINE(BT,0,3,0.22,0),COLOR0000FF;DRAWTEXT(BT,3,'短牛'),COLOR0000FF;{W }TJ1:=REF(DOWN,1)<REF(DOWN,2) AND UP>REF(DOWN,1) AND C<HHV(H,21)*0.82; STICKLINE(TJ1,0,2,3,0),COLOR880088;STICKLINE(TJ1,0,2,1.5,0),COLORAA00AA;STICKLINE(TJ1,0,2,0.8,0),COLORCC00CC;STICKLINE(TJ1,0,2,0.2,0),COLORFF00FF;DRAWTEXT(TJ1,2,'中牛'),COLORFF00FF;HR:=HHV(HIGH,55);HRY:=LLV(LOW,55);HRY11:=HR*HRY;HRY33:=SQRT(HRY11);TJ2:=REF(DOWN,1)<REF(DOWN,2) AND UP>REF(DOWN,1) AND C<HRY33; STICKLINE(TJ2,0,1,5,0),COLOR008888;STICKLINE(TJ2,0,1,2,0),COLOR00AAAA;STICKLINE(TJ2,0,1,1,0),COLOR00CCCC;STICKLINE(TJ2,0,1,0.2,0),COLOR00FFFF;DRAWTEXT(TJ2,1,'大牛'),COLOR00FFFF;ST:=REF(UP,1)>REF(UP,2) AND DOWN<REF(UP,1);STICKLINE(ST,10,9,5,0),COLOR008800;STICKLINE(ST,10,9,2,0),COLOR00AA00;STICKLINE(ST,10,9,1,0),COLOR00CC00;STICKLINE(ST,10,9,0.2,0),COLOR00FF00;DRAWTEXT(ST,9,'卖'),COLOR00FF00;DIFF:EMA(DCLOSE,12)-EMA(DCLOSE,26);DEA:EMA(DIFF,9),COLORFFFF00;A11:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A11+1)>CLOSE AND DIFF>REF(DIFF,A11+1) AND CROSS(DIFF,DEA);DRAWTEXT(底背离,-0.6,'底背离'),COLORWHITE;A22:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A22+1)<CLOSE AND REF(DIFF,A22+1)>DIFF AND CROSS(DEA,DIFF);DRAWTEXT(顶背离,9,'顶背离'),COLORWHITE;RSV2:=(CLOSE-LLV(LOW,45))/(HHV(HIGH,45)-LLV(LOW,45))*10;K周:=SMA(RSV2,15,1),COLORWHITE;D周:=SMA(K周,3,1),COLORYELLOW;J周:=3*K周-2*D周,COLORRED;DRAWBAND(J周,RGB(200,0,0),D周,RGB(0,150,150));DRAWICON(CROSS(K周, D周), D周-1,13);DRAWICON(CROSS(D周, K周), K周+1,14);。

通达信MACD趋势主图指标公式

通达信MACD趋势主图指标公式

通达信MACD趋势主图指标公式DRAWGBK(C>0, RGB(0,0,00),RGB(0,0,0),0,'W20',0);DRAWKLINE(H,O,L,C);QWX1:=HHV(CLOSE,30);QWX2:=LLV(CLOSE,30);QWX3:=CONST((QWX1+QWX2)/2);QWX4:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);QWX5:=CONST((1-7/100)*(DMA(CLOSE,QWX4)));QWX6:=CONST((1+7/100)*(DMA(CLOSE,QWX4)));{KDJ}RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;KX:=SMA(RSV,3,1);DX:=SMA(KX,3,1);JX:=3*KX-2*DX;{MACD}DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26))*2+QWX3,COLORWHITE;DEA:=EMA(DIF,9),COLORYELLOW;MACD:(DIF-DEA)*5+QWX3,COLORYELLOW,LINETHICK2;DRAWBAND(MACD,RGB(120,0,100),QWX3,RGB(60,100,50));DRAWKLINE(HIGH,OPEN,LOW,CLOSE);牛熊线:=(EMA(CLOSE,30)+EMA(CLOSE,72))/2,LINETHICK2,COLORRE D;M5:MA(CLOSE,5),COLORWHITE,DOTLINE;IF(MA(C,5)>=REF(MA(C,5),1),MA(C,5),DRAWNULL),COLORYE LLOW,LINETHICK3;M10:MA(CLOSE,10),COLORYELLOW,DOTLINE;IF(MA(C,10)>=REF(MA(C,10),1),MA(C,10),DRAWNULL),COLO R330099,LINETHICK2;M20:MA(CLOSE,20),COLORFF00FF;IF(MA(C,20)>=REF(MA(C,20),1),MA(C,20),DRAWNULL),COLO RLIMAGENTA,LINETHICK2;M60:MA(CLOSE,60),COLOR6699CC;IF(MA(C,60)>=REF(MA(C,60),1),MA(C,60),DRAWNULL),CIRCL EDOT,LINETHICK2;M120:MA(CLOSE,120),COLORLIBLUE,DOTLINE;M250:MA(CLOSE,250),COLORMAGENTA,DOTLINE;VAR1:=IF(CLOSE>OPEN,CLOSE,OPEN);VAR2:=MEMA(CLOSE,5);VAR3:=ATAN((VAR2/REF(VAR2,1)-1)*100);VAR4:=IF(VAR3>0,VAR3,VAR3);VAR5:=(CLOSE/REF(CLOSE,1)-1)*100;VAR6:=VAR5<1.5 AND VAR5>-1.5;今日之升★:LAST(VAR6,4,1) AND V AR5>2 AND VOL>REF(VOL,1),NODRAW,COLORYELLOW;DRAWTEXT(今日之升★,L/1.01,'★'),COLORYELLOW;强势:IF(VAR4>=REF(VAR4,1) AND VAR4>=0,M10,DRAWNULL),COLORRED,LINETHICK2;整理:IF(VAR4<REF(VAR4,1) AND VAR4>0,M10,DRAWNULL),COLORGREEN,LINETHICK2;支撑:IF(PERIOD=5,IF(BARSLAST(CURRBARSCOUNT=5),QWX5,DRA WNULL),DRAWNULL),COLORCYAN;阻力:IF(PERIOD=5,IF(BARSLAST(CURRBARSCOUNT=5),QWX6,DRA WNULL),DRAWNULL),COLORYELLOW;N:=120;K:=BARSLAST(CURRBARSCOUNT=N);GD:=CONST(IF(ISLASTBAR=1,HHV(H,K),0));{高点}DD:=CONST(IF(ISLASTBAR=1,LLV(L,K),0));{低点}KJ:=GD-DD;{高低点差值=分区高度}GD4:IF(CURRBARSCOUNT<=N/30,GD,DRAWNULL);底:IF(CURRBARSCOUNT<=N/30,DD,DRAWNULL),COLORFFF F00;高:IF(CURRBARSCOUNT<=N/30,GD,DRAWNULL),COLOR00F FFF;撑:IF(CURRBARSCOUNT<=N/30,DD+KJ*0.191,DRAWNULL), COLOR00FFFF;强: IF(CURRBARSCOUNT<=N/30,DD+KJ*0.382,DRAWNULL),COLOR FF00FF;突破:IF(CURRBARSCOUNT<=N/30,DD+KJ/2,DRAWNULL),COLOR0 000FF;警示:IF(CURRBARSCOUNT<=N/30,DD+KJ*0.618,DRAWNULL),COL OR00FFFF;压力:IF(CURRBARSCOUNT<=N/30,DD+KJ*0.809,DRAWNULL),COL OR00FF00;低涨:IF(CURRBARSCOUNT<=N/30,(C/LLV(LOW,K)-1)*100,DRAWNULL),COLOR0000FF,NODRAW;天数:BARSLAST(L=DD),COLORCYAN,NODRAW;今日保护价:(REF(C,2)+REF(C,1)+O)/3 ,COLORCC3299,NODRAW;顶点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,HHV(H,BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORRED, DOTLINE;低点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,LLV(L,BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORYELL OW,DOTLINE;STICKLINE(CCI>=200 AND H>=顶点,O,C,3,0),COLORBLUE;STICKLINE(CCI<=100 AND L<=低点,O,C,3,0),COLORYELLOW;DRAWBAND(高,RGB(200,200,0),压力,RGB(0,0,0));DRAWBAND(压力,RGB(0,190,0),警示,RGB(0,0,0));DRAWBAND(警示,RGB(220,120,0),突破,RGB(0,0,0));DRAWBAND(突破,RGB(120,0,120),强势,RGB(0,0,0));DRAWBAND(强势,RGB(120, 0,0),支撑,RGB(0,0,0));DRAWBAND(支撑,RGB(80,80,80),底,RGB(0,0,0));STICKLINE(CURRBARSCOUNT=N/30,GD,DD,0,0),COLORGRE EN;STICKLINE(CURRBARSCOUNT=1,GD,DD,0,0),COLORGREEN;STICKLINE(CURRBARSCOUNT<=N/30,支撑,支撑,4,0),COLORFF00FF;STICKLINE(CURRBARSCOUNT<=N/30,强势,强势,4,0),COLORFF00FF;STICKLINE(CURRBARSCOUNT<=N/30,突破,突破,4,0),COLORABABAB;STICKLINE(CURRBARSCOUNT<=N/30,警示,警示,4,0),COLOR00FFFF;STICKLINE(CURRBARSCOUNT<=N/30,压力,压力,4,0),COLOR00FFFF;DRAWTEXT(CURRBARSCOUNT=1,压力,'0.809'),COLOR00FFFF;DRAWTEXT(CURRBARSCOUNT=1,警示,'0.618'),COLOR00FFFF;DRAWTEXT(CURRBARSCOUNT=1,突破,'0.500'),COLORFFFFFF;DRAWTEXT(CURRBARSCOUNT=1,强势,'0.382'),COLOR00FFFF;DRAWTEXT(CURRBARSCOUNT=1,支撑,'0.191'),COLOR00FFFF;{柱型显示}STICKLINE(CLOSE>REF(CLOSE,1)*1.0985 AND CLOSE=HIGH,CLOSE,OPEN,4,-1),COLOR00FFFF;STICKLINE(CLOSE<REF(CLOSE,1)*0.9015 AND CLOSE=LOW,CLOSE,OPEN,4,-1),COLORGREEN;{蓝}STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,3,0),COLORFF7700;STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,2.2,0),COLORFF990 0;STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,1.5,0),COLORFFBB0 0;STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,0.5,0),COLORCYAN;{红}STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0),COLOR000099;STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2.2,0),COLOR0000CC;STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1.5,0),COLOR0000FF;STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0.5,0),COLORCC66FF;{绿}STICKLINE(CROSS(M5,EMA(C,3)),VAR1,(OPEN+CLOSE)/2,3,0) ,COLOR009900;STICKLINE(CROSS(M5,EMA(C,3)),VAR1,(OPEN+CLOSE)/2,2.2, 0),COLOR00BB00;STICKLINE(CROSS(M5,EMA(C,3)),VAR1,(OPEN+CLOSE)/2,1.5,0),COLOR00DD00;STICKLINE(CROSS(M5,EMA(C,3)),VAR1,(OPEN+CLOSE)/2,0.5, 0),COLOR00FF00;{灰}STICKLINE(CROSS(EMA(C,3),M5),OPEN,(OPEN+CLOSE)/2,3,0 ),COLOR999999;STICKLINE(CROSS(EMA(C,3),M5),OPEN,(OPEN+CLOSE)/2,2.2 ,0),COLORBBBBBB;STICKLINE(CROSS(EMA(C,3),M5),OPEN,(OPEN+CLOSE)/2,1.5 ,0),COLORDDDDDD;STICKLINE(CROSS(EMA(C,3),M5),OPEN,(OPEN+CLOSE)/2,0.5 ,0),COLORFFFFFF;STICKLINE(CROSS(JX,DX),OPEN,CLOSE,0.5,0),COLORYELLOW;STICKLINE(CROSS(DX,JX),OPEN,CLOSE,0.5,0),{COLOR000099 }COLORBLACK;超B:=L2_AMO(0,2)/10000.0;大B:=L2_AMO(1,2)/10000.0;中B:=L2_AMO(2,2)/10000.0;小B:=L2_AMO(3,2)/10000.0;超S:=L2_AMO(0,3)/10000.0;大S:=L2_AMO(1,3)/10000.0;中S:=L2_AMO(2,3)/10000.0;小S:=L2_AMO(3,3)/10000.0;TESTSKIP(NOT(超B OR 大B OR 中B OR 小B OR 超S OR 大S OR 中S OR 小S)!=0);大宗进:=(超B)+(大B),NODRAW;大宗出:=(超S)+(大S),NODRAW;非大宗进:=(中B)+(小B),NODRAW;非大宗出:=(中S)+(小S),NODRAW;大宗进限制:=IF((超B+大B)=0,0,大宗进);大宗出限制:=IF((超S+大S)=0,0,大宗出);非大宗进限制:=IF(中B+小B=0,0,非大宗进);非大宗出限制:=IF(中S+小S=0,0,非大宗出);主力净流入:=(超B+大B)-(超S+大S),COLORRED,NODRAW;散户净流入:=(中B+小B)-(中S+小S),COLORRED,NODRAW;净流入:=(超B+大B+中B+小B)-(超S+大S+中S+小S),COLORRED,NODRAW;大单流入:=(超B+大B)/(超B+大B+超S+大S)*100,NODRAW;大单流入限制:=IF((超B+大B+超S+大S)=0,0,大单流入);大单流出比:=(超S+大S)/(超B+大B+超S+大S)*100,NODRAW;大单流出限制:=IF((超B+大B+超S+大S)=0,0,大单流出比);总流入比:=(超B+大B+中B+小B)/(超B+大B+中B+小B+超S+大S+中S+小S)*100,NODRAW;总流出比:=(超S+大S+中S+小S)/(超B+大B+中B+小B+超S+大S+中S+小S)*100,NODRAW;成交总量:=(超B+大B+中B+小B+超S+大S+中S+小S),NODRAW;机构参与度:=(超B+超S+大B+大S)/成交总量*100,COLORYELLOW,NODRAW;大单强度:=(超B+大B-超S-大S)/成交总量*100,COLORYELLOW,NODRAW;大单强度限制:=IF(大单强度=0,-100,大单强度);大单强度比:=IF(大单强度>=0,(大单强度限制+100)/2,100-ABS((大单强度限制-100)/2)),NODRAW;超单强度:=(超B-超S)/(超B+超S)*100,COLORYELLOW,NODRAW;超单强度限制:=IF(超单强度=0,-100,超单强度);超单强度比:=IF(超单强度>0,(超单强度限制+100)/2,IF(超单强度<0,100-ABS((超单强度限制-100)/2),0)),NODRAW;DAZHIV:=CONST(MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出))))),NODRAW;DRAWRECTREL(0,CONST(950-(ABS(大宗进)*250/DAZHIV))-20,30,950,IF(CONST(大宗进>0),RGB(250,125,0),RGB(25,150,250)));DRAWRECTREL(32,CONST(950-(ABS(大宗出)*250/DAZHIV))-20,62,950,IF(CONST(大宗出>0),RGB(25,150,250),RGB(250,125,0)));DRAWRECTREL(102,CONST(950-(ABS(非大宗进)*250/DAZHIV))-20,132,950,IF(CONST(非大宗进>0),RGB(250,125,0),RGB(25,150,250)));DRAWRECTREL(134,CONST(950-(ABS(非大宗出)*250/DAZHIV))-20,164,950,IF(CONST(非大宗出>0),RGB(25,150,250),RGB(250,125,0)));DRAWRECTREL(204,CONST(950-(ABS(净流入)*250/DAZHIV))-20,234,950,IF(CONST(净流入>0),RGB(200,0,0),RGB(0,125,50)));DRAWTEXT_FIX(1,0.00,0.95,0,STRCAT(STRCAT('主力',CON2STR(主力净流入,0)),'万')),COLORMAGENTA;DRAWTEXT_FIX(1,0.10,0.95,0,STRCAT(STRCAT('散户',CON2STR(散户净流入,0)),'万')),COLORCYAN;DRAWTEXT_FIX(1,0.20,0.95,0,STRCAT(STRCAT('净流入',CON2STR(净流入,0)),'万')),COLORYELLOW;主买A:=ACTINVOL,COLORRED,NODRAW;主卖A:=ACTOUTVOL,COLORGREEN,NODRAW;主买:=主买A*100/(主买A+主卖A),NODRAW,COLORRED;主卖:=主卖A*100/(主买A+主卖A),NODRAW,COLORGREEN;大单买比:=LARGEINTRDVOL*100/(LARGEINTRDVOL+LARGEOUTTRDV OL);大单卖比:=LARGEOUTTRDVOL*100/(LARGEINTRDVOL+LARGEOUTTRD VOL);主力净买量:=(LARGEINTRDVOL-LARGEOUTTRDVOL),COLORYELLOW,NODRAW;主动买卖差:=(ACTINVOL-ACTOUTVOL),COLORMAGENTA,NODRAW;主力资金差:=((L2_AMO(0,0)+L2_AMO(1,0)-L2_AMO(0,1)-L2_AMO(1,1)))/10000,COLORCYAN,NODRAW;主力买力度:=LARGEINTRDVOL*100/VOL;主力卖力度:=LARGEOUTTRDVOL*100/VOL;主买力度比:=主力买力度/(主力买力度+主力卖力度)*100,NODRAW;主卖力度比:=主力卖力度/(主力买力度+主力卖力度)*100,NODRAW;力度比限制:=IF((LARGEINTRDVOL+LARGEOUTTRDVOL)=0,0,大单买比);JGV:=(L2_VOL(0,0) - L2_VOL(0,1))*VOL/100000000,COLORRED;DHV:=(L2_VOL(1,0) - L2_VOL(1,1))*VOL/100000000,COLORFF00FF;ZHV:=(L2_VOL(2,0) - L2_VOL(2,1))*VOL/100000000,COLOR00FFFF;SHV:=(L2_VOL(3,0) - L2_VOL(3,1))*VOL/100000000,COLORFFFFFF;NOTEXT大量动向:=MA((JGV+DHV),5),COLORYELLOW;超级大量:=JGV,COLOR0000FF,NODRAW;机构大量:=DHV,COLORMAGENTA,NODRAW;大量博弈:=(JGV+DHV),COLORYELLOW,NODRAW;小量博弈:=(ZHV+SHV),COLORWHITE,NODRAW;大量资金比:=大量博弈/(ABS(JGV)+ABS(DHV)+ABS(ZHV)+ABS(SHV))*100,COLORYELLO W,NODRAW;大量资金比限制:=IF(大量资金比=0,-100,大量资金比);大量强度比:=IF(大量资金比>0,(大量资金比限制+100)/2,IF(大量资金比<0,100-ABS((大量资金比限制-100)/2),0)),COLORGREEN,NODRAW;小量资金比:=小量博弈/(ABS(JGV)+ABS(DHV)+ABS(ZHV)+ABS(SHV))*100,COLORYELLO W,NODRAW;小量强度比:=IF(小量资金比>=0,(小量资金比+100)/2,100-ABS((小量资金比-100)/2)),COLORCYAN,NODRAW;MVR:=REF(MA(V,5),1);FVR:=REF(V,1);PVR:=(MVR+FVR)/2;量能比:=V/(V+PVR)*100/FROMOPEN*240;{量能饱和度}SAT:=(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20));【量能饱和】:=IF(SAT>1,1,SAT)*100,COLORYELLOW,NODRAW;{活跃度}LC:=REF(CLOSE,1);RSI5:=(SMA(MAX(CLOSE-LC,0),3,1))/(SMA(ABS(CLOSE-LC),3,1))*100;WR10:=(HHV(HIGH,3)-CLOSE)/(HHV(HIGH,3)-LLV(LOW,3))*100;活跃度:=(RSI5-WR10),COLORFFFF00,LINETHICK1,NODRAW;活跃度比:=IF(活跃度>=0,(活跃度+100)/2,100-ABS((活跃度-100)/2));DRAWRECTREL(80,0,240,40,RGB(0,75,200));DRAWRECTREL(80,0,160,40,RGB(0,250,50));DRAWRECTREL(80,0,80+CONST(力度比限制*160/100),40,RGB(200,0,50));DRAWTEXT_FIX(1,0.00,0.00,0,STRCAT(STRCAT('买卖力度比',CON2STR(大单买比,2)),'%买')),COLORYELLOW;DRAWTEXT_FIX(1,0.33,0.00,0,STRCAT(STRCAT('',CON2STR(大单卖比,2)),'%卖')),COLORGREEN;DRAWRECTREL(80,50,240,90,RGB(0,100,0));DRAWRECTREL(80,50,160,90,RGB(0,250,50));DRAWRECTREL(80,50,80+CONST(大量强度比*160/100),90,RGB(175,50,250));DRAWTEXT_FIX(1,0.00,0.05,0,STRCAT(STRCAT('大量强度比',CON2STR(大量强度比,2)),'%买')),COLORYELLOW;DRAWRECTREL(330,0,490,40,RGB(0,75,200));DRAWRECTREL(330,0,410,40,RGB(0,250,50));DRAWRECTREL(330,0,330+CONST(主买*160/100),40,RGB(175,50,250));DRAWTEXT_FIX(1,0.25,0.00,0,STRCAT(STRCAT('主动买卖比',CON2STR(主买,2)),' %')),COLORYELLOW;{DRAWTEXT_FIX(1,0.33,0.10,0,STRCAT(STRCAT('',CON2STR(主卖,2)),'%卖')),COLORGREEN;}DRAWRECTREL(330,50,490,90,RGB(0,100,0));DRAWRECTREL(330,50,410,90,RGB(0,250,50));。

无敌MACD通达信指标公式源码

无敌MACD通达信指标公式源码

无敌MACD 低位金叉二次金叉顶底背离上下提示箭头因为要画线所以有未来,但不会漂移DIFF1:=EMA(CLOSE,12)-EMA(CLOSE,27);DEA1:=EMA(DIFF1,9);MACD:=2*(DIFF1-DEA1),STICK;STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,3.2,0),COLORB20000; STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2.7,0),COLOREC0000; STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2.1,0),COLORFF4600; STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,1.5,0),COLORFF6300; STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,0.9,0),COLORFF8B00; STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,0.3,0),COLORFFAB00; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,3.2,0),COLOR000055; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2.7,0),COLOR000077; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2.1,0),COLOR000099; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,1.5,0),COLOR0000BB; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,0.9,0),COLOR0000DD; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,0.3,0),COLOR0000FF; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,3.2,0),COLOR555555; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2.7,0),COLOR777777; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2.1,0),COLOR999999; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,1.5,0),COLORBBBBBB; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,0.9,0),COLORDDDDDD;STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,0.3,0),COLORFFFFFF; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,3.2,0),COLORB20000; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2.7,0),COLOREC0000; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2.1,0),COLORFF4600; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,1.5,0),COLORFF6300; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,0.9,0),COLORFF8B00; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,0.3,0),COLORFFAB00; STICKLINE(MACD>=0 OR MACD<=0,0,0,50,2),COLORWHITE;DIFF:DIFF1,COLOR33FF33;DEA:DEA1,COLORYELLOW;强度:IF(DIFF>=DEA,DIFF,DRAWNULL),COLORRED;低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;DRAWTEXT(低位金叉,-0.1,'^ 低位金叉'),COLORYELLOW;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1; DRAWICON(二次金叉,DEA*1.04,13) ;DRAWTEXT(二次金叉,-0.1,' 二次金叉'),COLORFF00FF;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA); 底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,POINTDOT;DRAWTEXT(底背离,0.1,'底背离'),COLORMAGENTA;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF); 顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,POINTDOT;DRAWTEXT(顶背离,DIFF,'顶背离'),COLORGREEN;多转空:=((((LLV(MACD,4)>0) AND (MACD<REF(MACD,1))) AND(REF(MACD,1)>REF(MACD,2))) AND (REF(MACD,2)>REF(MACD,3)));空转多:=((((HHV(MACD,4)<0) AND (MACD>REF(MACD,1))) AND(REF(MACD,1)<REF(MACD,2))) AND (REF(MACD,2)<REF(MACD,3)));DRAWICON(多转空,MACD,2);DRAWICON(空转多,MACD,1);STICKLINE(二次金叉,0,0.2,2,0),COLORFF00FF;DRAWTEXT(二次金叉,DEA*1.06,'二次金叉'),COLORRED;。

通达信指标公式源码好厉害的MACD背离(通达信副图指标)

通达信指标公式源码好厉害的MACD背离(通达信副图指标)

好厉害的MACD背离(通达信副图指标)DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORRED,LINETHICK2;DEA:EMA(DIF,9),COLORWHITE,LINETHICK2;持仓段:=0,COLOR00CFFF;空仓段:=0,COLORFFCCFF;STICKLINE(DIF>DEA,-0.5,-0.6,10,1),COLOR00CFFF;STICKLINE(DIF<DEA,-0.5,-0.6,10,1),COLORFFCCFF;MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(((MACD<REF(MACD,1)) AND(MACD>0)),0,MACD,1,0),COLORLIBLUE,LINETHICK2;STICKLINE(((MACD>REF(MACD,1)) AND(MACD<0)),0,MACD,1,0),COLORFF00FF,LINETHICK2;建仓:IF(DIF<0,DIF,0),COLORYELLOW,LINETHICK2;加仓:IF(DIF<0,0,DIF),COLORRED,LINETHICK2;白线破仓:IF(DIF<DEA,DIF,DEA),COLORWHITE,LINETHICK2;趋势强弱:IF(DIF>DEA,DEA,DEA),COLORFF937F,LINETHICK2;AA:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(AA=2,21)=1; DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;A1:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,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,DIF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF); 顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;。

通达信指标公式源码 厉害的MACD

通达信指标公式源码 厉害的MACD

DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORRED,LINETHICK2;DEA:EMA(DIF,9),COLORWHITE,LINETHICK2;持仓段:=0,COLOR00CFFF;空仓段:=0,COLORFFCCFF;{STICKLINE(DIF>DEA,-0.5,-0.6,10,1),COLOR00CFFF;STICKLINE(DIF<DEA,-0.5,-0.6,10,1),COLORFFCCFF;}MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(((MACD<REF(MACD,1)) AND(MACD>0)),0,MACD,1,0),COLORLIBLUE,LINETHICK2;STICKLINE(((MACD>REF(MACD,1)) AND(MACD<0)),0,MACD,1,0),COLORFF00FF,LINETHICK2;建仓:IF(DIF<0,DIF,0),COLORYELLOW,LINETHICK2;加仓:IF(DIF<0,0,DIF),COLORRED,LINETHICK2;白线破仓:IF(DIF<DEA,DIF,DEA),COLORWHITE,LINETHICK2;趋势强弱:IF(DIF>DEA,DEA,DEA),COLORFF937F,LINETHICK2;AA:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(AA=2,21)=1; DRAWTEXT(二次金叉,0,' 二次金叉'),COLORYELLOW;A1:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK1; DRAWTEXT(底背离,0.05,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK1;V2:=IF(CURRBARSCOUNT=1,AMOUNT/1000*240/FROMOPEN/REF(AMOUNT/ 1000,1)-1,AMOUNT/REF(AMOUNT,1)-1),NODRAW,COLORRED;STICKLINE((V2>=1),DIF,DEA,0.5,0),COLORYELLOW;DRAWTEXT((V2>=1),DIF*1.15,'放量'),COLOR00FF00;{RMACD:="MACD.MACD";H3:=REF(RMACD,3);H2:=REF(RMACD,2);H1:=REF(RMACD,1);H0:=RMACD;买:(H2<0 AND H3>H2 AND H2>H1 AND H0>H1)/12;}。

MACD顶底背离通达信指标公式源码

MACD顶底背离通达信指标公式源码

MACD顶底背离通达信指标公式源码```pascal{MACD指标的顶底背离}{参数:N(计算的周期)}MA1:=MA(CLOSE,5);MA2:=MA(CLOSE,35);DIF:EMA1-EMA2;DEA:EMA(DIF,5);MACD:(DIF-DEA);TopSignal:(REF(HIGH<N,1) AND HIGH[1]>HIGH[2] ANDHIGH[1]>HIGH) AND REF(DEA,1)<0 AND DEA>0;BottomSignal:(REF(LOW<N,1) AND LOW[1]<LOW[2] AND LOW[1]<LOW) AND REF(DEA,1)>0 AND DEA<0;{ 在图表上画出TopSignal和BottomSignal的信号 }IF TopSignal THEN DRAWICON(TopSignal,'↑');IF BottomSignal THEN DRAWICON(BottomSignal,'↓');```源码的主要部分如下所示:-首先定义了两个移动平均线MA1和MA2,分别计算了收盘价的5日和35日均线。

-然后计算了MACD指标的快线(DIF)和慢线(DEA),采用了指数平滑移动平均线(EMA)的计算方法。

-最后根据顶底背离的条件判断,通过比较前一日和当前日的最高价和最低价,以及前一日和当前日的DEA值,来确定顶底背离的信号。

在图表上,通过DRAWICON函数可以绘制出顶底背离的箭头标志,上箭头表示顶背离,下箭头表示底背离。

请注意,这只是一个简化版的MACD顶底背离指标公式,具体的实现还需要根据具体的需求和市场情况进行调整和优化。

对于股票投资和分析,建议综合考虑多个指标和因素,进行综合分析和判断。

通达信指标公式源码随心MACD

通达信指标公式源码随心MACD

UPD:COUNT(C>=O OR C>=REF(C,1),8) NODRAW;CM60:BARSLAST(LONGCROSS(C,MA(C,60),8))+1 NODRAW COLORRED; DIFF:=EMA(CLOSE,12)-EMA(CLOSE,24);DEA:=EMA(DIFF,9);ADIF:ATAN((DIFF/REF(DIFF,1)-1)*100)*180/3.1416 NODRAW; RADIF:REF(ADIF,1) NODRAW;C2:=IF(V>MA(V,150)*0.98,0.1,-0.1);C1:=IF(V<MA(V,150)*0.98,-0.1,0.1);B2:=EMA(CLOSE,55)-MA(CLOSE,60) DOTLINE COLORGREEN;B3:=EMA(B2,9) DOTLINE COLORCYAN;DRAWBAND(B2,RGB(120,50,50),B3,RGB(50,120,50));MACD:=2*(DIFF-DEA), STICK,LINETHICK1 COLORCYAN;N:=20;MID:=MA(C,20);VART1:=POW((C-MID),2);VART2:=MA(VART1,N);VART3:=SQRT(VART2);UPPER:=MID+2*VART3;LOWER:=MID-2*VART3;BOLL:=REF(MID,1),COLORGREEN;UB:=REF(UPPER,1),COLOR00FFFF;LB:=REF(LOWER,1),COLOR00FFFF NODRAW;BLTJ:=REF(L,1)<REF(LB,1) AND L>LB;BLLDT:BARSLAST(BLTJ ) NODRAW;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));A1:=BARSLAST(REF(CROSS(DIFF,DEA),1)) COLORRED NODRAW;底背离:REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA) NODRAW;STICKLINE(底背离,0,0.03,1.2,1),COLOR00FF00;{底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2 CROSSDOT;}DRAWTEXT(底背离,0.1,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1)) ;顶背离:REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF) CROSSDOT COLORRED NODRAW;{顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORBLUE,LINETHICK2 CROSSDOT;}底背D:BARSLAST(底背离)+1 NODRAW COLORRED;顶背D:A2+1 COLORGREEN NODRAW;{判断天地量}AA:=SUMBARS(VOL,CAPITAL);地量:=VOL<MA(VOL,AA)*21/100 AND VOL>0;天量:=VOL>MA(VOL,AA)*34/10 ;MACDA:2*(DIFF-DEA), STICK,LINETHICK1 COLORCYAN;NOTEXT3:IF(地量AND PERIOD>4,MACD*1.5,DRAWNULL) STICK LINETHICK6 COLORYELLOW;NOTEXT4:IF(天量AND PERIOD>4,MACD*1.5,DRAWNULL) STICK LINETHICK6 COLORAAAAFF;NOTEXT5:IF(V<=MA(V,5)*0.22,MACD,DRAWNULL) STICK LINETHICK4 COLORBLUE;NOTEXT:IF(REF(MACD,1)<=MACD,MACD,DRAWNULL) STICK COLORRED; NOTEXT1:0 LINETHICK3 COLORGRAY;NOTEXT8:IF(V>MA(V,150)*0.98,0,DRAWNULL) COLORRED LINETHICK2 CIRCLEDOT ;DEAA:DEA COLORYELLOW;DIFA:DIFF COLORWHITE ;DIFF1:EMA(CLOSE,12)-EMA(CLOSE,26) DOTLINE COLORGREEN NODRAW; DEA1:EMA(DIFF1,9) DOTLINE COLORCYAN NODRAW;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2 CROSSDOT;顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORBLUE,LINETHICK2 CROSSDOT;强:IF(DIFF>MA(DIFF,2),DIFF,DRAWNULL),COLORRED LINETHICK2;弱:IF(DEA>MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA LINETHICK2;必买: DRAWICON(REF(TROUGHBARS(3,15,1),1)=0 ANDHIGH>LOW,0,25),COLORRED ,LINETHICK4;必卖:DRAWICON(REF(PEAKBARS(3,15,1),1)=1,0,27),COLORRED,LINETHICK8;B1:A1 NODRAW;TOP:A2 NODRAW;BSR:((BIDORDERVOL-BIDCANCELVOL)/(OFFERORDERVOL-OFFERCANCELVOL )-1)*10 NODRAW;NOTEXTBRS:IF(BSR>0,DEA,DRAWNULL) COLORFFFFFF LINETHICK2 CIRCLEDOT;HSJ:=BARSLAST(CROSS(DIFF,0) AND DIFF>=0 )+1 NODRAW;LSJ:=BARSLAST(CROSS(0,DIFF) AND DIFF<0 )+1 NODRAW;T:IF(DIFF>0,HSJ,LSJ) NODRAW;IF(T=1,ABS(MACD),0) STICK LINETHICK2 COLORMAGENTA;IF(CROSS(DEA,0),ABS(MACD),0) STICK LINETHICK2 COLORYELLOW;S:IF(HSJ>1,SUM(ABS(MACD),T),DRAWNULL) NODRAW ; DRAWNUMBER(ISLASTBAR ,ABS(MACD*1.02),S) COLORYELLOW; DRAWNUMBER(T=1 ,ABS(MACD*1.02),REF(S,1)) ;T2:REF(T,T)+T NODRAW;Q1S:REF(S,T) NODRAW;Q2S:=REF(S,T2) NODRAW;BL:=Q1S/Q2S NODRAW;{E2T:BARSLAST(CROSS(DIF,DEA) AND FILTER(CROSS(DIF,DEA) ,5) )+1 NODRAW;E6T:BARSLAST(CROSS(DEA,DIF) AND FILTER(CROSS(DEA,DIF) ,5) )+1 NODRAW;ET:IF(DIF>=DEA,E2T,E6T) NODRAW;ES:SUM(ABS(DIF-DEA),ET) NODRAW;BZ:=MAX(ABS(DEA),ABS(DIF));XS:=IF(DIF<0,-1,1);IF(ET=1,DIF,DRAWNULL) CIRCLEDOT LINETHICK2;DRAWNUMBER(ISLASTBAR ,DIF*1.05,ES) COLORYELLOW; DRAWNUMBER(ET=1 ,BZ*XS*1.05,REF(ES,1)) COLORYELLOW;};TTJ:=IF(BARSLAST(顶背离=1)+1=144 OR BARSLAST(顶背离=1)+1=89 OR BARSLAST(顶背离=1)+1=13 OR BARSLAST(顶背离=1)+1=47 ORBARSLAST(顶背离=1)+1=1 OR BARSLAST(顶背离=1)+1=8 OR BARSLAST(顶背离=1)+1=21 OR BARSLAST(顶背离=1)+1=34 OR BARSLAST(顶背离=1)+1=55,1,O) ;TTJA:=IF( BARSLAST(底背离=1)+1=144 OR BARSLAST(底背离=1)+1=89 OR BARSLAST(底背离=1)+1=8 OR BARSLAST(底背离=1)+1=1 OR BARSLAST(底背离=1)+1=47 OR BARSLAST(底背离=1)+1=13 OR BARSLAST(底背离=1)+1=21 OR BARSLAST(底背离=1)+1=34 OR BARSLAST(底背离=1)+1=55,1,O) ;DRAWNUMBER((BARSLAST(顶背离=1)+1<144 AND TTJ=1 AND CURRBARSCOUNT<233) OR ISLASTBAR,MIN(DIFF,DEA)*0.98,BARSLAST(顶背离=1)+1) COLORGREEN;DRAWNUMBER((BARSLAST(底背离=1)+1<144 AND TTJA=1 AND CURRBARSCOUNT<233)OR ISLASTBAR,0,BARSLAST(底背离=1)+1) COLORYELLOW;。

MACD看透主力通达信指标公式源码

MACD看透主力通达信指标公式源码

MACD看透主力通达信指标公式源码该算法主要通过计算不同时间段的移动平均线之间的差异来判断主力资金的买入和卖出行为。

MACD公式包括两个指标:DIF(差离值)和DEA (差离平均值)。

DIF的计算公式为:DIF = EMA(close, short) - EMA(close, long)其中,EMA代表指数移动平均线,short代表短期时间段,long代表长期时间段。

(1)计算短期移动平均线EMA(close, short):EMA(close, short) = (2 * close + (short - 1) * EMA(close, short)) / (short + 1)(2)计算长期移动平均线EMA(close, long):EMA(close, long) = (2 * close + (long - 1) * EMA(close, long)) / (long + 1)DEA的计算公式为:DEA = EMA(DIF, mid)其中,mid代表DEA的时间周期。

(3)计算差离平均值DEA:EMA(DIF, mid) = (2 * DIF + (mid - 1) * EMA(DIF, mid)) / (mid + 1)最后,通过计算DIF和DEA的差异,可以得到MACD的值:MACD=(DIF-DEA)*2这是一个基本的MACD指标计算公式,可以用于分析主力资金的买入和卖出信号。

通达信指标公式源码实现如下:```pythondef calculate_macd(close, short, long, mid):#计算DIFema_short = calculate_ema(close, short)ema_long = calculate_ema(close, long)dif = ema_short - ema_long#计算DEAdea = calculate_ema(dif, mid)#计算MACDmacd = (dif - dea) * 2return dif, dea, macddef calculate_ema(values, period):ema = []for i in range(len(values)):if i == 0:ema.append(values[i])else:ema.append((2 * values[i] + (period - 1) * ema[i - 1]) / (period + 1))return ema```上述代码中,`calculate_macd`函数计算DIF、DEA和MACD值,`calculate_ema`函数用于计算指数移动平均线。

通达信指标公式源码 MACD主图 主图源码

通达信指标公式源码 MACD主图 主图源码

{色MACD主图}高1:=REF(HHV(H,150),3);低1:=REF(LLV(L,150),3);H3:=高1-(高1-低1)*0.5;中轴:REFDATE(H3,DATE),POINTDOT,COLORLIGRAY,LINETHICK3;B1:=EMA(C,12);B2:=EMA(C,26);B3:=B1-B2;WDIF:EMA(EMA(EMA(C,3),3),3)+B3,COLORRED,LINETHICK2;WDEA:EMA(WDIF,9),COLORGREEN,LINETHICK2;MACD:2*(WDIF-WDEA),NODRAW ;STICKLINE(MACD>0,中轴,中轴+MACD,0,1),COLORRED;STICKLINE(MACD<0,中轴,中轴+MACD,0,1),COLORLIBLUE;STICKLINE(MACD<REF(MACD,1)AND MACD>0,中轴,中轴+MACD,0,0 ),COLOR00BBFF;STICKLINE(MACD>=REF(MACD,1)AND MACD>0,中轴,中轴+MACD,0,0 ),COLOR0011BB;STICKLINE(MACD>REF(MACD,1)AND MACD<0,中轴,中轴+MACD,0,0),COLORBB11BB;STICKLINE(MACD<=REF(MACD,1)AND MACD<0,中轴,中轴+MACD,0,0),COLORFFBB11;{量价异动}短线:MA(C,5),NODRAW;中线:((MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4+EXPMA( CLOSE,10))/2,NODRAW;密码线:((EMA(C,6)+EMA(C,18)+EMA(C,54)+EMA(C,162))/4+EXPMA(CLOSE,24)+ MA(C,25))/3,NODRAW;神奇线:(MA(C,35)+EXPMA(CLOSE,50))/2,NODRAW;阳涨幅:=4.0;阳倍量:=2.0;单阳收:=C;单阳开:=O;单阳:=单阳收>=REF(C,1)*(1+阳涨幅/100)AND VOL>REF(VOL,1)*阳倍量; DRAWTEXT(CURRBARSCOUNT<100 AND 单阳,L*0.98,'准备'),COLOR00FFFF; 高不破价:=REF(C,BARSLAST(单阳));低不破价:=REF(L,BARSLAST(单阳));F1:=C/REF(C,1)>1.098;强势:=COUNT(单阳,5) AND C>高不破价*0.98;A111:=REF(C/REF(C,1),BARSLAST(单阳));主升浪:=强势>0 AND C/REF(C,1)>A111 AND C>MA(C,60) ;JCCOUNT:=COUNT(单阳,11);上升中继:=单阳AND COUNT(JCCOUNT=2,11);DRAWTEXT(上升中继>0 ,L*0.9,'高度关注'),COLOR00FFFF;主升浪1:=上升中继AND F1;DRAWTEXT(主升浪>0 ,L*0.98,'主升浪'),COLOR00FFFF;拉升:=COUNT(单阳,4) AND O/REF(C,1)>1.017 AND C>=O AND C>MA(C,60) ; DRAWTEXT(拉升>0 ,L*0.9,'拉升'),COLOR00FFFF;单阳不破:=CURRBARSCOUNT<100 AND BARSLAST(单阳)<11 AND(LLV(L,BARSLAST(单阳))>低不破价OR LLV(L,BARSLAST(单阳))=低不破价); {金叉共振}市场成本:DMA(AMOUNT/V/100,V/CAPITAL),COLORRED,NODRAW; DRAWICON(CROSS(C,市场成本),L-0.20,1);{1号图标显示红脸} {PARTLINE(市场成本,市场成本>REF(市场成本,1),RGB(255,0,0),NOT(市场成本<REF(市场成本,1)),RGB(0,0,255),1,RGB(0,0,255)),LINETHICK2;}DIFF:=EMA(CLOSE,2) - EMA(CLOSE,60);DEA:=EMA(DIFF,8);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B01:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA); A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B02:=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));B03:=REF(C,A3+1)>C ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) ANDCROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));DRAWICON(B01>0,L-0.20,5);DRAWTEXT(B01,L-0.30,'MACD底背'),COLORWHITE;DRAWICON(B02>0,L-0.20,4);DRAWTEXT(B02,L-0.30,'KDJ底背'),COLORFF00FF;DRAWICON(B03>0,L-0.20,3);DRAWTEXT(B03,L-0.30,'RSI底背'),COLORYELLOW;DRAWICON(CROSS(DIFF,DEA) ANDCROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),L-0.20,6);DRAWTEXT(CROSS(DIFF,DEA) ANDCROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),L-0.30,'金叉共振'),COLOR0099FF; STICKLINE(C/REF(C,1)>1.095,C,O,2,0),COLORYELLOW;{F10}DRAWTEXT_FIX(1,0.7,0,0,'所属板块:'),COLORFF6000;DRAWTEXT_FIX(1,0.77,0,0,HYBLOCK),COLORRED;DRAWTEXT_FIX(1,0.835,0,0,DYBLOCK),COLORYELLOW;总股本:=STRCAT(STRCAT('总股本: ',CON2STR(TOTALCAPITAL/1000000,2)),'亿');流通盘:=STRCAT(STRCAT(' 流通盘: ',CON2STR(CAPITAL/1000000,2)),'亿'); 全流通:=STRCAT(' 全流通:',CON2STR((CAPITAL/1000000)/(TOTALCAPITAL/1000000),2));市值:=STRCAT(STRCAT(' 流通市值: ',CON2STR((CAPITAL/1000000)*C,2)),'亿');上市日期:=STRCAT(' 上市日期: ',CON2STR(FINANCE(42),0));股本市值:=STRCAT('股本市值: ',STRCAT(STRCAT(STRCAT(STRCAT(总股本,流通盘),全流通),市值),上市日期));{}市盈率:=STRCAT('市盈率: ',CON2STR(C/FINANCE(33),2));市销率:=STRCAT(' 市销率: ',CON2STR(C/(FINANCE(20)/FINANCE(1)),2));市净率:=STRCAT(' 市净率: ',CON2STR(C/FINANCE(34),2));净资收益率:=STRCAT(' 净资收益率:',CON2STR(FINANCE(33)/FINANCE(34)*100,2));毛利率:=STRCAT(' 毛利率:',CON2STR((FINANCE(20)-FINANCE(21))/FINANCE(20)*100,2));净利润率:=STRCAT(' 净利润率',CON2STR(FINANCE(30)/FINANCE(20)*100,2));主营利润率:=STRCAT(' 主营利润率',CON2STR(FINANCE(23)/FINANCE(20)*100,2));当前业绩:=STRCAT('当前业绩:',STRCAT(STRCAT(STRCAT(STRCAT(STRCAT(STRCAT(市盈率,市销率),市净率),净资收益率),毛利率),净利润率),主营利润率));{}X1:=(FINANCE(11)-FINANCE(15))/FINANCE(10)*1.2;X2:=(FINANCE(31)+FINANCE(17))/FINANCE(10)*1.4;{盈余公积用资本公积金代替};X3:=FINANCE(23)/FINANCE(10)*3.3;X4:=FINANCE(19)/FINANCE(15)*0.6;{缺长期负债或负债总额}X5:=FINANCE(20)/FINANCE(15)*0.999;Z值:=X1+X2+X3+X4+X5;预警:=IF(Z值<1.2,'重警',IF(Z值>=1.2 AND Z值<2.6,'轻警','无警'));财务预警:=STRCAT('财务预警: ',STRCAT(预警,STRCAT('-Z值: ',CON2STR(Z 值,3))));优质资产率:=STRCAT(' 优质资产率:',CON2STR((FINANCE(19)-FINANCE(22)-FINANCE(27))/FINANCE(19),2));{理论上越大越好但不同行业有不同标准};现金负债比:=STRCAT(' 现金负债比:',CON2STR(FINANCE(25)/FINANCE(15),3));{缺长期负债或负债总额,理论上越大越好但不同行业有不同标准};财务系数:=STRCAT('风险系数: ',STRCAT(STRCAT(财务预警,优质资产率),现金负债比));{}DRAWTEXT_FIX(ISLASTBAR,0.005,0.01,0,财务系数),COLORYELLOW; DRAWTEXT_FIX(ISLASTBAR,0.005,0.06,0,当前业绩),COLORYELLOW; DRAWTEXT_FIX(ISLASTBAR,0.005,0.115,0,股本市值),COLORYELLOW;{止损线}{数据自己爱好调整}STICKLINE(ISLASTBAR,HHV(C,5),HHV(C,5),218,1)COLORBLUE; STICKLINE(ISLASTBAR,HHV(C,5)*0.95,HHV(C,5)*0.95,218,1)COLORRED;。

通达信MACD整合指标源码

通达信MACD整合指标源码

MACD整合DRAWGBK(CLOSE>OPEN,RGB(25,25,112),RGB(47,79,79),1,2,1);DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9),COLOR888888;NOTEXT5:IF(DIF>=DEA,DIF,DRAWNULL),COLORRED;NOTEXT6:IF(DIF<DEA,DIF,DRAWNULL),COLORWHITE;XA_1:=BARSLAST(REF(CROSS(DIF,DEA),1));XA_2:=REF(CLOSE,XA_1+1)>CLOSE AND REF(DIF,XA_1+1)<DIF AND CROSS(DIF,DEA); XA_3:=BARSLAST(REF(CROSS(KDJ.K(9,3,3),KDJ.D(9,3,3)),1));XA_4:=BARSLAST(REF(CROSS(DEA,DIF),1));XA_5:=REF(CLOSE,XA_4+1)<CLOSE AND REF(DIF,XA_4+1)>DIF AND CROSS(DEA,DIF);MACD底背:IF(XA_2>0,(-0.1),0),COLORRED;MACD顶背:IF(XA_5>0,0.1,0),COLORGREEN;STICKLINE(XA_2>0,0.5*DIF,0,2,0),COLORRED;STICKLINE(XA_5>0,0.5*DIF,0,2,0),COLORGREEN;MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,0,0),COLOR44FF00; STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0,0),COLOR0066FF;XA_6:=13;XA_7:=13;XA_8:=REF(DIF,XA_6)=HHV(DIF,2*XA_6+1);XA_9:=FILTER(XA_8,XA_6);XA_10:=BACKSET(XA_9,XA_6+1);XA_11:=FILTER(XA_10,XA_6);XA_12:=BACKSET(ISLASTBAR,BARSLAST(XA_11)+1);XA_13:=XA_12>REF(XA_12,1);XA_14:=REF(DIF,XA_7)=LLV(DIF,2*XA_7+1);XA_15:=FILTER(XA_14,XA_7);XA_16:=BACKSET(XA_15,XA_7+1);XA_17:=FILTER(XA_16,XA_7);XA_18:=BACKSET(ISLASTBAR,BARSLAST(XA_17)+1);XA_19:=XA_18>REF(XA_18,1);压力线:DRAWLINE(XA_11,DIF,XA_13,DIF,0),DOTLINE,COLORCYAN;支撑线:DRAWLINE(XA_17,DIF,XA_19,DIF,0),DOTLINE,COLOR00AAFF;XA_20:=FILTERX(支撑线>REF(支撑线,1) AND DIF>支撑线AND REF(支撑线,1)=REF(DIF,1), 2);底抬高:DRAWLINE(XA_17,DIF,XA_20,支撑线,0),DOTLINE,COLORYELLOW;XA_21:=INTPART(3*10/5);XA_22:=REF(DIF,XA_21)=HHV(DIF,2*XA_21+1);XA_23:=FILTER(XA_22,XA_21);XA_24:=BACKSET(XA_23,XA_21+1);XA_25:=FILTER(XA_24,XA_21);XA_26:=BACKSET(ISLASTBAR,BARSLAST(XA_25)+1);XA_27:=XA_26>REF(XA_26,1);XA_28:=REF(DIF,XA_21)=LLV(DIF,2*XA_21+1);XA_29:=FILTER(XA_28,XA_21);XA_30:=BACKSET(XA_29,XA_21+1);XA_31:=FILTER(XA_30,XA_21);XA_32:=BACKSET(ISLASTBAR,BARSLAST(XA_31)+1);XA_33:=XA_32>REF(XA_32,1);短压线:DRAWLINE(XA_25,DIF,XA_27,DIF,0),DOTLINE,COLOR99FF00;短撑线:DRAWLINE(XA_31,DIF,XA_33,DIF,0),DOTLINE,COLOR0055FF;XA_34:=LLV(DEA,43);XA_35:=DEA-(DIF-DEA);XA_36:=IF(DIF<XA_34 AND DEA=XA_34,MIN(HHV(XA_34,10),XA_35),XA_34);XA_37:=REF(LOW,1);XA_38:=SMA(ABS(LOW-XA_37),13,1)/SMA(MAX(LOW-XA_37,0),13,1)*100;XA_39:=MA(XA_38,13);XA_40:=LLV(LOW,34);XA_41:=EMA(IF(LOW<=XA_40,XA_39,0),3);XA_42:=SMA(SMA((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,7,1),5,1); XA_43:=SMA((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,8,1)*15-XA_42* 10.38;XA_44:=FILTER(IF(XA_43<=XA_42 AND XA_41>0,XA_41*8,0),5);止跌:DRAWTEXT(XA_44 AND DIF<XA_36,DIF-11.01,101),COLORYELLOW;XA_45:=CROSS(DIF,DEA) AND DIF<(-0.1);STICKLINE(XA_45,0,(-0.18),6,0),COLORYELLOW;DRAWTEXT(XA_45,(-7.05),102),COLORYELLOW;XA_46:=IF(CROSS(0,DEA),1,0);XA_47:=IF(DIF<0 AND CROSS(DIF,DEA),1,0);XA_48:=IF(XA_46,SUM(XA_47,0),0);XA_49:=HHV(XA_48,0);XA_50:=SUM(XA_47,0);XA_51:=XA_50-XA_49=2 AND XA_50>REF(XA_50,1);DRAWTEXT(XA_51,DIF-15.05,103),COLOR0080FF;XA_52:=CROSS(MACD,DIF) AND MACD>=0-0.05 AND MACD<=0.02;DRAWTEXT(XA_52,MACD,104),COLORYELLOW;XA_53:=CROSS(DIF,DEA) AND DIF<(-0.1);XA_54:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));XA_55:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(XA_54=2,21)=1;STICKLINE(XA_55,0,(-0.58),6,0),COLORMAGENTA;DRAWTEXT(XA_55,0.1,105),COLOR5500FF;XA_56:=BARSLAST(REF(CROSS(DIF,DEA),1));XA_57:=REF(CLOSE,XA_56+1)>CLOSE AND DIF>REF(DIF,XA_56+1) AND CROSS(DIF,D EA);DRAWTEXT_FIX(C>O,0.01,0.9,0,' t'),COLORyellow;底背:DRAWLINE(XA_56=0,DIF,XA_57,DIF,0),COLORYELLOW,LINETHICK2;XA_58:=BARSLAST(REF(CROSS(DEA,DIF),1));XA_59:=REF(CLOSE,XA_58+1)<CLOSE AND REF(DIF,XA_58+1)>DIF AND CROSS(DEA,D IF);顶背:DRAWLINE(XA_58=0,DIF,XA_59,DIF,0),COLORGREEN,LINETHICK2;DRAWTEXT(XA_57,DIF-30.5,106),COLOR0055FF;DRAWTEXT(XA_59,DIF*0.5,107),COLOR99FF00;XA_60:=3;XA_61:=EMA(CLOSE,3)-(EMA(CLOSE,6)+EMA(CLOSE,7))/2;XA_62:=EMA(XA_61,3)+EMA(0,2);XA_63:=REF(XA_61,XA_60)=HHV(XA_61,2*XA_60+1);XA_64:=FILTER(BB,XA_60) AND XA_61=HHV(XA_61,XA_60+1);XA_65:=BARSLAST(REF(XA_64,1));XA_66:=REF(CLOSE,XA_65+1)<CLOSE AND REF(XA_61,XA_65+1)>XA_61 AND XA_64;DRAWTEXT(XA_66,XA_61*1.2,108),COLORGREEN;DRAWICON(XA_66>0,XA_61*1.2,2);XA_67:=REF(XA_61,XA_60)=LLV(XA_61,2*XA_60+1);XA_68:=BACKSET(XA_67,XA_60+1);XA_69:=FILTER(XA_68,XA_60) AND XA_61=LLV(XA_61,XA_60+1);XA_70:=BARSLAST(REF(XA_69,1));XA_71:=REF(CLOSE,XA_70+1)>CLOSE AND REF(XA_61,XA_70+1)<XA_61;XA_72:=HHVBARS(MACD,BARSLAST(MACD<0)+1);XA_73:=CROSS(BACKSET(CROSS(0,MACD),REF(XA_72,1)+2),0.5);XA_74:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(XA_72,1) +2),0.5);XA_75:=DRAWLINE(XA_73,MACD,REF(XA_73,1),REF(MACD,1),1);XA_76:=LLVBARS(MACD,BARSLAST(MACD>0)+1);XA_77:=CROSS(BACKSET(CROSS(MACD,0),REF(XA_76,1)+2),0.5);XA_78:=DRAWLINE(XA_77,MACD,REF(XA_77,1),REF(MACD,1),1);XA_79:=BARSLAST(FILTERX(CROSS(0,MACD),BARSCOUNT(CLOSE)));XA_80:=IF(MACD<0,FILTERX(MACD=LLV(MACD,BARSLAST(MACD>0)),BARSCOUNT(CLOS E)),DRAWNULL);XA_81:=BARSLAST(XA_80);XA_82:=FILTERX(MACD<CONST(LLV(MACD,XA_79+1)),BARSCOUNT(CLOSE));XA_83:=BARSLAST(XA_82);XA_84:=IF(XA_79+1>=1,CONST(LLV(MACD,XA_79+1)),DRAWNULL);XA_85:=CROSS(COUNT(CROSS(MACD>XA_84/2 AND MACD<0,0.5),XA_81)=1,0.5) AND XA_81>=0;XA_86:=IF(ISLASTBAR AND MACD>0 AND MACD=HHV(MACD,BARSLAST(MACD<0)),1,IF (FILTERX(XA_74,BARSCOUNT(CLOSE)),2,DRAWNULL));XA_87:=XA_86=1 OR XA_86=2 AND MACD>0;XA_88:=FILTERX(XA_87,BARSCOUNT(CLOSE));XA_89:=DRAWLINE(XA_88,MACD,REF(XA_88,1),REF(MACD,1),1);XA_90:=CROSS(COUNT(CROSS(MACD<XA_89/2 AND MACD>0,0.5),XA_88)=1,0.5) AND XA_88>=0;STICKLINE(MACD>XA_75,MACD,XA_75,0,0),COLORWHITE;STICKLINE(MACD<0 AND MACD<XA_78 AND XA_78<0,MACD,XA_78,0,0),COLORWHITE; DRAWICON(CROSS(DIF,DEA),DEA,1);DRAWICON(CROSS(DEA,DIF),DEA,2);底:ABS((CROSS(MACD.DIF,MACD.DEA) AND MACD.DEA<=(-0.07))*MACD.DIF)*1.5,COLO RLIMAGENTA;DRAWTEXT(ABS(底)>0,底-25,109),COLORYELLOW;XA_91:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:SMA(XA_91,3,1),COLORWHITE;D:SMA(K,3,1),COLOR00DDDD;J:3*K-2*D,COLOR800080;DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORWHITE;XA_92:=IF(CLOSE=INDEXC,(INDEXC+INDEXH+INDEXL+INDEXO)/4,AMOUNT/(VOL+0.01) /100);XA_93:=IF(CLOSE=INDEXC,XA_92+INDEXC-INDEXL,XA_92+(CLOSE-LOW));XA_94:=IF(CLOSE=INDEXC,INDEXL+INDEXC-XA_92,LOW+(CLOSE-XA_92));今压:REF(XA_93,1),COLORAA11BB,LINETHICK0;今撑:REF(XA_94,1),COLOR009900,LINETHICK0;明压:XA_93,LINETHICK0;明撑:XA_94,LINETHICK0;XA_95:=(HHV(HIGH,9.8)-CLOSE)/(HHV(HIGH,9.8)-LLV(LOW,9.8))*101;XA_96:=SMA(XA_95,3,1);XA_97:=SMA(XA_96,3,1);XA_98:=3*XA_96-2*XA_97;XA_99:=IF(XA_98>=100,100,IF(XA_98<=0,0,XA_98));明天买:IF(XA_99=100,0-10,0),COLOR00CCCC;明天卖:IF(XA_99=0,90,100),COLORGREEN;XA_100:=250;XA_101:=HHV(K,XA_100);XA_102:=HHV(D,XA_100);XA_103:=HHV(J,XA_100);XA_104:=LLV(K,XA_100);XA_105:=LLV(D,XA_100);XA_106:=LLV(J,XA_100);XA_107:=MAX(XA_101,MAX(XA_102,XA_103));XA_108:=MIN(XA_104,MIN(XA_105,XA_106));XA_109:=(XA_107+XA_108)/2;XA_110:=XA_107-XA_108;XA_111:=HHV(DIFF,XA_100);XA_112:=HHV(DEA,XA_100);XA_113:=HHV(MACD,XA_100);XA_114:=LLV(DIFF,XA_100);XA_115:=LLV(DEA,XA_100);XA_116:=LLV(MACD,XA_100);XA_117:=MAX(XA_111,MAX(XA_112,XA_113));XA_118:=MIN(XA_114,MIN(XA_115,XA_116));XA_119:=(XA_117-XA_118)/100;XA_120:=XA_117-XA_118;XA_121:=(0-XA_119)*(XA_110/XA_120)+XA_109;XA_122:=(DIFF-XA_119)*(XA_110/XA_120)+XA_109;XA_123:=(DEA-XA_119)*(XA_110/XA_120)+XA_109;XA_124:=(MACD-XA_119)*(XA_110/XA_120)+XA_109;XA_125:=MACD<REF(MACD,1) AND MACD>0;XA_126:=MACD>=REF(MACD,1) AND MACD>0;XA_127:=MACD>REF(MACD,1) AND MACD<0;XA_128:=MACD<=REF(MACD,1) AND MACD<0;STICKLINE(XA_125,XA_121,XA_124,2.7,0),COLOR00AAFF;STICKLINE(XA_125,XA_121,XA_124,2.6,0),COLOR0066AA;STICKLINE(XA_125,XA_121,XA_124,2.5,0),COLOR0099DD;STICKLINE(XA_125,XA_121,XA_124,1.3,0),COLOR00BBEE;STICKLINE(XA_126,XA_121,XA_124,2.7,0),COLOR0000AA;STICKLINE(XA_126,XA_121,XA_124,2.6,0),COLOR0011BB;STICKLINE(XA_126,XA_121,XA_124,2.5,0),COLOR0022CC;STICKLINE(XA_126,XA_121,XA_124,1.3,0),COLOR0033DD;STICKLINE(XA_127,XA_121,XA_124,2.7,0),COLORAA00BB;STICKLINE(XA_127,XA_121,XA_124,2.6,0),COLORBB1177;STICKLINE(XA_127,XA_121,XA_124,2.5,0),COLORCC2299;STICKLINE(XA_127,XA_121,XA_124,1.3,0),COLORDD33AA;STICKLINE(XA_128,XA_121,XA_124,2.7,0),COLORFF7700;STICKLINE(XA_128,XA_121,XA_124,2.6,0),COLORAA7711;STICKLINE(XA_128,XA_121,XA_124,2.5,0),COLORCC9922;STICKLINE(XA_128,XA_121,XA_124,1.3,0),COLOREEBB33;涨:IF(XA_122>0,XA_122,DRAWNULL),COLOR0055FF;跌:IF(XA_122<0,XA_122,DRAWNULL),COLOR0055FF;涨2:IF(XA_123>0,XA_123,DRAWNULL),COLORGREEN;跌2:IF(XA_123<0,XA_123,DRAWNULL),COLORGREEN;XA_129:=(HIGH+LOW+CLOSE)/3;STICKLINE(DIFF>REF(DIFF,1),20,20,2,0),COLORRED;STICKLINE(DIFF<REF(DIFF,1),20,20,2,0),COLORGREEN;STICKLINE(K>=REF(K,1) OR K>D AND DIFF>REF(DIFF,1),80,80,2,1),COLORRED; STICKLINE(K<REF(K,1),80,80,2,1),COLORGREEN;DRAWTEXT(XA_52,XA_124*0.82,110),COLORYELLOW;XA_130:=EMA(MA(LOW,3)*0.96,30);XA_131:=IF(CROSS(DIFF,DEA) AND XA_130-REF(XA_130,1)>0 AND MACD>=REF(MACD, 1) AND DIFF<=0,1,0);DRAWTEXT(XA_131=1,XA_122*1.68,111),COLORCDFFBB;DRAWTEXT(XA_53,XA_123*0.99,112),COLOR0099DD;XA_132:=BARSLAST(REF(CROSS(DIFF,DEA),1));XA_133:=REF(CLOSE,XA_132+1)>CLOSE AND DIFF>REF(DIFF,XA_132+1) AND CROSS (DIFF,DEA);DRAWTEXT(XA_133,XA_123*0.99-16,113),COLOR0099FF;XA_134:=BARSLAST(REF(CROSS(DEA,DIFF),1));XA_135:=REF(CLOSE,XA_134+1)<CLOSE AND REF(DIFF,XA_134+1)>DIFF AND CROSS (DEA,DIFF);DRAWTEXT(FILTER(XA_135,5),XA_123*1.02,114),COLORDDAAAA;XA_136:=MACD.DIF#WEEK;XA_137:=MACD.DEA#WEEK;XA_138:=FILTER(CROSS(XA_136,XA_137),0);XA_139:=FILTER(CROSS(XA_137,XA_136),0);M周金叉:IF(CROSS(MACD.DIF#WEEK,MACD.DEA#WEEK),(-50),0),COLORRED,LINETHICK 2;DRAWTEXT(XA_138,(-45),115),COLORRED;M周死叉:IF(CROSS(MACD.DEA#WEEK,MACD.DIF#WEEK),(-50),0),COLORGREEN,LINETHIC K2;DRAWTEXT(XA_139,DIF-0.5,116),COLORGREEN;XA_140:=MACD.DIF#MONTH;XA_141:=MACD.DEA#MONTH;XA_142:=FILTER(CROSS(XA_140,XA_141),0);XA_143:=FILTER(CROSS(XA_141,XA_140),0);M月金叉:IF(CROSS(MACD.DIF#MONTH,MACD.DEA#MONTH),(-60),0),COLORYELLOW,LINE THICK2;DRAWTEXT(XA_142,(-35),117),COLORYELLOW;M月死叉:IF(CROSS(MACD.DEA#MONTH,MACD.DIF#MONTH),(-60),0),COLORFF6600,LINET HICK2;DRAWTEXT(XA_143,(-35),118),COLORFF6600;XA_144:=SKDJ.K#WEEK;XA_145:=SKDJ.D#WEEK;XA_146:=FILTER(CROSS(XA_144,XA_145),0);XA_147:=FILTER(CROSS(XA_145,XA_144),0);K周金叉:IF(CROSS(KDJ.K#WEEK,KDJ.D#WEEK),50,0),COLORRED,LINETHICK2; DRAWTEXT(XA_146,50,119),COLORGREEN;K周死叉:IF(CROSS(KDJ.D#WEEK,KDJ.K#WEEK),50,0),COLORGREEN,LINETHICK2; DRAWTEXT(XA_147,50,120),COLORGREEN;XA_148:=KDJ.K#MONTH;XA_149:=KDJ.D#MONTH;XA_150:=FILTER(CROSS(XA_148,XA_149),0);XA_151:=FILTER(CROSS(XA_149,XA_148),0);K月金叉:IF(CROSS(KDJ.K#MONTH,KDJ.D#MONTH),60,0),COLORYELLOW,LINETHICK2; DRAWTEXT(XA_150,60,121),COLORYELLOW;K月死叉:IF(CROSS(KDJ.D#MONTH,KDJ.K#MONTH),60,0),COLORFF6600,LINETHICK2; DRAWTEXT(XA_151,60,122),COLORFF6600;XA_152:=BARSLAST(REF(CROSS(K,D),1));XA_153:=REF(CLOSE,XA_152+1)>CLOSE AND REF(K,XA_150+1)<K AND CROSS(K,D); XA_154:=IF(FILTER(XA_153>0,5),1,0);DRAWTEXT(XA_154=1,D*0.98,123),COLORDDDDDD;XA_155:=BARSLAST(REF(CROSS(D,K),1));XA_156:=REF(CLOSE,XA_155+1)<CLOSE AND REF(K,XA_155+1)>K AND CROSS(D,K); DRAWTEXT(FILTER(XA_156>0,5),D+8,114),COLORFFAA22;XA_157:=MA(CLOSE,80)-MA(CLOSE,13)/3;XA_158:=MA((CLOSE-XA_157)/XA_157,3);XA_159:=CROSS(XA_158,0) AND LOW/REF(HIGH,1)<1.012 AND J<75 AND J>REF(J,1); XA_160:=MA(CLOSE,12);XA_161:=IF(FILTER(MACD>=REF(MACD,5) AND OPEN<=REF(CLOSE,1) AND XA_130-RE F(XA_130,1)>0 AND MACD<=0 AND XA_160-REF(XA_160,1)>=0,3) AND J<80 AND J> REF(J,1) AND D>REF(D,1) AND (DIFF>=REF(DIFF,1) OR DEA>=REF(DEA,1)),1,0); DRAWTEXT(XA_161=1,XA_124*0.98,124),COLOR0099FF;XA_162:=EMA(CLOSE,2)-EMA(OPEN,5);XA_163:=IF(CROSS(XA_162,MACD) AND LOW<=XA_130 AND MACD<=0-0.11 AND (J< 20 OR K<20),1,0);DRAWTEXT(FILTER(XA_163,3),0,125),COLOR00CC00;XA_164:=MA(CLOSE,10);XA_165:=EMA(MA(HIGH,3)*1.05,30);XA_166:=IF(FILTER(0.7*(CROSS(DIFF,DEA) AND CLOSE<XA_165 AND XA_130-REF(XA_ 130,1)>0 AND CROSS(MACD,0) AND MACD>=0 AND DIFF>0 AND XA_164-REF(XA_164, 1)>0 AND VOL>REF(VOL,1))>=0.7 AND (CLOSE<XA_165 AND XA_130-REF(XA_130,1)> 0),5) AND J<80,1,0);DRAWTEXT(XA_166=1,XA_124*0.98,126),COLORCDFFDD;XA_167:=IF(COUNT(XA_158>REF(XA_158,1),3)=3 AND COUNT(XA_158<0,10)=10 AND REF(XA_158,3)=LLV(XA_158,10) AND J<80 AND J>REF(J,1),1,0);DRAWTEXT(XA_167=1,J,127),COLORFF00CC;XA_168:=REF(XA_158,2)=LLV(XA_158,20) AND REF(XA_158,2)<0.071 AND REF(XA_158, 2)<REF(XA_158,1) AND NOT(REF(LOW,1)>REF(HIGH,2) AND LOW>REF(HIGH,1)) AND C LOSE>REF(CLOSE,1) AND J<75 AND J>REF(J,1);DRAWTEXT(XA_159 OR XA_168,D-1,128),COLORCYAN;XA_169:=(INTPART(SMA(XA_91,3,1))+INTPART(SMA(K,3,1)))/2;XA_170:=CROSS(XA_169,50) AND J<95 AND DIFF>REF(DIFF,1) AND LOW<REF(CLOSE, 1);DRAWTEXT(XA_170,D*0.6,129),COLORCYAN;。

通达信指标公式源码 macd副图指标,逃顶抄底,买卖利器

通达信指标公式源码 macd副图指标,逃顶抄底,买卖利器

RSV:=(CLOSE-LLV(LOW,11))/(HHV(HIGH,11)-LLV(LOW,11))*100;DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;DIFF:=EMA(CLOSE,12)-EMA(CLOSE,27);DEA1:=EMA(DIFF,9);MACD1:=2*(DIFF-DEA1),COLORSTICK,LINETHICK2;趋势:=MA(MACD,1);DRAWICON(MACD1>REF(MACD1,1) AND 趋势>0 ,趋势,1);低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=(3*K-2*D);DRAWTEXT(二次金叉,DEA*1,'低二叉'),COLORYELLOW;周DIF:="MACD.DIF#WEEK"(12,26,9);周DEA:="MACD.DEA#WEEK"(12,26,9);周MACD:="MACD.MACD#WEEK"(12,26,9);DIF周金叉:=CROSS(周DIF,周DEA);DRAWTEXT(DIF周金叉,0,'周叉'),COLORYELLOW;DRAWTEXT(CROSS(周DEA,周DIF),0,'周死'),COLORGREEN;MACD周金叉:=CROSS(周MACD,周DIF) AND 周MACD>=(0-0.05) AND 周MACD<=0.02; VARR:=EMA(EMA(CLOSE,13),13);控盘:=(VARR-REF(VARR,1))/REF(VARR,1)*1000;A10:=CROSS(控盘,0);控盘B:=FILTER(IF(A10,1,0),5);JJ:=DYNAINFO(11);P:=55;S:=8;M1:=3;刘:=(EMA(CLOSE,S)-EMA(CLOSE,P))*10;剑:=EMA(刘,M1);BTJ11:=(C-JJ)/JJ<-0.03;BTJ2:=控盘>REF(控盘,1) AND 控盘<-0.2;BTJ3:=CROSS(刘,剑) AND 刘<-0.3;BTJ811:=FILTER(BTJ11 AND BTJ2 AND BTJ3,13);庄:= BTJ11 AND BTJ2 AND BTJ3;有庄:=FILTER(庄,55),COLORWHITE;DRAWTEXT(BTJ811,-0.2,'★有庄'),COLORYELLOW;DRAWTEXT(CROSS(J,-3),DIF,'出击'),COLORWHITE;A1:=BARSLAST(REF(CROSS(EMA(CLOSE,12)-EMA(CLOSE,26),EMA(EMA(CLOSE,12)-EMA( CLOSE,26),9)),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND EMA(CLOSE,12)-EMA(CLOSE,26)>REF(EMA(CLOSE,12)-EMA(CLOSE,26),A1+1) AND CROSS(EMA(CLOSE,12)-EMA(CLOSE,26),EMA(EMA(CLOSE,12)-EMA(CLOSE,26),9));底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORMAGENTA,LINETHICK2;A2:=BARSLAST(REF(CROSS(EMA(EMA(CLOSE,12)-EMA(CLOSE,26),9),EMA(CLOSE,12)-E MA(CLOSE,26)),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(EMA(CLOSE,12)-EMA(CLOSE,26),A2+1)>EMA(CLOSE,12)-EMA(CLOSE,26) AND CROSS(EMA(EMA(CLOSE,12)-EMA(CLOSE,26),9),EMA(CLOSE,12)-EMA(CLOSE,26));顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;。

特殊MACD源码通达信指标公式源码

特殊MACD源码通达信指标公式源码

DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MYY:=EMA(CLOSE,3)-EMA(CLOSE,3);YMM:=EMA(MYY,3);MACD:(DIF-DEA)*2,COLORSTICK;IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLORGREEN,LINETHICK2;MACD2:=MACD;获利比:WINNER(C),NODRAW;STICKLINE((MACD2>=0),0,MACD2,0,1),COLORRED;STICKLINE(((MACD2>=0) AND (MACD2 <REF(MACD2,1))),0,MACD2,0,0),COLORMAGENTA;STICKLINE((MACD2<0),0,MACD2,0,0),COLORGREEN;STICKLINE(((MACD2<0) AND (MACD2 > REF(MACD2,1))),0,MACD2,0,1),COLORWHITE; DRAWICON(LONGCROSS(CLOSE,MA(CLOSE,5),17),MACD2,1);DRAWICON(LONGCROSS(MA(CLOSE,5),CLOSE,17),MACD2,2);DRAWICON(CROSS(DIF,DEA) AND DIF<=0.2,LLV(DIF,1),29);DRAWICON(CROSS(DIF>=0,DIF<DEA),DIF,1);低位反转:=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,MACD,0.3,0),COLORRED;高位反转:=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,MACD,0.3,0),COLORGREEN;低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1; DRAWICON(二次金叉,0,25);三次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=3,60)=1; DRAWICON(三次金叉,0,26);A1:=IF(MACD2>0,1,-1);TJ:=MACD2>0;T:=MACD2<0;DRAWTEXT(BARSLAST(TJ)=1,MACD2,'1'),COLORYELLOW;DRAWTEXT(BARSLAST(TJ)=2,MACD2,'2'),COLORYELLOW;DRAWTEXT(BARSLAST(TJ)=3,MACD2,'3'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=5,MACD2,'5'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=8,MACD2,'8'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=13,MACD2,'13'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=21,MACD2,'21'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=34,MACD2,'34'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=55,MACD2,'55'),COLORYELLOW; DRAWTEXT(BARSLAST(T)=1,MACD2,'1'),COLORGREEN; DRAWTEXT(BARSLAST(T)=2,MACD2,'2'),COLORGREEN; DRAWTEXT(BARSLAST(T)=3,MACD2,'3'),COLORGREEN; DRAWTEXT(BARSLAST(T)=5,MACD2,'5'),COLORGREEN; DRAWTEXT(BARSLAST(T)=8,MACD2,'8'),COLORGREEN; DRAWTEXT(BARSLAST(T)=13,MACD2,'13'),COLORGREEN; DRAWTEXT(BARSLAST(T)=21,MACD2,'21'),COLORGREEN; DRAWTEXT(BARSLAST(T)=34,MACD2,'34'),COLORGREEN; DRAWTEXT(BARSLAST(T)=55,MACD2,'55'),COLORGREEN;涨家数:INDEXADV,NODRAW,COLORRED;跌家数:INDEXDEC,NODRAW,COLORGREEN;正量能:涨家数/(涨家数+跌家数)*100,NODRAW,COLORMAGENTA; 负量能:跌家数/(涨家数+跌家数)*100,NODRAW,COLORYELLOW; 高开:=O>REF(H,1);隔空高开:高开,NODRAW;低开:=O<REF(L,1);隔空低开:低开,NODRAW;。

MACD完美波段通达信指标公式源码

MACD完美波段通达信指标公式源码

MACD完美波段通达信指标公式源码
以下是一种在通达信软件中实现MACD指标的源代码:
V1:=CLOSE-REF(CLOSE,1);
V2:=MA(V1,SHORT);
V3:=MA(V1,LONG);
DIF:=(V2-V3)*(SHORT/(SHORT*2+1));
DEA:=DIF*(MID/(MID*2+1));
MACD:=(DIF-DEA)*2;
其中,SHORT和LONG为参数,分别代表MACD指标中的短期和长期移
动平均线的周期。

MID为第三个参数,代表DEA平滑移动平均线的周期。

在该公式中,首先计算了收盘价的差值V1,然后分别计算了V1的SHORT周期和LONG周期的移动平均值,得到V2和V3、接下来,计算DIF,即V2与V3的差值,乘以SHORT的权重后除以一个常量。

然后,将DIF乘
以DEA的权重后除以一个常量得到DEA。

最后,通过DIF减去DEA的值乘
以2得到MACD指标。

以上只是一种实现MACD指标在通达信软件中的方式,不同的软件、
编程语言或者框架可能有所不同。

此外,在使用该公式之前,还需根据具
体需求设置好参数值。

通达信指标公式源码 H超级KMACD 副图源码

通达信指标公式源码 H超级KMACD 副图源码

{通达信'H超级KMACD'源码}H0:=0.25;L0:=(H+L+C)/3;L1:=H0*(L0-MA(L0,21))/(AVEDEV(L0,21));超级K:SMA(L1,3,1);超级D:SMA(超级K,3,1);超级J:超级K*3-超级D*2,COLORCC66BB;H1:=3.809*H0+REVERSE(EMA(超级J,1));H2:=-2.809*H0+REVERSE(EMA(超级J,1));IF(超级J>H1,超级J,DRAWNULL),COLORAAAA33,LINETHICK3;做顶:IF(超级J>H1,1,0),COLORCYAN,NODRAW;IF(超级J<H2,1,0),COLOR880088,NODRAW;筑底:IF(超级J<H2,超级J,DRAWNULL),COLORDD00DD,LINETHICK3;H3:=CROSS(超级K,超级D);H4:=超级J<REF(超级J,1) AND REF(超级J,1)>REF(超级D,1) AND 超级J<=超级D; H5:=超级J>H1 AND NOT(REF(超级J>H1,1));拉升为1:IF(H5,1,0),COLORFFFFCC,NODRAW;金叉:IF(H3,1,0),COLORRED,NODRAW;死叉:IF(H4,1,0),COLORGREEN,NODRAW;【选股基准线】:CONST(HHV(MAX(MAX(超级K,超级D),超级J),0))*1.1,COLORLIRED; DIF0:=EMA(DCLOSE,8)-EMA(DCLOSE,22);DEA0:=EMA(DIF0,7);MACD:=2*(DIF0-DEA0);D0:=HHV(ABS(MACD),100);M0:=COUNT(CROSS(DIF0,DEA0),BARSLAST(DEA0>=0));M1:=BARSLAST(REF(CROSS(MACD,0),1));M2:=BARSLAST(REF(CROSS(DEA0,DIF0),1));M3:=LLV(MACD,4)>0 AND MACD<REF(MACD,1) AND REF(MACD,1)>REF(MACD,2) AND REF(MACD,2)>REF(MACD,3);M4:=HHV(MACD,4)<0 AND MACD>REF(MACD,1) AND REF(MACD,1)<REF(MACD,2)AND REF(MACD,2)<REF(MACD,3);低位金叉:IF(CROSS(DIF0,DEA0) AND DIF0<-0.1,D0*0.4+【选股基准线】,0+【选股基准线】),COLORFF00FF;二次金叉:IF(CROSS(DIF0,DEA0) AND DEA0<0 AND COUNT(M0=2,21)=1,D0*0.8+【选股基准线】,0+【选股基准线】),COLORFFFF00;启点:IF(FILTER(MACD>0 AND MACD>5*REF(MACD,1),2),D0+【选股基准线】,0+【选股基准线】),COLOR0044FF;底背离:=REF(CLOSE,M1+1)>CLOSE AND MACD>REF(MACD,M1+1),COLORGREEN;D1:=7;D2:=30;D3:=6;DIF1:=EMA(C,D1)-EMA(C,D2),COLORFFFFFF;DEA1:=EMA(DIF1,D3),COLORFF6666;MACD1:=(DIF1-DEA1)*2,COLORSTICK,COLORRED;F0:=V*(O+C+H+L)/4;F1:=IF(V>0,F0/V,(O+C+H+L)/4);F2:=(F1-LLV(F1,5))/(HHV(F1,5)-LLV(F1,5));F3:=SMA(F2,13,1);F4:=SMA(F3,13,1);F5:=3*F3-2*F4;F6:=2*F5-0.5;F7:=F1*(1-(F6-F4)/40);F8:=CROSS(F1,F7) AND C/REF(C,1)<1.03 AND SUM(DYNAINFO(23),5)>=3000; MACD拉升:IF(FILTER(F8,10) AND MACD1>0,D0*1.2+【选股基准线】,0+【选股基准线】),COLOR6600FF;MACD选长:=IF(CROSS(DIF1,DEA1),HHV(ABS(MACD1),100)+【选股基准线】,0),COLORLIRED;DIF:DIF0+【选股基准线】,COLORFFFFFF;DEA:DEA0+【选股基准线】,COLOR00AAAA;0,COLOR888888,POINTDOT;DRAWTEXT(FILTER(F8,10) AND MACD1>0,D0*1.1+【选股基准线】,'拉'),COLOR6600FF; STICKLINE(H5,超级J*1.2,超级J*0.8,0,-1),COLORFFFFCC;DRAWTEXT(H5,超级J*1.25,'拉'),COLORFFFFCC;DRAWICON(H4,超级K*1.3,2);DRAWICON(H3,超级K*0.7,1);STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0+【选股基准线】,MACD+【选股基准线】,1,0),COLOR6699FF;STICKLINE(MACD>=0 AND MACD<=REF(MACD,1),0+【选股基准线】,MACD+【选股基准线】,1,-1),COLOR008800;STICKLINE(MACD<=0 AND MACD>=REF(MACD,1),0+【选股基准线】,MACD/2+【选股基准线】,1,0),COLORAAAAAA;STICKLINE(MACD<=0 AND MACD<=REF(MACD,1),0+【选股基准线】,MACD/2+【选股基准线】,1,-1),COLORCC6600;DRAWTEXT(FILTER(M3,3),-0.15+【选股基准线】,'转空'),COLOR00FF00; DRAWTEXT(FILTER(M4,3),D0*0.5+【选股基准线】,'转多'),COLORFFFFBB;DRAWTEXT(CROSS(DIF0,DEA0) AND DIF0<-0.1,D0*0.3+【选股基准线】,'低位X'),COLORFF00FF;DRAWTEXT(CROSS(DIF0,DEA0) AND DEA0<0 AND COUNT(M0=2,21)=1,D0*0.7+【选股基准线】,'二次X'),COLORFFFF00;DRAWTEXT(FILTER(MACD>0 AND MACD>5*REF(MACD,1),2),D0*0.9+【选股基准线】,'启'),COLOR0044FF;。

超短macd背离通达信指标公式源码

超短macd背离通达信指标公式源码

WY1001:=(2*CLOSE+HIGH+LOW)/4;{非常准}WY1002:=EMA(WY1001,4);WY1003:=EMA(WY1002,4);WY1004:=EMA(WY1003,4);XYS0:(WY1004-REF(WY1004,1))/REF(WY1004,1)*100;STICKLINE(XYS0>=0,XYS0,0,2,0),COLOR0000FF;STICKLINE(XYS0<0,XYS0,0,2,0),COLORFFFF00;PJGJ:=AMOUNT/VOL/100;SSRYDJX:=MA(PJGJ,13);SSRCJL:=EMA(VOL,13);SSRCJE:=EMA(AMOUNT,13);SSRCBJX:=SSRCJE/SSRCJL/100;CYS13:=(CLOSE-SSRCBJX)/SSRCBJX*100;XYSHSL:=EMA(VOL/CAPITAL*100,13);STICKLINE(XYSHSL>6.1 AND CYS13>5 ,2 ,0 ,2 ,0 ),COLORGREEN; STICKLINE(XYSHSL>3.8 AND CYS13>5 ,1.5 ,0 ,2 ,0 ),COLORYELLOW; STICKLINE(XYSHSL>2.1 AND CYS13>5 ,1 ,0 ,2 ,0 ),COLORCYAN; STICKLINE(XYSHSL>1.8 AND CYS13>5 ,0.5 ,0 ,2 ,0 ),COLORBLUE;XYS1:MA(XYS0,2),COLOR00FF00;XYS2:MA(XYS0,1),COLOR00FFFF;STICKLINE(CROSS(XYS2,XYS1) , 0.2 ,0 ,2,0 ),COLOR00FFFF; STICKLINE(XYS2>XYS1 AND 0>XYS2 ,XYS2 ,0 ,2 ,0),COLORFF00FF; STICKLINE(XYS2<XYS1 AND 0<XYS2 ,XYS2 ,0 ,2,1),COLOR00FF00; STICKLINE(CROSS(XYS1,XYS2) AND XYS2>0 ,XYS2 ,0 ,2 ,0),COLOR00FF00;A1:=BARSLAST(REF(CROSS(XYS2,XYS1),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND XYS2>REF(XYS2,A1+1) AND CROSS(XYS2,XYS1);DRAWTEXT(底背离,XYS2*1,' 底背离'),COLORWHITE;DRAWICON(底背离,XYS2*1,38);DA1:=BARSLAST(REF(CROSS(XYS2,XYS1),1));D底背离:=REF(CLOSE,DA1+1)>CLOSE AND XYS2>REF(XYS2,DA1+1) AND CROSS(XYS2,XYS1);底背画线:DRAWLINE(DA1=0,XYS1,D底背离,XYS1,0),COLORWHITE,DOTLINE,LINETHICK3;A2:=BARSLAST(REF(CROSS(XYS1,XYS2),1));{MACD日线顶背离}顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(XYS1,A2+1)>XYS1 AND CROSS(XYS1,XYS2);DRAWTEXT(顶背离,XYS1*1,' 顶背离'),COLORGREEN;DRAWICON(顶背离,XYS1*1,39);DA2:=BARSLAST(REF(CROSS(XYS1,XYS2),1));D顶背离:=REF(CLOSE,DA2+1)<CLOSE AND REF(XYS1,DA2+1)>XYS2 AND CROSS(XYS1,XYS2);顶背画线:DRAWLINE(DA2=0,XYS1,顶背离,XYS1,0),COLORLIGREEN,DOTLINE,LINETHICK2;。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

{MACD}
DIF:EMA(CLOSE,6)-EMA(CLOSE,19),,NODRAW;
DEA:EMA(DIF,9),NODRAW;
MACD:2*(DIF-DEA),COLORSTICK;
STICKLINE(MACD>0,MACD,0,0.5,0),COLORRED;
STICKLINE(MACD<0,MACD,0,0.5,0),COLORGREEN;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),MACD,0,0.5,0),COLORWHITE; STICKLINE(MACD<0 AND MACD>REF(MACD,1),MACD,0,0.5,0),COLORFF00FF; FH1:=REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4);
FH2:=MACD>=0 AND COUNT(MACD>REF(MACD,1),1)=1;
FH3:=FH1 AND FH2 AND EMA(C,13)>REF(EMA(C,13),1);
FH4:=FH1 AND FH2 AND ABS((DIF-DEA)/C)<0.018;
FH5:=FH1 AND FH2 AND MACD<0.10;
VV:=CLOSE>OPEN AND MA(CLOSE,5)>MA(CLOSE,10) AND
MA(CLOSE,10)>MA(CLOSE,30)
AND DIF>DEA AND MACD>REF(MACD,1) AND DIF>0 AND DEA>0 AND
MA(VOL,5)>MA(VOL,34) AND MA(CLOSE,30)>=REF(MA(CLOSE,30),1);
佛手:IF(VV,1,0),NODRAW;
{二次起动}
X0:=BARSLAST((CROSS(MACD,REF(MACD,1)) AND MACD>0) OR
CROSS(MACD,0));
X1:=BARSLAST(CROSS(0.5,COUNT(MACD>REF(MACD,1),X0+1)=X0+1));{回} X2:=COUNT(MACD<REF(MACD,1),X1+1)=X1+1 AND
COUNT(MACD<0,X1+1)<=2;
X3:=REF(X2,1) AND MACD>REF(MACD,1) AND C>O AND C>REF(C,1); STICKLINE(X1=0 AND MACD>0,MACD,0,2,0),COLORDCDC00;{MACD缩头} STICKLINE(X3,MACD,0,2,0),COLOR0854FF;{二次起动};
DRAWICON(佛手,-0.15,11);
二次翻红:(FH3 OR FH4 OR FH5),COLORRED,NODRAW;
低买:CROSS(DIF,DEA) AND DIF<0,COLORFF00FF,NODRAW;
加油:CROSS(DIF,DEA) AND DIF>0,COLORYELLOW,NODRAW; DRAWICON(二次翻红,-0.05,1);
DRAWTEXT(二次翻红,-0.15,'↖翻红'),COLORRED;
DRAWTEXT(CROSS(DIF,DEA) AND DIF<0,DEA-0.02,'↖低买'),COLORFF00FF; DRAWTEXT(CROSS(DIF,DEA) AND DIF>0,DEA-0.05,'↖加油'),COLORYELLOW; XG:二次翻红OR 低买OR 加油,NODRAW;
YLZC:=IF(CLOSE=INDEXC,(INDEXC+INDEXH+INDEXL+INDEXO)/4,AMOUNT/ (VOL+0.01)/100);
阻价:=IF(CLOSE=INDEXC,YLZC+INDEXC-INDEXL,YLZC+(CLOSE-LOW));
支价:=IF(CLOSE=INDEXC,INDEXL+INDEXC-YLZC,LOW+(CLOSE-YLZC));
今压:REF(阻价,1),LINETHICK0,COLORAA11BB,NODRAW;
今撑:REF(支价,1),LINETHICK0,COLOR009900,NODRAW;
明压:阻价,LINETHICK0,NODRAW;
明撑:支价,LINETHICK0,NODRAW;
DIFF:DIF,COLORRED,LINETHICK2;
DDEA:DEA,COLORYELLOW,LINETHICK2;。

相关文档
最新文档