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

通达信简单明了MACD指标公式

2020/8/20 18:49:29

DIFF:=(EMA(CLOSE,12) - EMA(CLOSE,26));
DEA:=EMA(DIFF,9);
MACD2:=(2 * (DIFF - DEA));
DU0:=CROSS(DIFF,0);
UD0:=CROSS(0,DIFF);
TDU0:=BARSLAST(DU0);
TUD0:=BARSLAST(UD0);
DU3:=REF(DU0,1);
UD3:=REF(UD0,1);
TDU3:=BARSLAST(DU3);
TUD3:=BARSLAST(UD3);
UDGLINE:=IF((TDU3 < TUD3),REF(HHV(HIGH,2),TDU3),REF(LLV(LOW,2),TUD3));
JDU0:=(((REF(CLOSE,1) <= REF(UDGLINE,1)) AND (CLOSE > UDGLINE)) AND (TDU0 < TUD0));
JUD0:=(((REF(CLOSE,1) >= REF(UDGLINE,1)) AND (CLOSE < UDGLINE)) AND (TUD0 < TDU0));
JDU1:=(JDU0 AND (COUNT(JDU0,TDU0) = 1));
JUD1:=(JUD0 AND (COUNT(JUD0,TUD0) = 1));
JDU2:=(JDU1 AND (REF(BARSLAST(JUD1),1) < REF(BARSLAST(JDU1),1)));
JUD2:=(JUD1 AND (REF(BARSLAST(JUD1),1) > REF(BARSLAST(JDU1),1)));
JDU3:=(JDU1 AND (REF(BARSLAST(JUD1),1) > REF(BARSLAST(JDU1),1)));
JUD3:=(JUD1 AND (REF(BARSLAST(JUD1),1) < REF(BARSLAST(JDU1),1)));
BSLINE:=IF((BARSLAST(JDU2) < BARSLAST(JUD2)),IF(REF(CROSS(0,MACD2),1),LLV(LOW,2),REF(LLV(LOW,2),BARSLAST(REF(CROSS(0,MACD2),1)))),IF(REF(CROSS(MACD2,0),1),HHV(HIGH,2),REF(HHV(HIGH,2),BARSLAST(REF(CROSS(MACD2,0),1)))));
DRAWICON((JDU1 OR (BARSLAST(JDU1) < BARSLAST(JUD1))),0, 0) ;
DRAWICON((JUD1 OR (BARSLAST(JDU1) > BARSLAST(JUD1))),0,0) ;
STICKLINE((MACD2 >= 0),0,MACD2,2,1),COLORRED ;
STICKLINE(((MACD2 >= 0) AND (MACD2 < REF(MACD2,1))),0,MACD2,2,0),COLORRED;
STICKLINE((MACD2 < 0),0,MACD2,2,0),COLORFFFF00;
STICKLINE(((MACD2 < 0) AND (MACD2 > REF(MACD2,1))),0,MACD2,2,1),COLORFFFF00;
DIF:DIFF,LINETHICK1,COLORYELLOW ;
MACD:DEA ,COLORLIMAGENTA ;
DEF:MACD2,LINETHICK0,COLORFFFF00 ;
STICKLINE((CLOSE > 0),0,0,0 ,0) ;
DEFUT:=BARSLAST(CROSS(MACD2,0));
DEFDT:=BARSLAST(CROSS(0,MACD2));
DEFUL:=IF((MACD2 >= 0),HHV(MACD2,(DEFUT + 1)),REF(HHV(MACD2,(DEFUT + 1)),(DEFDT + 1)));
DEFDL:=IF((MACD2 < 0),LLV(MACD2,(DEFDT + 1)),REF(LLV(MACD2,(DEFDT + 1)),(DEFUT + 1)));
DEFU2L:=REF(DEFUL,(DEFUT + 1));
DEFD2L:=REF(DEFDL,(DEFDT + 1));
{DRAWICON(((((LLV(MACD2,4) > 0) AND (MACD2 < REF(MACD2,1))) AND (REF(MACD2,1) > REF(MACD2,2))) AND (REF(MACD2,2) > REF(MACD2,3))),MACD2,2) ;
DRAWICON(((((HHV(MACD2,4) < 0) AND (MACD2 > REF(MACD2,1))) AND (REF(MACD2,1) < REF(MACD2,2))) AND (REF(MACD2,2) < REF(MACD2,3))),MACD2,1);
DRAWICON(((((JUD1 OR (BARSLAST(JDU1) > BARSLAST(JUD1))) AND (MACD2 >= 0)) AND (REF(MACD2,1) < REF(DEFU2L,1))) AND (MACD2 > DEFU2L)),MACD2,12) ;
DRAWICON(((((JDU1 OR (BARSLAST(JDU1) < BARSLAST(JUD1))) AND (MACD2 < 0)) AND (REF(MACD2,1) > REF(DEFD2L,1))) AND (MACD2 < DEFD2L)),MACD2,12);}
{MACD}
_红柱:=IF("MACD.MACD">REF("MACD.MACD",1),"MACD.MACD",DRAWNULL),STICK,COLORRED;
绿柱:=IF("MACD.MACD"<REF("MACD.MACD",1),"MACD.MACD",DRAWNULL),STICK,COLORYELLOW;
_抄底:=ABS((CROSS("MACD.DIF","MACD.DEA")
&&"MACD.DEA"<=-0.07)*"MACD.DIF")*1.50,COLORLIMAGENTA;
_DIF:="MACD.DIF",COLORWHITE;
_DEA:="MACD.DEA",COLORYELLOW;
__强度:=IF(_DIF>_DEA,_DIF,DRAWNULL),COLORRED,LINETHICK2;
_强度:=IF(_DEA<_DIF,_DEA,DRAWNULL),COLORMAGENTA,LINETHICK2;
DRAWTEXT(ABS(_抄底)>0,_抄底*1.20,' 抄底'),COLORYELLOW;
{DRAWICON(ABS(_抄底)>0,_抄底*1.10,4);}
DRAWICON(CROSS(_DIF,_DEA),_DEA,1);
DRAWICON(CROSS(_DEA,_DIF),_DEA,2);
A111:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));
B1:=REF(C,A111+1)>C AND REF("MACD.DIF",A111+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA");
DRAWTEXT(B1>0,_DIF*0.95,'MACD'),COLORRED;{MACD底背离};
C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));
D1:=REF(C,C1+1)<C AND REF("MACD.DIF",C1+1)>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF");
DRAWTEXT(D1>0,_DEA*1.05,'MACD'),COLORWHITE;{MACD顶背离};
净资产增长率:FINANCE(33)/FINANCE(34),NODRAW;
每股收益:FINANCE(33),NODRAW;
公积金:FINANCE(18),NODRAW;
未分利润:FINANCE(32),NODRAW;
净资产:FINANCE(34),NODRAW;
流通股:FINANCE(7)/100000000,NODRAW;
总股本:FINANCE(1)/100000000,NODRAW;
市净率PB:C/FINANCE(34),NODRAW;
市盈率PE:C/FINANCE(33),NODRAW;
现金流:FINANCE(26)/100000000,NODRAW;
换手率:V*100/CAPITAL,NODRAW;
换手率20:SUM(V*100,20)/CAPITAL,NODRAW;
换手率60:SUM(V*100,60)/CAPITAL,NODRAW;
{现金流:FINANCE(26)/100000000,NODRAW;
营业利润:FINANCE(23)/100000000,NODRAW;
利润总额:FINANCE(28)/100000000,NODRAW;
净资产:FINANCE(34),NODRAW;
流通股:FINANCE(7)/100000000,NODRAW;
总股本:FINANCE(1)/100000000,NODRAW;};
{MACD四线趋势}
{DIFF2:EMA(CLOSE,30)-EMA(CLOSE,60);
DEA2:EMA(DIFF2,15);
MACD3:=3*(DIFF2-DEA2);
{STICKLINE(MACD3<REF(MACD3,1) AND MACD3>0,0,MACD3,1,0),COLORYELLOW;
STICKLINE(MACD3>=REF(MACD3,1)AND MACD3>0,0,MACD3,1,0),COLORRED; }
{STICKLINE(MACD3>REF(MACD3,1)AND MACD3<0,0,MACD3,1,0),COLORFFC8FF;
STICKLINE(MACD3<=REF(MACD3,1)AND MACD3<0,0,MACD3,1,0),COLORFFCC66;}
{DIF3:EMA(CLOSE,9)-EMA(CLOSE,18),LINETHICK2;
DEA3:EMA(DIF3,7),LINETHICK2;}
{下穿:=COUNT(DEA<=0,5)=1 AND DEA<=0;
上穿:=COUNT(DEA>=0,5)=1 AND DEA>=0;
DRAWTEXT(下穿,LOW*0.1,'↓'),COLORYELLOW;
DRAWTEXT(上穿,LOW*0.1,'↑'),COLOR0000FF;
日线空头:IF(DEA<0,1,0);};

投股 票网 www.tou 18.cn

股市公式下载推荐
投股票网股市查询:资金行情查询 实时DDX查询 大智慧超赢 千股千评 最新提示 股票公告 投资要点 评级查询 股东查询 增发配股查询 股权结构查询
泛亚微透 688386+5.49% 评股 实时DDX 大智慧 最新消息 题材分析 股权
明微电子 688699+5.47% 评股 实时DDX 大智慧 最新消息 题材分析 股权
清溢光电 688138+5.47% 评股 实时DDX 大智慧 最新消息 题材分析 股权
奥特迅 002227+5.46% 评股 实时DDX 大智慧 最新消息 题材分析 股权
万泰生物 603392+5.45% 评股 实时DDX 大智慧 最新消息 题材分析 股权
海南椰岛 600238+5.42% 评股 实时DDX 大智慧 最新消息 题材分析 股权
龙蟒佰利 002601+5.40% 评股 实时DDX 大智慧 最新消息 题材分析 股权
中公教育 002607+5.40% 评股 实时DDX 大智慧 最新消息 题材分析 股权
银禧科技 300221+5.38% 评股 实时DDX 大智慧 最新消息 题材分析 股权
振芯科技 300101+5.36% 评股 实时DDX 大智慧 最新消息 题材分析 股权
联系我们:nmsy8@hotmail.com 友情链接 要求相关的财经股票网站 今日股市行情在线查询
本站不推荐任何股票,站内广告不代表投股票网的观点,由此引起的一切法律责任均与本站无关,请网民自行判断真假,谨防网上股票预测诈骗!
本站所有内容仅供参考,不构成投资建议,据此操作,风险自担。本站不为所提供数据的错误或因依此信息所采取的任何行为负责。
手机版(手机访问当前页面) | 手机APP下载 | 电脑端(适合电脑或大屏用户) | 备案号:沪ICP备2024045114号-120