牛,升级版MACD指标公式

  • 发布日期:2021-09-14 08:33    点击次数:57

 设本公多号为星标 】

(第暂时间用上益指标|投资路上有按照)

安设后如下图,友谊挑示(指标只是辅助,不作提出) 一切程序均为免费分享。

不会安设点击 《安设指南》望安设步骤

图片

图片

图片

DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);

DEA:=EMA(DIF,9);

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

红:STICKLINE(MACD>0,MACD,0,3,1),COLORRED;

绿:STICKLINE(MACD<0,MACD,0,3,1),COLORCYAN;

STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,1.22,1 ),COLOR00FF00;

STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2.0 ,1 ),COLORFF0000;

STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,1.1 ,1 ),COLORFFEE44;

VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1);

VA2:=CROSS(BACKSET(CROSS(0,MACD),REF(VA1,1)+2),0.5);

DRAWTEXT_FIX(1,0.82,0,0,'☆微信公多号:(程序化指标) ☆'),COLORRED;

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,DOTLINE;

VA3:=LLVBARS(MACD,BARSLAST(MACD>0)+1);

VA4:=CROSS(BACKSET(CROSS(MACD,0),REF(VA3,1)+2),0.5);

BD:=BARSLAST(FILTERX(CROSS(0,MACD),BARSCOUNT(C)));

前矮:DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1),CIRCLEDOT;

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;

横线:=CONST(REF(MACD,BARSLAST(ZZ)));

WW:=MACD>横线;

首首点:=FILTERX(REFX(BARSLAST(WW),1)=1,BARSCOUNT(C));

天数:BARSLAST(首首点),COLORYELLOW,NODRAW;

上横线:DRAWLINE(首首点,横线,ZZ,横线,0),COLORGREEN,DOTLINE;

下横线:DRAWLINE(BDZH,CONST(LLV(MACD,BD+1)),BDTJ=1,MACD,0),COLOR8080FF,DOTLINE;

DRAWNUMBER(BDTJ,CONST(LLV(MACD,BD+1))*0.9,BDTS);

DRAWNUMBER(ZZ,上横线*1.1,天数);

TJ:=IF(首首点,BARSNEXT(ZZ),DRAWNULL);

红柱数目:IF(天数>0 AND 天数<=REF(TJ,天数),SUM(MACD>0,天数),DRAWNULL),COLORWHITE,NODRAW;

横线首首价:REF(C,天数),NODRAW;

空间评估:(横线首首价-C)/C*100,NODRAW;

TT:=BARSLAST(ZZ);

WQG:=CROSS(COUNT(CROSS(MACD<本高/2 AND MACD>0,0.5),ZZ)=1,0.5) AND ZZ>=0;

STICKLINE(MACD>前高 AND 本高>前高 AND BARSLAST(CROSS(MACD<本高/2,0.5))>0 AND

MACD>(前高+本高)/2,MACD,前高,1,0),COLORYELLOW;

前高本高二分位:IF(MACD>0 AND 本高!=前高,DRAWLINE(WQG,(前高+本高)/2,REF(WQG,1),REF((前高+本高)/2,1),1)

,DRAWNULL),COLORC0C000,DOTLINE;

AA:=STRCAT(STRCAT(STRCAT('〖','上起飞间'),'〗'),CON2STR(IF(空间评估,空间评估,

DRAWNULL),2));

DRAWTEXT(WQG,MACD*1.1,'本高成立'),COLORWHITE;

DRAWTEXT(BDCL,MACD*1.1,'本矮成立'),COLORWHITE;

STICKLINE(MACD>前高,MACD,前高,1,0),COLORYELLOW;

STICKLINE(WQG,MACD,0,1,0),COLORGREEN;

STICKLINE(MACD<0 AND MACD<前矮 AND 前矮<0,MACD,前矮,1,0),COLORBLUE;

B1:=IF(CROSS(MACD<0,0.5),BARSNEXT(BDTJ),DRAWNULL);

TSB1:=BARSLAST(MACD>0)-1;

STICKLINE(BARSLAST(BDCL)>=0 AND MACD<前矮 AND MACD<0,MACD,前矮,1,0),COLORGREEN;

STICKLINE(BDCL,MACD,0,1,0),COLORWHITE;

STICKLINE(MACD>前高 AND 本高>前高 AND BARSLAST(WQG)>0,

MACD,前高,1,0),COLORRED;

DRAWTEXT(VA2 AND VA2!=UU,(MACD/10)*9,'前');

DRAWTEXT(VA2 AND VA2!=UU,MACD/10,'高');

DRAWTEXT(ZZ,(MACD/10)*9,'本'),COLORWHITE;

DRAWTEXT(ZZ,MACD/10,'高'),COLORWHITE;

DRAWTEXT(BDTJ,(MACD/10)*9,'矮'),COLORRED;

DRAWTEXT(BDTJ,MACD/10,'本'),COLORRED;

IF(BARSLAST(BDCL)>=0,本矮/2,DRAWNULL),COLORRED,DOTLINE;

基准:=CONST(SUM(VA2,0));

前高L:=基准=SUM(VA2,0) AND VA2,COLORCYAN,NODRAW;

前高1:=基准-1=SUM(VA2,0) AND VA2,COLORYELLOW,NODRAW;

前高2:=基准-2=SUM(VA2,0) AND VA2,COLORWHITE,NODRAW;

前高3:=基准-3=SUM(VA2,0) AND VA2,COLORWHITE,NODRAW;

前高4:=基准-4=SUM(VA2,0) AND VA2,COLORWHITE,NODRAW;

距离G1:=BARSLAST(前高1);

距离G2:=BARSLAST(前高2);

距离G3:=BARSLAST(前高3);

距离G4:=BARSLAST(前高4);

NOTEXTG2:DRAWLINE(前高1,MACD,前高L AND MACD>=REF(MACD,距离G1),MACD,0),COLORYELLOW;

NOTEXTG1:DRAWLINE(前高1,MACD,前高L AND MACD<REF(MACD,距离G1),MACD,0),COLORGREEN;

NOTEXTG3:DRAWLINE(前高2,MACD,前高1 AND MACD>=REF(MACD,距离G2),MACD,0),COLORYELLOW;

NOTEXTG4:DRAWLINE(前高2,MACD,前高1 AND MACD<REF(MACD,距离G2),MACD,0),COLORGREEN;

NOTEXTG5:DRAWLINE(前高3,MACD,前高2 AND MACD>=REF(MACD,距离G3),MACD,0),COLORYELLOW;

NOTEXTG6:DRAWLINE(前高3,MACD,前高2 AND MACD<REF(MACD,距离G3),MACD,0),COLORGREEN;

NOTEXTG7:DRAWLINE(前高4,MACD,前高3 AND MACD>=REF(MACD,距离G4),MACD,0),COLORYELLOW;

NOTEXTG8:DRAWLINE(前高4,MACD,前高3 AND MACD<REF(MACD,距离G4),MACD,0),COLORGREEN;

基准2:=CONST(SUM(VA4,0));

前矮L:=基准2=SUM(VA4,0) AND VA4;

前矮1:=基准2-1=SUM(VA4,0) AND VA4;

前矮2:=基准2-2=SUM(VA4,0) AND VA4;

前矮3:=基准2-3=SUM(VA4,0) AND VA4;

前矮4:=基准2-4=SUM(VA4,0) AND VA4;

距离D1:=BARSLAST(前矮1);

距离D2:=BARSLAST(前矮2);

距离D3:=BARSLAST(前矮3);

距离D4:=BARSLAST(前矮4);

NOTEXTD1:DRAWLINE(前矮1,MACD,前矮L AND MACD>=REF(MACD,距离D1),MACD,0),COLORYELLOW;

NOTEXTD2:DRAWLINE(前矮1,MACD,前矮L AND MACD<REF(MACD,距离D1),MACD,0),COLORGREEN;

NOTEXTD3:DRAWLINE(前矮2,MACD,前矮1 AND MACD>=REF(MACD,距离D2),MACD,0),COLORYELLOW;

NOTEXTD4:DRAWLINE(前矮2,MACD,前矮1 AND MACD<REF(MACD,距离D2),MACD,0),COLORGREEN;

NOTEXTD5:DRAWLINE(前矮3,MACD,前矮2 AND MACD>=REF(MACD,距离D3),MACD,0),COLORYELLOW;

NOTEXTD6:DRAWLINE(前矮3,MACD,前矮2 AND MACD<REF(MACD,距离D3),MACD,0),COLORGREEN;

NOTEXTD7:DRAWLINE(前矮4,MACD,前矮3 AND MACD>=REF(MACD,距离D4),MACD,0),COLORYELLOW;

NOTEXTD8:DRAWLINE(前矮4,MACD,前矮3 AND MACD<REF(MACD,距离D4),MACD,0),COLORGREEN;

STICKLINE(MACD>前高 AND 本高>前高 AND BARSLAST(WQG)>0,

MACD,前高,1,0),COLORRED;

DRAWTEXT(VA2 AND VA2!=UU,(MACD/10)*9,'前');

DRAWTEXT(VA2 AND VA2!=UU,MACD/10,'高');

DRAWTEXT(ZZ,(MACD/10)*9,'本'),COLORWHITE;

DRAWTEXT(ZZ,MACD/10,'高'),COLORWHITE;

DRAWTEXT(BDTJ,(MACD/10)*9,'矮'),COLORRED;

DRAWTEXT(BDTJ,MACD/10,'本'),COLORRED;

IF(BARSLAST(BDCL)>=0,本矮/2,DRAWNULL),COLORRED,DOTLINE;

DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORMAGENTA;

DEAA:EMA(DIF,9),COLORWHITE;

矮位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;

STICKLINE(矮位金叉,0,0.08,2,0),COLORYELLOW;

DRAWTEXT(矮位金叉,0.16,' 矮位金叉'),COLORWHITE;

JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));

二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;

STICKLINE(二次金叉,0,0.06,2,0),COLORFF00FF;

DRAWICON(二次金叉,DEA*0.9,1) ;

DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;

A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));

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

STICKLINE(底背离,0,0.03,2,0),COLOR00FF00;

底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLOR008080,LINETHICK4;

DRAWTEXT(底背离,0.1,' 底背离'),COLORFF00FF;

A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));

顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);

顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;

DRAWTEXT(矮位金叉 AND 二次金叉 AND 底背离,0.25,'三全项'),COLOR0000FF,LINETHICK2;

相关资讯

行业动态 迎来出场机会,拜仁新援奥马尔

行业动态 2021-09-27
在本轮德甲比赛中,拜仁慕尼暗主场7-0大胜升班马波鸿俱笑部,本场比赛下半场行业动态,拜...
【更多...】

行业动态 中秋幼长伪第镇日,长三角铁路

行业动态 2021-09-26
中秋幼长伪第镇日行业动态,长三角铁路展望发送230万人次 后区组合防0路1路号码 龙头分析:...
【更多...】

行业动态 广东一快递点女职员被殴致伤

行业动态 2021-09-25
“吾姐姐那时没在意,回家后发现行业动态,受案回执上写的是‘殴打他人’一案,”余福银...
【更多...】
    友情链接:

Powered by 西甲篮球联赛比分直播 @2013-2021 RSS地图 HTML地图