通达信公式指标源码:MACD豪华版合集

时间:2019-09-05 21:28 文章来源:无道配资 点击次数::

原文标题:通达信公式指标源码:MACD豪华版合集


通达信公式指标源码:MACD豪华版合集 DIF:MACD.DIF,COLORLIGRAY; DEA:MACD.DEA,COLORYELLOW; 强度:IF(DIF>DEA,DIF,DRAWNULL),COLORRED; 强度1:IF(DEA<DIF,DEA,DRAWNULL),COLORMAGENTA; MACD:(DIF-DEA)*2,COLORSTI

通达信公式指标源码:MACD豪华版合集

复星医药600196股票最新价格

DIF:MACD.DIF,COLORLIGRAY;

DEA:MACD.DEA,COLORYELLOW;

强度:IF(DIF>DEA,DIF,DRAWNULL),COLORRED;

强度1:IF(DEA<DIF,DEA,DRAWNULL),COLORMAGENTA;

MACD:(DIF-DEA)*2,COLORSTICK;

MACD2:=MACD;

MJ:=MACD;

S05:=SUM(MJ,0);

QST:=BARSLAST(MJ<0 AND REF(MJ,1)>0)+1;

QXT:=BARSLAST(MJ>0 AND REF(MJ,1)<0)+1;

S5:=IF(MJ>0,S05-REF(S05,BARSLAST(MJ<0)),S05-REF(S05,BARSLAST(MJ>0)))/10;

ST:=IF(MJ>0,REF(QST,QXT)+QXT,REF(QXT,QST)+QST);

RS5:=REF(S5,ST);

低位金叉:=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;

DRAWICON(二次金叉,0,25);

三次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=3,60)=1;

DRAWICON(三次金叉,0,26);

A002:=BARSLAST(REF(CROSS(DIF,DEA),1));

底背离:=REF(CLOSE,A002+1)>CLOSE AND DIF>REF(DIF,A002+1) AND CROSS(DIF,DEA);

DRAWICON(LONGCROSS(CLOSE,MA(CLOSE,5),17),MACD2,1);

DRAWTEXT(二次金叉>低位金叉,DIF,'金2'),COLORRED;

{RSI买卖点-不需要的可以屏蔽}

C81:=REF(C,1);

RN:=9;

RSI1:=SMA(MAX(C-C81,0),RN,1)/SMA(ABS(C-C81),RN,1)*100;

低点:=CROSS(RSI1,20);

STICKLINE(低点,0.1,0,0.3,0),COLORYELLOW;

DRAWICON(低点, 0.15,1);

DRAWTEXT(低点, 0.14,'←底'),COLORYELLOW;

顶:=CROSS(80,RSI1);

DRAWICON(顶, DIF*1.15,2);

DRAWTEXT(顶, DIF*1.1,'←减/清仓'),COLORGREEN;

{定量结构}

{底部结构预警}

死叉:=CROSS(DEA,DIF);

N1:=BARSLAST(死叉),NODRAW;{最近一次死叉的位置}

N2:=REF(BARSLAST(死叉),N1+1),NODRAW;{倒数第二次死叉与倒数第一次死叉的区间}

N3:=REF(BARSLAST(死叉),N2+N1+2),NODRAW;{倒数第三次死叉与倒数第二次死叉的区间}

CL1:=LLV(C,N1+1),NODRAW;{最近一次死叉后,最低收盘价}

DIFL1:=LLV(DIF,N1+1),NODRAW;

CL2:=REF(CL1,N1+1),NODRAW;{倒数第二次死叉与倒数第一次死叉之间的最低收盘价}

DIFL2:=REF(DIFL1,N1+1),NODRAW;

CL3:=REF(CL2,N1+1),NODRAW;{倒数第三次死叉与倒数第二次死叉之间的最低收盘价}

DIFL3:=REF(DIFL2,N1+1),NODRAW;

PDIFL2:=IF(DIFL2>0,INTPART(LOG(DIFL2))-1,INTPART(LOG(-DIFL2))-1);

MDIFL2:=INTPART(DIFL2/POW(10,PDIFL2));

PDIFL3:=IF(DIFL3>0,INTPART(LOG(DIFL3))-1,INTPART(LOG(-DIFL3))-1);

MDIFL3:=INTPART(DIFL3/POW(10,PDIFL3));

MDIFB2:=INTPART(DIF/POW(10,PDIFL2));

MDIFB3:=INTPART(DIF/POW(10,PDIFL3));

直接底背离:=(CL1<CL2 ) AND (MDIFB2>MDIFL2) AND (MACD<0 AND REF(MACD,1)<0) AND MDIFB2<=REF(MDIFB2,1);

隔峰底背离:=(CL1<CL3 AND CL3<CL2 ) AND (MDIFB3>MDIFL3) AND (MACD<0 AND REF(MACD,1)<0) AND MDIFB3<=REF(MDIFB3,1);

本文由无道配资整理编辑发布,地址:http://wudaoseo.com/1345.html,转载请注明出处!

相关内容