股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 「指标」MACD指标模板副图指标 通达信 贴图


    [-----复制链接-----]

22万

主题

22万

帖子

14

精华

积分
11042
楼主
2024-1-27 22:25:19
【资料名称】:MACD指标模板副图指标 通达信 贴图介绍
【资料描述】:

MACD指标模板副图指标 通达信 贴图

附件包含2个副图指标,今天下午进行优化。


金叉共振副图源码:
DIF:(EMA(CLOSE,12)-EMA(CLOSE,26))*100;
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
DRAWICON(CROSS(DIF,DEA),DEA,25);
DRAWICON(CROSS(DEA,DIF),DEA,21);
IF(DIF<DEA,DIF,DRAWNULL),COLORGREEN;
DD:=C=HHV(C,180);
EE:=DEA< REF(DEA,1) AND REF(DEA< REF(DEA,1),1)=1;
CC:=C> REF(C,1) AND REF(C> REF(C,1),1)=1;
顶背离:=(DD AND EE AND DEA< HHV(DEA,180))*DEA;
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,LINETHICK2;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,9,3),COLORYELLOW;
D:SMA(K,9,3),COLORWHITE;
J:3*K-2*D,COLORMAGENTA;
IF(J<D,J,DRAWNULL),COLORGREEN;
0,COLORWHITE,LINETHICK2;
20,COLORRED;
{50,COLORWHITE;}
80,COLORYELLOW;
100,COLORGREEN,LINETHICK2;
DRAWTEXT(ISLASTBAR,0,'0'),COLORWHITE;
DRAWTEXT(ISLASTBAR,20,'20'),COLORRED;
DRAWTEXT(ISLASTBAR,80,'80'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,100,'100'),COLORGREEN;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIF,A1+1)<DIF AND CROSS(DIF,DEA);
A22:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(C,A22+1)>C AND REF("KDJ.K"(9,3,3),A22+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));
{DRAWTEXT(B1,DEA-0.20,'▲MACD底背'),COLORWHITE;
DRAWTEXT(B2,D-0.20,'●KDJ底背'),COLORWHITE;}
DJ:=CROSS(J,D) AND D<20;
DRAWTEXT(DJ,J-0.3,'低金叉'),COLORCYAN;
MDJ:=CROSS(DIF,DEA) AND DEA<0;
DRAWTEXT(MDJ,DEA-0.3,'低金叉'),COLORCYAN;
{DRAWTEXT(CROSS(DEA,DIF),DIF+0.3,'死叉'),COLORGREEN;
DRAWTEXT(CROSS(D,J),J+0.3,'死叉'),COLORGREEN; }
A:=CROSS(DIF,DEA) AND CROSS(K,D) AND CROSS(J,D);
DRAWICON(A,-25,7);
B4:CROSS(DIF,DEA) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
DRAWTEXT(B4,-30,'★金叉共振'),COLORYELLOW;
DRAWICON(CROSS(K,D),D,30);
DRAWICON(CROSS(D,K),D,28);
BA:=DEA>REF(DEA,1);
BB:=SUM(BA,5)>=4;
BC:=C<O;
BD:=SUM(BC,5)>=2;
BXG:FILTER(BB AND BD AND J>REF(J,1) AND REF(J,1)<REF(J,2),3);
STICKLINE(BXG,HHV(J,60),HHV(J,60)-20,1,0),COLORRED;
SS:=EMA(C,11);
LL:=(EMA(C,1)+EMA(C,2)+EMA(C,3)+EMA(C,5))/4;
{短:EMA(LL,2),COLORGREEN,LINETHICK2;}
{长:EMA(SS,2),COLORMAGENTA,LINETHICK2;}
AA:=(C-LLV(C,10))/(HHV(C,10)-LLV(C,10));
(CROSS(AA,0.05)-1);



MACD顶底背离副图源码:
DIFF1:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA1:=EMA(DIFF1,9);
DRAWBAND(DEA1,DRAWNULL,DIFF1,RGB(250,0,0));
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORYELLOW;
DEA:EMA(DIFF,9),COLORCYAN;
MACD:2*(DIFF-DEA),COLORSTICK;
TR1:=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/TR;
MDI:=MDM*100/TR;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=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));
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,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
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底背A底:IF(B1>0,1,0),COLORRED,NODRAW;
KDJ底背B底:IF(B2>0,1,0),COLORFF00FF,NODRAW;
RSI底背C底:IF(B3>0,1,0),COLORYELLOW,NODRAW;
DMI底背D底:IF(B4>0,1,0),COLORBROWN,NODRAW;
MACD顶背A顶:IF(D1>0,1,0),COLOR00FF00,NODRAW;
KDJ顶背B顶:IF(D2>0,1,0),COLORFFCC66,NODRAW;
RSI顶背C顶:IF(D3>0,1,0),COLORWHITE,NODRAW;
DMI顶背D顶:IF(D4>0,1,0),COLORLIRED,NODRAW;
{以下两行是MACD顶底不能自动画线,有未来函数,放在大括号里,表示没有运行。如果需要运行,请把本行和大括号删除
DRAWLINE(A1=0,DEA,MACD底背,DEA,0),COLORRED,LINETHICK2;
DRAWLINE(A2=0,DEA,MACD顶背,DEA,0),COLOR00FF00,LINETHICK2;}
STICKLINE(B1>0,-0.1,0,2,0),COLORRED;
DRAWTEXT(B1>0,-0.2,'A底'),COLORGREEN;
STICKLINE(B2>0,-0.1,-0.2,2,0),COLORFF00FF;
DRAWTEXT(B2>0,-0.2,'B底'),COLORGREEN;
STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;
DRAWTEXT(B3>0,-0.2,'C底'),COLORGREEN;
STICKLINE(B4>0,-0.1,-0.2,2,0),COLORBROWN;
DRAWTEXT(B4>0,-0.2,'D底'),COLORGREEN;
STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;
DRAWTEXT(D1>0,0.2,'A顶'),COLORRED;
STICKLINE(D2>0,0.1,0.2,2,0),COLORFFCC66;
DRAWTEXT(D2>0,0.2,'B顶'),COLORRED;
STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;
DRAWTEXT(D3>0,0.2,'C顶'),COLORRED;
STICKLINE(D4>0,0.1,0.2,2,0),COLORLIRED;
DRAWTEXT(D4>0,0.2,'D顶'),COLORRED;







gd53448


【下载地址隐藏】:                    点:回复可见地址
游客,如果您要查看本帖隐藏内容请回复






上一篇:「指标」优化指标-最全135战法主图指标 通达信 贴图
下一篇:「指标」趋势线主图指标 通达信 贴图
回复

举报

QQ|

GMT+8, 2024-11-24 14:44

快速回复 返回顶部 返回列表