通达信MACD顶底指标副图源码
DEA:MACD.DEA,COLORYELLOW;
强度1:IF(DEA< DIF,DEA,DRAWNULL),COLORMAGENTA;
MACD2:=MACD;
S05:=SUM(MJ,0);
QXT:=BARSLAST(MJ>0 AND REF(MJ,1)< 0)+1;
ST:=IF(MJ>0,REF(QST,QXT)+QXT,REF(QXT,QST)+QST);
低位金叉:=CROSS(DIF,DEA) AND DIF< -0.1;
二次金叉:=CROSS(DIF,DEA) AND DEA< 0 AND COUNT(JCCOUNT=2,21)=1;
三次金叉:=CROSS(DIF,DEA) AND DEA< 0 AND COUNT(JCCOUNT=3,60)=1;
A002:=BARSLAST(REF(CROSS(DIF,DEA),1));
DRAWICON(LONGCROSS(CLOSE,MA(CLOSE,5),17),MACD2,1);
C81:=REF(C,1);
RSI1:=SMA(MAX(C-C81,0),RN,1)/SMA(ABS(C-C81),RN,1)*100;
STICKLINE(低点,0.1,0,0.3,0),COLORYELLOW;
DRAWTEXT(低点, 0.14,'←底'),COLORYELLOW;
DRAWICON(顶, DIF*1.15,2);
死叉:=CROSS(DEA,DIF);
N2:=REF(BARSLAST(死叉),N1+1),NODRAW;
CL1:=LLV(C,N1+1),NODRAW;
CL2:=REF(CL1,N1+1),NODRAW;
CL3:=REF(CL2,N1+1),NODRAW;
PDIFL2:=IF(DIFL2>0,INTPART(LOG(DIFL2))-1,INTPART(LOG(-DIFL2))-1);
PDIFL3:=IF(DIFL3>0,INTPART(LOG(DIFL3))-1,INTPART(LOG(-DIFL3))-1);
MDIFB2:=INTPART(DIF/POW(10,PDIFL2));
直接底背离:=(CL1< CL2 );
来函数检测结果如下:
该公式没有未来函数
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出DEA:MACD.DEA,画黄色
如果DEA< D返回DEA否则返回DRAWNULL
MACD2赋值:MACD
S05赋值:0的MJ日累和
QXT赋值:上次MJ>0 AND 1日前的MJ< 0距今天数+1
ST赋值:IF(MJ>0,QXT日前的QST+QXT,QST日前的QXT+QST)
低位金叉赋值:DIF上穿DEA AND DIF< -0.1
二次金叉赋值:DIF上穿DEA AND DEA< 0 AND 统计21日满足JC=2的天数=1
三次金叉赋值:DIF上穿DEA AND DEA< 0 AND 统计60日满足JC=3的天数=1
A002赋值:上次1日前的DIF上穿DEA距今天数
DRAWICON(LONGCROSS(收盘价,收盘价的5日简单移动平均,17),MACD2,1)
C81赋值:1日前的C
RSI1赋值:SMA(C-C81和0较大值,RN,1)/SMA(C-C81的绝对值,RN,1)*100
当满足条件低点时,在0.1和0之间画柱状线
当满足条件低点时,在 0.14和'←底'位置书写文字
当满足条件顶时,在 DIF*1.15和2之间画图标
死叉赋值:DEA上穿DIF
N2赋值:REF(上次死叉距今天数,N1+1),NODRAW
CL1赋值:N1+1日内C最低值,NODRAW
CL2赋值:N1+1日前的CL1,NODRAW
CL3赋值:N1+1日前的CL2,NODRAW
PDIFL2赋值:IF(DIFL2>0,INTPART(LOG(DIFL2))-1,INTPART(LOG(-DIFL2))-1)
PDIFL3赋值:IF(DIFL3>0,INTPART(LOG(DIFL3))-1,INTPART(LOG(-DIFL3))-1)
MDIFB2赋值:INTPART(DIF/POW(10,PDIFL2))
直接底背离赋值:(CL1< CL2 )
- QQ:88652583
- 邮箱:88652583@qq.com
- 工作时间:8:30-23:00
- 微信:88652583或扫描如下二维码
sitemap站点地图