投股票网 www.tou18.cn [今日股市行情 股市在线查询 股票大盘行情] 股市有风险 投资需谨慎 手机APP下载 | 手机访问 | 加入收藏 | 保存到桌面
投股票网
今日股市行情 股市在线查询 股票大盘行情
个股查询: 资金行情 DDX查询 大智慧超赢 同花顺DDE 千股千评 最新提示 股票公告 投资要点 评级查询 大小非 股东 增发配股 股权 高管 股票概况
当前位置: 投股票网 > 股市公式下载 > 通达信公式
股市公式查询:

通达信优MACD指标公式

2021/1/30 19:20:18

{标准公式}
{DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;}
{MACD调整参数}
{DIFF:EMA(CLOSE,7)-EMA(CLOSE,19),COLORWHITE;}
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORWHITE;
DEA:EMA(DIFF,9),COLORYELLOW;
MACD:(DIFF-DEA)*2,COLORSTICK;
{牛眼}
MA1:=MA(C,5);
MA2:=MA(C,10);
MA3:=MA(C,20);
MA6:=MA(C,30);
MA4:=MA(C,40);
MA5:=MA(C,60);
牛眼:(MA1>REF(MA1,1) AND C>MA2 AND C>MA5 AND MA1>MA5 AND MA2>MA5
AND CROSS(MA1,MA2) AND DIFF>REF(DIFF,1) AND MA5>REF(MA5,1) AND MA4>REF(MA4,1)
AND MA5>REF(MA5,2) AND V>REF(V,1)*1.6),NODRAW,COLORYELLOW;
{JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
牛眼:=CROSS(DIFF,DEA) AND DEA<0 AND V>REF(V,1)*2) AND COUNT(JCCOUNT=N,22)=1;}
{画图标}
DRAWICON(牛眼,-0.01,38);
DRAWTEXT(牛眼,-0.02,'牛眼'),COLORYELLOW;
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));
{指标底背标示}
{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;
{STICKLINE(B1>0,-0.1,0,2,0),COLORRED;}
STICKLINE(B2>0,-0.1,0,1,0),COLORFF00FF;
STICKLINE(B3>0,-0.1,0,1,0),COLORYELLOW;
{指标顶背标示}
{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;
{STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;}
STICKLINE(D2>0,0.1,0,1,0),COLORFFCC66;
STICKLINE(D3>0,0.1,0,1,0),COLORWHITE;
{画图标}
{DRAWICON(D2>0,0,2);
DRAWICON(D3>0,0,2);}
{画变色线}
{STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORRED;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORYELLOW;
STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORCYAN;
STICKLINE(MACD>=REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORMAGENTA;
STICKLINE(C>0,0,0,50,1),COLORBLUE;
NOTEXT强:IF(DIFF>MA(DIFF,2),DIFF,DRAWNULL),COLORRED;
NOTEXT弱:IF(DEA>MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA;}
{VARA1:=(DVOL/C)/2,NODRAW;
VARA2:=SUM(IF(VARA1>100 AND CLOSE>REF(CLOSE,1),VARA1,0),0);
VARA3:=SUM(IF(VARA1>100 AND CLOSE<REF(CLOSE,1),VARA1,0),0);
VARA4:=SUM(IF(VARA1<100 AND CLOSE>REF(CLOSE,1),VARA1,0),0);
VARA5:=SUM(IF(VARA1<100 AND CLOSE<REF(CLOSE,1),VARA1,0),0);
VARA6:=VARA2+VARA3+VARA4+VARA5;
机买:=(VARA2/VARA6)*100,LINETHICK2,COLORRED;
机卖:=(VARA3/VARA6)*100,LINETHICK2,COLORGREEN;
主力差:=机买-机卖,LINETHICK2,NODRAW;
强度:主力差-REF(主力差,1),NODRAW,COLORYELLOW;
STICKLINE(强度>1.5,-0.1,0,2,0),COLORYELLOW;
近期:BARSLAST(强度>1.5),NODRAW,COLORGRAY;}
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
{STICKLINE(低位金叉,0,-0.18,2,0),COLORYELLOW;}
{DRAWTEXT(低位金叉,DEA-0.02,' 低位金叉'),COLORYELLOW;}
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
{STICKLINE(二次金叉,0,-0.18,2,0),COLORFF00FF;}
{DRAWICON(二次金叉,DEA*0.02,13); }
DRAWTEXT(二次金叉,DEA-0.03,' 二次金叉'),COLORWHITE;
{自动画线}
AB1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,AB1+1)>CLOSE AND DIFF>REF(DIFF,AB1+1) AND CROSS(DIFF,DEA);
{STICKLINE(底背离,0,0.13,2,0),COLOR00FF00;}
DRAWLINE(AB1=0,DEA,底背离,DEA,0),COLORRED,DOTLINE,LINETHICK1;
DRAWTEXT(底背离,DEA+0.05,' 底背离'),COLORRED;
AB2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,AB2+1)<CLOSE AND REF(DIFF,AB2+1)>DIFF AND CROSS(DEA,DIFF);
DRAWLINE(AB2=0,DEA,顶背离,DEA,0),COLORGREEN,DOTLINE,LINETHICK1;
DRAWTEXT(顶背离,DEA-0.02,' 顶背离'),COLORLIGREEN;
{N:=7{2,100}
{M:=5{2,100}
{VAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80;
B:=SMA(VAR1,N,1);
VAR2:=SMA(B,M,1);
短买:CROSS(B,VAR2) AND B<40,NODRAW,COLORRED;
DRAWICON(短买,0,11);};
{高送转提示}
DRAWTEXT_FIX(1,0.00,0,0,'送转分红:'),COLORGRAY;
DRAWTEXT_FIX(1,0.10,0,0,EXTERNSTR(0,11)),COLORLIGRAY;
N:=BARSLAST(CROSS(DEA,0));
VAR1:=LLV(DEA,N-2)>0 AND SUM(IF(REF(CROSS(DEA,DIFF),1),1,0),N)=0 AND CROSS
(DEA,DIFF);
N1:=BARSLAST(VAR1);
VAR2:=LLV(DEA,N-2)>0 AND SUM(IF(REF(CROSS(DEA,DIFF),1),1,0),N)=1 AND CROSS
(DEA,DIFF);
N2:=BARSLAST(VAR2);
减持:=VAR2 AND REF(DEA,N2+1)>REF(DEA,N1+1);
大减:=VAR2 AND REF(DEA,N2+1)<REF(DEA,N1+1) AND REF(C,N2+1)<REF(C,N1+1);
清仓:=VAR2 AND REF(DEA,N2+1)<REF(DEA,N1+1) AND REF(C,N2+1)>REF(C,N1+1);
BB1:=减持 OR 大减 OR 清仓;
DRAWTEXT(减持,DEA+0.02,'减持'),COLORGREEN;
DRAWTEXT(大减,DEA+0.02,'大减'),COLORCYAN;
DRAWTEXT(清仓,DEA+0.02,'清仓');
小N:BARSLAST(BB1),NODRAW;
YQXC:=SUM(IF(CROSS(0,DEA),1,0),小N)=1;
NN:BARSLAST(CROSS(0,DEA)),NODRAW;
VARB1:=HHV(DEA,NN-2)<0 AND SUM(IF(REF(CROSS(DIFF,DEA),1),1,0),NN)=0 AND CROSS
(DIFF,DEA);
NN1:BARSLAST(VARB1),NODRAW;
VARB2:=HHV(DEA,NN-2)<0 AND SUM(IF(REF(CROSS(DIFF,DEA),1),1,0),NN)=1 AND CROSS
(DIFF,DEA);
NN2:BARSLAST(VARB2),NODRAW;
增持:=VARB1 AND YQXC=1;
全仓:=VARB2 AND REF(DEA,NN2+1)>REF(DEA,NN1+1) AND YQXC=1;
开仓:=IF(全仓,0,VARB2 AND REF(DEA,NN2+1)>REF(DEA,NN1+1));
DRAWTEXT(增持,DEA-0.05,'增持'),COLORRED;
DRAWTEXT(全仓,DEA-0.05,'全仓'),COLORMAGENTA;
DRAWTEXT(开仓,DEA-0.05,'开仓'),COLORYELLOW;

投股票 网 www.tou18. cn

股市公式下载推荐
投股票网股市查询:资金行情查询 实时DDX查询 大智慧超赢 千股千评 最新提示 股票公告 投资要点 评级查询 股东查询 增发配股查询 股权结构查询
*ST金洲 000587+3.53% 评股 实时DDX 大智慧 最新消息 题材分析 股权
*ST华英 002321+3.52% 评股 实时DDX 大智慧 最新消息 题材分析 股权
嘉元科技 688388+3.51% 评股 实时DDX 大智慧 最新消息 题材分析 股权
北京君正 300223+3.51% 评股 实时DDX 大智慧 最新消息 题材分析 股权
*ST勤上 002638+3.51% 评股 实时DDX 大智慧 最新消息 题材分析 股权
先导智能 300450+3.50% 评股 实时DDX 大智慧 最新消息 题材分析 股权
四方达 300179+3.49% 评股 实时DDX 大智慧 最新消息 题材分析 股权
亿通科技 300211+3.47% 评股 实时DDX 大智慧 最新消息 题材分析 股权
成都银行 601838+3.46% 评股 实时DDX 大智慧 最新消息 题材分析 股权
西藏城投 600773+3.46% 评股 实时DDX 大智慧 最新消息 题材分析 股权
联系我们:nmsy8@hotmail.com 友情链接 要求相关的财经股票网站 今日股市行情在线查询
本站不推荐任何股票,站内广告不代表投股票网的观点,由此引起的一切法律责任均与本站无关,请网民自行判断真假,谨防网上股票预测诈骗!
本站所有内容仅供参考,不构成投资建议,据此操作,风险自担。本站不为所提供数据的错误或因依此信息所采取的任何行为负责。
手机版(手机访问当前页面) | 手机APP下载 | 电脑端(适合电脑或大屏用户) | 备案号:沪ICP备2024045114号-120