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

通达信小鱼MACD指标公式

2020/8/16 18:26:06

SHORT:=12;
LONG:=26;
MID:=9;
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID),COLOR888888;
{NOTEXT1:IF(DIF>-0.4, DIF,DRAWNULL),COLORRED;
NOTEXT2:IF(DIF>0 AND DIF<REF(DIF,1), DIF,DRAWNULL),COLORGREEN;
NOTEXT3:IF(DIF<0 AND DIF>REF(DIF,1), DIF,DRAWNULL),COLORFF00FF;
NOTEXT4:IF(DIF<0 AND DIF<REF(DIF,1), DIF,DRAWNULL),COLORWHITE;}
NOTEXT5:IF(DIF>=DEA, DIF,DRAWNULL),COLORRED;
NOTEXT6:IF(DIF<DEA, DIF,DRAWNULL),COLORWHITE;
AT1:=BARSLAST(REF(CROSS(DIF,DEA),1));
BT1:=REF(C,AT1+1)>C AND REF(DIF,AT1+1)<DIF AND CROSS(DIF,DEA);
AT2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
CT1:=BARSLAST(REF(CROSS(DEA,DIF),1));
DT1:=REF(C,CT1+1)<C AND REF(DIF,CT1+1)>DIF AND CROSS(DEA,DIF);
MACD底背:IF(BT1>0,-0.1,0),COLORRED;
MACD顶背:IF(DT1>0,0.1,0),COLOR00FF00;
STICKLINE(BT1>0,0.5*DIF,0,2,0),COLORRED;
STICKLINE(DT1>0,0.5*DIF,0,2,0),COLOR00FF00;
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;
M1:=13;
M2:=13;
A1:=REF(DIF,M1)=HHV(DIF,2*M1+1);
B1:=FILTER(A1,M1);
C1:=BACKSET(B1,M1+1);
D1:=FILTER(C1,M1);
E1:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);
F1:=E1>REF(E1,1);
A2:=REF(DIF,M2)=LLV(DIF,2*M2+1);
B2:=FILTER(A2,M2);
C2:=BACKSET(B2,M2+1);
D2:=FILTER(C2,M2);
E2:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
F2:=E2>REF(E2,1);
压力线:DRAWLINE(D1,DIF,F1,DIF,0),COLORFFFF00,DOTLINE;
支撑线:DRAWLINE(D2,DIF,F2,DIF,0),COLOR00AAFF,DOTLINE;
G3:=FILTERX(支撑线>REF(支撑线,1) && DIF>支撑线 && REF(支撑线,1)=REF(DIF,1),2);
底抬高:DRAWLINE(D2,DIF,G3,支撑线,0),COLORYELLOW,DOTLINE;
{画趋势线}
M:=INTPART(3*10/5);
A12:=REF(DIF,M)=HHV(DIF,2*M+1);
B12:=FILTER(A12,M);
C12:=BACKSET(B12,M+1);
D12:=FILTER(C12,M);
R112:=BACKSET(ISLASTBAR,BARSLAST(D12)+1);
S112:=R112>REF(R112,1);
AL12:=REF(DIF,M)=LLV(DIF,2*M+1);
BL12:=FILTER(AL12,M);
CL12:=BACKSET(BL12,M+1);
DL12:=FILTER(CL12,M);
RL112:=BACKSET(ISLASTBAR,BARSLAST(DL12)+1);
SL112:=RL112>REF(RL112,1);
短压线:DRAWLINE(D12,DIF,S112,DIF,0),COLOR99FF00,DOTLINE;
短撑线:DRAWLINE(DL12,DIF,SL112,DIF,0),COLOR0055FF,DOTLINE;
VARX2:=LLV(DEA,43);
VARX3:=DEA-(DIF-DEA);
低点线:=IF(DIF<VARX2 AND DEA=VARX2,MIN(HHV(VARX2,10),VARX3),VARX2);
VL:=REF(LOW,1);
VAR12:=(SMA(ABS(LOW-VL),13,1))/(SMA(MAX(LOW-VL,0),13,1))*100;
VAR14:=MA(VAR12,13);
VAR15:=LLV(LOW,34);
VAR18:=EMA(IF(LOW<=VAR15,VAR14,0),3);
VAR110:=SMA(SMA((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,7,1),5,1);
VAR111:=SMA((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,8,1)*15-VAR110*10.38;
T:=FILTER(IF(VAR111<=VAR110 AND VAR18>0,VAR18*8,0),5);
止跌:DRAWTEXT(T AND DIF<低点线,DIF*1.01,'止跌'),COLORYELLOW;
{形态}
A:=IF(CROSS(0,DEA),1,0);
A11:=IF(DIF<0 AND CROSS(DIF,DEA),1,0);
SS:=IF(A,SUM(A11,0),0);
SSB:=HHV(SS,0);
SSS:=SUM(A11,0);
W底:=SSS-SSB=2 AND SSS>REF(SSS,1);
DRAWTEXT(W底,DIF,'↖W底'),COLOR0080FF;
MACD金叉:=CROSS(MACD,DIF) AND MACD>=(0-0.05) AND MACD<=0.02;
DRAWTEXT(MACD金叉,MACD,'-MACD金叉'),COLOR00FFFF;
低位金叉:=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;
DRAWTEXT(二次金叉,0.01,'二次金叉'),COLOR5500FF;
AA11:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,AA11+1)>CLOSE AND DIF>REF(DIF,AA11+1) AND CROSS(DIF,DEA);
底背:DRAWLINE(AA11=0,DIF,底背离,DIF,0),COLORYELLOW,LINETHICK2;
AA22:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,AA22+1)<CLOSE AND REF(DIF,AA22+1)>DIF AND CROSS(DEA,DIF);
顶背:DRAWLINE(AA22=0,DIF,顶背离,DIF,0),COLORGREEN,LINETHICK2;
DRAWTEXT(底背离,DIF*0.5,'-DIF底背'),COLOR0055FF;
DRAWTEXT(顶背离,DIF*0.5,'-DIF顶背'),COLOR99FF00;
{小周期}
N:=3;
DIF3_6.5F:=(EMA(CLOSE,3)-(EMA(CLOSE,6)+EMA(CLOSE,7))/2);
DEA3_6.5F:=(EMA(DIF3_6.5F,3)+EMA(DIF3_6.5,2));
AA:=REF(DIF3_6.5F,N)=HHV(DIF3_6.5F,2*N+1);
CC:=FILTER(BB,N) AND DIF3_6.5F=HHV(DIF3_6.5F,N+1);
AX1:=BARSLAST(REF(CC,1));
小顶背离:=REF(CLOSE,AX1+1)<CLOSE AND REF(DIF3_6.5F,AX1+1)>DIF3_6.5F AND CC;
DRAWTEXT(小顶背离,DIF3_6.5F*1.2,'-小顶背离'),COLORGREEN;
DRAWICON(小顶背离>0,DIF3_6.5F*1.2,2);
AAA2:=REF(DIF3_6.5F,N)=LLV(DIF3_6.5F,2*N+1);
BBB2:=BACKSET(AAA2,N+1);
CCC2:=FILTER(BBB2,N) AND DIF3_6.5F=LLV(DIF3_6.5F,N+1);
AX2:=BARSLAST(REF(CCC2,1));
小底背离:=REF(CLOSE,AX2+1)>CLOSE AND REF(DIF3_6.5F,AX2+1)<DIF3_6.5F;
{画白柱线}
VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1);
VA2:=CROSS(BACKSET(CROSS(0,MACD),REF(VA1,1)+2),0.5);
QG:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(VA1,1)+2),0.5);
前高:=DRAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1),COLORMAGENTA;
VA3:=LLVBARS(MACD,BARSLAST(MACD>0)+1);
VA4:=CROSS(BACKSET(CROSS(MACD,0),REF(VA3,1)+2),0.5);
前低:=DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1);
BD:=BARSLAST(FILTERX(CROSS(0,MACD),BARSCOUNT(C)));
BDTJ:=IF(MACD<0,FILTERX(MACD=LLV(MACD,BARSLAST(MACD>0)),
BARSCOUNT(C)),DRAWNULL);
TSBDTJ:=BARSLAST(BDTJ);
BDZH:=FILTERX(MACD<CONST(LLV(MACD,BD+1)),BARSCOUNT(C));
BDTS:=BARSLAST(BDZH);
本低:=IF(BD+1>=1,CONST(LLV(MACD,BD+1)),DRAWNULL);
BDCL:=CROSS(COUNT(CROSS(MACD>本低/2 AND MACD<0,0.5),TSBDTJ)=1,0.5) AND TSBDTJ>=0;
终点:=IF(ISLASTBAR AND MACD>0 AND MACD=HHV(MACD,BARSLAST(MACD<0)),1,
IF(FILTERX(QG,BARSCOUNT(C)),2,DRAWNULL));
UU:=(终点=1 OR 终点=2) AND MACD>0;
ZZ:=FILTERX(UU,BARSCOUNT(C));
本高:=DRAWLINE(ZZ,MACD,REF(ZZ,1),REF(MACD,1),1),COLORWHITE;
WQG:=CROSS(COUNT(CROSS(MACD<本高/2 AND MACD>0,0.5),ZZ)=1,0.5) AND ZZ>=0;
STICKLINE(MACD>前高,MACD,前高,0,0),COLORFFFFFF;
STICKLINE(MACD<0 AND MACD<前低 AND 前低<0,MACD,前低,0,0),COLORFFFFFF;
DRAWICON(CROSS(DIF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIF),DEA,2);
底:ABS((CROSS("MACD.DIF","MACD.DEA")&&"MACD.DEA"<=-0.07)*"MACD.DIF")*1.50,COLORLIMAGENTA;
DRAWTEXT(ABS(底)>0,底*1.20,'底'),COLORYELLOW;

投股票 网 w ww.tou18.cn

股市公式下载推荐
投股票网股市查询:资金行情查询 实时DDX查询 大智慧超赢 千股千评 最新提示 股票公告 投资要点 评级查询 股东查询 增发配股查询 股权结构查询
佛塑科技 000973+2.76% 评股 实时DDX 大智慧 最新消息 题材分析 股权
福昕软件 688095+2.75% 评股 实时DDX 大智慧 最新消息 题材分析 股权
中亚股份 300512+2.75% 评股 实时DDX 大智慧 最新消息 题材分析 股权
金富科技 003018+2.75% 评股 实时DDX 大智慧 最新消息 题材分析 股权
南都电源 300068+2.75% 评股 实时DDX 大智慧 最新消息 题材分析 股权
宇新股份 002986+2.74% 评股 实时DDX 大智慧 最新消息 题材分析 股权
温州宏丰 300283+2.74% 评股 实时DDX 大智慧 最新消息 题材分析 股权
天孚通信 300394+2.72% 评股 实时DDX 大智慧 最新消息 题材分析 股权
硅宝科技 300019+2.72% 评股 实时DDX 大智慧 最新消息 题材分析 股权
正丹股份 300641+2.72% 评股 实时DDX 大智慧 最新消息 题材分析 股权
联系我们:nmsy8@hotmail.com 友情链接 要求相关的财经股票网站 今日股市行情在线查询
本站不推荐任何股票,站内广告不代表投股票网的观点,由此引起的一切法律责任均与本站无关,请网民自行判断真假,谨防网上股票预测诈骗!
本站所有内容仅供参考,不构成投资建议,据此操作,风险自担。本站不为所提供数据的错误或因依此信息所采取的任何行为负责。
手机版(手机访问当前页面) | 手机APP下载 | 电脑端(适合电脑或大屏用户) | 备案号:沪ICP备2024045114号-120