最新公告
  • 欢迎您光临九毛八公式指标网www.9m8.cn,本站全新改版试运行,期间内容全部免费,欢迎下载!欢迎加入本站VIP
  • 指标资讯

    正文概述    2024-05-04 03:02:32  

    通达信指标公式源码概况:指标类别: 通达信指标公式授权方式: 免费版指标评级: ★★★★★指标分类: 策略画线方法: 副图一、彩色超强macd优化指标公式    DIF1:=EMA(CLOSE,10)-EMA(CLOSE,22);    DEA1:=EMA(DIF1,N);    MACD1:=2*(DIF1-DEA1),STICK;    MACD2:=EMA(MACD1,3);    STICKLINE(MACD1 MACD2ANDMACD1 0,0,MACD1,1,0),COLORRED;    STICKLINE(MACD1 MACD2ANDMACD1 0,0,MACD1,1,0),COLORGREEN;    STICKLINE(MACD1 MACD2,0,MACD1,1,0),COLORCBCBC0;    STICKLINE(MACD1 =0ORMACD1 =0,0,0,50,1),COLORWHITE;    DIF:DIF1,COLOR33FF33;    DEA:DEA1,COLORYELLOW;    MACD:MACD1,NODRAW,COLORMAGENTA;    SAR1:= SAR.SAR     支撑:SAR1,NODRAW;    IF(C SAR1,DIF1,DRAWNULL),COLORRED,LINETHICK2;    DIFF:=EMA(CLOSE,13)-EMA(CLOSE,34);    DEA:=EMA(DIFF,9);    AA:=MA(DEA,21);    AB:=MA(AA,5);    SL:MA(DIFF,88),COLORYELLOW,LINETHICK3;    STICKLINE(AA AB,AA,AB,3,0),COLORMAGENTA;    STICKLINE(AADEA,DIFF,DEA,3,0),COLORRED;    STICKLINE(DIFF DEA,DIFF,DEA,3,0),COLORGREEN;    DIFF:EMA(CLOSE,12)-EMA(CLOSE,27);    DEA:EMA(DIFF,9);    MACD:2*(DIFF-DEA),COLORSTICK,LINETHICK2;    低位金叉:=CROSS(DIFF,DEA)ANDDIFF -0.1;    STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;    DRAWTEXT(低位金叉,0.16, 低位金叉 ),COLORWHITE;    JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA =0));    二次金叉:=CROSS(DIFF,DEA)ANDDEA 0ANDCOUNT(JCCOUNT=2,21)=1;    STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;    DRAWICON(二次金叉,DEA*0.9,1);    DRAWTEXT(二次金叉,0.2, 二次金叉 ),COLORYELLOW;    A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));    底背离:=REF(CLOSE,A1+1) CLOSEANDDIFF REF(DIFF,A1+1)ANDCROSS(DIFF,DEA);    STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;    DRAWTEXT(底背离,0.12, 底背离 ),COLORFF00FF;    A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));    顶背离:=REF(CLOSE,A2+1)DIFFANDCROSS(DEA,DIFF);    DRAWTEXT(低位金叉AND二次金叉AND底背离,0.25, 三全项    ),COLOR0000FF,LINETHICK2;    M1:60M2:89M3:120    EXP1:EMA(CLOSE,M1),POINTDOT,COLORYELLOW,LINETHICK3;    EXP2:EMA(CLOSE,M2),COLORRED,LINETHICK2;    EXP3:EMA(CLOSE,M3),POINTDOT,COLORFFCC00,LINETHICK3;    IF(EXP2 =REF(EXP2,1),EXP2,DRAWNULL),COLORRED,LINETHICK1;    IF(EXP2 =REF(EXP2,1),EXP2,DRAWNULL),COLORBLUE,LINETHICK2;    B1:=EMA(C,3);    B2:=EMA(C,26);    B3:=B1-B2;    WDIF:EMA(EMA(EMA(C,3),3),3)+B3,LINETHICK2,COLORF00FF0;    WDEA:EMA(WDIF,9),COLORGREEN,LINETHICK1;    MA18:=MA(CLOSE,18);    MTM:=C-REF(C,1);    DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);    买:=LLV(DX,2)=LLV(DX,7)ANDCOUNT(DX 0,2)ANDCROSS(DX,MA(DX,2));    DRAWTEXT(FILTER(买=1,5),LOW, 买 ),COLORYELLOW;    DRAWICON(CROSS(WDIF,WDEA),WDEA,17);    日:=150;昨前:=3;    高1:=REF(HHV(H,日),昨前);    低1:=REF(LLV(L,日),昨前);    H5:=高1-(高1-低1)*0.809;    H6:=高1-(高1-低1)*0.886;    H7:=高1-(高1-低1)*0.946;    顶:REFDATE(高1,DATE),COLORFFCC00;    五0.191:REFDATE(H5,DATE),COLOR0099FF,DOTLINE;    六0.886:REFDATE(H6,DATE),COLORRED,DOTLINE;    七0.946:REFDATE(H7,DATE),COLORFFCC00,DOTLINE;    低:REFDATE(低1,DATE),COLORBLUE;    DIF1:=EMA(CLOSE,12)-EMA(CLOSE,26);    DEA1:=EMA(DIF1,9);    MACD1:=2*(DIF1-DEA1),STICK;    MACD2:EMA(MACD1,5),NODRAW;    蓝:STICKLINE(MACD1 MACD2ANDMACD1 0,0,MACD1,1,0),COLORBLUE;    粉:STICKLINE(MACD1 MACD2ANDMACD1 0,0,MACD1,1,1),COLORMAGENTA;    红:STICKLINE(MACD1 MACD2ANDMACD1 0,0,MACD1,1,1),COLORRED;    绿:STICKLINE(MACD10,0,MACD1,1,0),COLORGREEN;    A:DRAWTEXT(CROSS(粉,蓝),MACD1-0.1, 买 )COLORGREEN;    B:DRAWTEXT(CROSS(绿,红),MACD2-0.01, 卖 )COLORYELLOW;二、超级macd指标优化    VARR1:=(2*CLOSE+HIGH+LOW)/4;    VARR2:=EXPMA(EXPMA(EXPMA(VARR1,4),4),4);    J:=(VARR2-REF(VARR2,1))/REF(VARR2,1)*100,COLORSTICK;    DK:MA(J,1),COLORMAGENTA,LINETHICK2;    DD:MA(J,3),COLORWHITE,LINETHICK2;    DRAWBAND(DK,RGB(255,150,0),DD,RGB(0,100,0));    DIFF:EMA(CLOSE,12)-EMA(CLOSE,27),COLORRED,LINETHICK2;    DEA:EMA(DIFF,9),COLORGREEN,LINETHICK1;    MACD:(DIFF-DEA)*2,COLORSTICK;    低位金叉:=CROSS(DIFF,DEA)ANDDIFF -0.1;    JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA =0));    二次金叉:=CROSS(DIFF,DEA)ANDDEA 0ANDCOUNT(JCCOUNT=2,21)=1;    DRAWICON(二次金叉,DEA*0.9,1);    A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));    XX2:=(MA(CLOSE,80)-MA(CLOSE,13)/3);    SQX:=MA((CLOSE-XX2)/XX2,10)*0.01;    好机会:IF(COUNT(SQX REF(SQX,1),3)=3ANDCOUNT(SQX 0,10)=10AND    REF(SQX,3)=LLV(SQX,10),1,0),COLORWHITE;    DRAWTEXT(好机会 0,1.2, 好机会 ),COLORWHITE;    DIF:EMA(CLOSE,12)-EMA(CLOSE,26);    DEA:EMA(DIF,9);    MACD:”MACD.MACD”,NODRAW;    W1:STICKLINE(MACD 0,MACD,0,3,1),COLORRE    D;    W2:STICKLINE(MACD 0,MACD,0,3,1),COLORCYA    N;    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    (ISLASTBARANDMACD 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);    BD:=BARSLAST(FILTERX(CROSS(0,MACD),BARSCO    UNT(C)));    前    低:DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1);    BDTJ:=IF(MACD 0,FILTERX(MACD=LLV(MACD,B    ARSLAST(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)),DRAWNU    LL);    BDCL:=CROSS(COUNT(CROSS(MACD 本低/2    ANDMACD 0,0.5),TSBDTJ)=1,0.5)AND    TSBDTJ     终点:=IF(ISLASTBARANDMACD 0AND    MACD=HHV(MACD,BARSLAST(MACD 0)),1,    IF(FILTERX(QG,BARSCOUNT(C)),2,DRAWNULL));    UU:=(终点=1OR终点=2)ANDMACD     ZZ:=FILTERX(UU,BARSCOUNT(C));    本    高:DRAWLINE(ZZ,MACD,REF(ZZ,1),REF(MACD,1),1),C    OLORWHITE;    横线:=CONST(REF(MACD,BARSLAST(ZZ)));    WW:=MACD     起始    点:=FILTERX(REFX(BARSLAST(WW),1)=1,BARSCOUN    T(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(天数 0AND天数 =REF(TJ,天    数),SUM(MACD 0,天    数),DRAWNULL),COLORWHITE,NODRAW;    横线起始价:REF(C,天数),NODRAW;    空间评估:(横线起始价-C)/C*100,NODRAW;    TT:=BARSLAST(ZZ);    WQG:=CROSS(COUNT(CROSS(MACD 本高/2AND    MACD 0,0.5),ZZ)=1,0.5)ANDZZ     STICKLINE(MACD 前高AND本高 前高AND    BARSLAST(CROSS(MACD 本高/2,0.5)) 0AND    MACD (前高+本高)/2,MACD,前    高,1,0),COLORYELLOW;    前高本高二分位:IF(MACD 0AND本高!=前    高,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 0ANDMACD 前低AND前    低 0,MACD,前低,1,0),COLORBLUE;    B1:=IF(CROSS(MACD 0,0.5),BARSNEXT(BDTJ),DR    AWNULL);    TSB1:=BARSLAST(MACD 0)-1;    STICKLINE(BARSLAST(BDCL) =0ANDMACD     前低ANDMACD 0,MACD,前低,1,0),COLORGREEN;    STICKLINE(BDCL,MACD,0,1,0),COLORWHITE;    STICKLINE(MACD 前高AND本高 前高AND    BARSLAST(WQG) 0,    MACD,前高,1,0),COLORRED;    DRAWTEXT(VA2ANDVA2!=UU,(MACD/10)*9,‟前‟);    DRAWTEXT(VA2ANDVA2!=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;    DRAWTEXT_FIX(1,0.05,0.04,0,‟    DIF:(EMA(CLOSE,12)-    EMA(CLOSE,26)),COLORRED,NODRAW;    DEA:EMA(DIF,9),COLOR00FFFF,NODRAW;    MACD:2*(DIF-DEA),NODRAW;    DIFK:=EMA(DIF,3);    DIFD:=EMA(DIFK,3);    DKK:4*DIF-3*DEA,COLORFF00FF,NODRAW;    DDD:EMA(DKK,5),COLOR2588FF,NODRAW;    DRAWICON(CROSS(DDD,DKK),DKK,2);    DRAWICON(CROSS(DKK,DDD),DDD,1);    TRLSX1:=MAX(MAX((HHV(DIF,13)-    LLV(DIF,13)),ABS(REF(DIF,1)-HHV(DIF,13))),ABS(REF(DIF,1)-    LLV(DIF,13)));    TRLSX2:=EMA(TRLSX1,13);    TRLSX3:=REF(DIF,1)-REF(TRLSX2,1);    支撑:HHV(TRLSX3,13),COLORFFFFFF,NODRAW;    RSV14:=(CLOSE-LLV(LOW,14))/(HHV(HIGH,14)-    LLV(LOW,14))-0.5;    K14:=EMA(RSV14,3),COLORFF00FF,NODRAW;    D14:=EMA(K14,3),COLORGREEN,NODRAW;    J14:=3*K14-2*D14;    DRAWBAND(DIF,RGB(200,50,55),DEA,RGB(50,100,10));    MACDXG2:=REF(COUNT(DIF 0ANDMACD 0AND    MACD REF(MACD,1),4)=4,1)AND    MACD REF(MACD,1);    STICKLINE(MACDXG2,MACD*1.2,0,2.8,0),COLORRED;    STICKLINE(MACD REF(MACD,1)AND    MACD 0,0,MACD,1.8,0),COLOR000055;    STICKLINE(MACD REF(MACD,1)AND    MACD 0,0,MACD,1.1,0),COLOR000099;    STICKLINE(MACD REF(MACD,1)AND    MACD 0,0,MACD,0.6,0),COLOR0000BB;    STICKLINE(MACD =REF(MACD,1)AND    MACD 0,0,MACD,1.8,0),COLOR888888;    STICKLINE(MACD =REF(MACD,1)AND    MACD 0,0,MACD,1.1,0),COLORBBBBBB;    STICKLINE(MACD =REF(MACD,1)AND    MACD 0,0,MACD,0.6,0),COLORDDDDDD;    STICKLINE(MACD REF(MACD,1)AND    MACD 0,0,MACD,1.8,0),COLOR3377AA;    STICKLINE(MACD REF(MACD,1)AND    MACD 0,0,MACD,1.1,0),COLOR3388BB;    STICKLINE(MACD REF(MACD,1)AND    MACD 0,0,MACD,0.6,0),COLOR4499CC;    STICKLINE(MACD =REF(MACD,1)AND    MACD 0,0,MACD,1.8,0),COLORFF3300;    STICKLINE(MACD =REF(MACD,1)AND    MACD 0,0,MACD,1.1,0),COLORFF5500;    STICKLINE(MACD =REF(MACD,1)AND    MACD 0,0,MACD,0.6,0),COLORFF7700;    STICKLINE(J14 -0.5,0,0.15,1.8,0),COLORFF00FF;    支撑,COLORFFFFFF;    IF(C 0,DIF,DRAWNULL),COLORRED,LINETHICK1;    IF(C 0,DEA,DRAWNULL),COLOR00FFFF,LINETHICK1;    IF(DEA REF(DEA,1),DEA,DRAWNULL),COLORBE7F6F,LINET    HICK1;    IF(DIF =REF(DIF,1),DIF,DRAWNULL),COLORBLUE,LINETHI    CK1;    IF(C,DKK,DRAWNULL),COLORFF00FF,LINETHICK1;    IF(DKK =REF(DKK,1),DKK,DRAWNULL),COLORCYAN,LINET    HICK1;    IF(C,DDD,DRAWNULL),COLOR2255FF,LINETHICK1;    IF(DDD =REF(DDD,1),DDD,DRAWNULL),COLOR33FF33,LI    NETHICK1;    KDJXG:=REF(COUNT(J14 REF(J14,1),5) =3,1)AND    REF(J14,1) -0.4ANDJ14 REF(J14,1);    DRAWICON(FILTER(KDJXG,3),MACD*1.2,11),COLORFF00EE;    准备介入点:=REF(CROSS(0,MACD),3)ANDCOUNT(DIF 0    ANDMACD REF(MACD,1),4)=4;    DRAWICON(准备介入点,0.05,9);    TS:=BARSLAST(MACD =0ANDREF(MACD,1)     红柱面积:0.091*IF(MACD 0AND    REF(MACD,1) =0,SUM(REF(MACD,1),TS),0),COLORMAGE    NTA,LINETHICK0;    STICKLINE(MACD 0ANDREF(MACD,1) =0,0,红柱面    积,4,0),COLORWHITE;    TS1:=BARSLAST(MACD =0ANDREF(MACD,1)     绿柱面积:0.1*IF(MACD 0AND    REF(MACD,1) =0,SUM(REF(MACD,1),TS1),0),COLORGREE    N,LINETHICK0;    STICKLINE(MACD 0ANDREF(MACD,1) =0,0,绿柱面    积,4,0),COLORGREEN;    A1:=CROSS(DIF,DEA)ANDDIF -0.1;    底背离:=REF(CLOSE,A1+1) CLOSEAND    DIF REF(DIF,A1+1)ANDCROSS(DIF,DEA);    STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;    底背:DRAWLINE(A1=0,DEA,底背    离,DEA,0),COLORRED,LINETHICK2;    DRAWTEXT(底背离,0.12, 底背离 ),COLORFF00FF;    A2:=BARSLAST(REF(CROSS(DEA,DIF),1));    顶背离:=REF(CLOSE,A2+1) CLOSEAND    REF(DIF,A2+1) DIFANDCROSS(DEA,DIF);    顶背:DRAWLINE(A2=0,DEA,顶背    离,DEA,0),COLORGREEN,LINETHICK2;    AA:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA =0));    二次金叉:=CROSS(DIF,DEA)ANDDEA 0AND    COUNT(AA=2,21)=1;    DRAWTEXT(二次金叉,0.2, 二次金叉 ),COLORYELLOW;    低金:=BARSLAST(REF(CROSS(DIF,DEA),1));    STICKLINE(低金,0,0.01,6,0),COLORYELLOW;    DRAWTEXT(低金,0.10, 低金 ),COLORWHITE;    DRAWTEXT(低金AND二次金叉AND底背离,0.5, 三全项    ),COLOR0000FF;    DRAWTEXT(低金AND底背离,0.4, 二全项 ),COLOR0000FF;    DRAWTEXT(二次金叉AND低金,0.3, 一全项    ),COLOR0000FF;    DRAWTEXT(二次金叉AND底背离,0.2, 无全项    ),COLOR0000FF;[源码注释]通达信公式动态公式解读田赋值:(收盘价*2+最高价+最低价+开盘价)/10福赋值:田的2日指数移动平均-田的5日指数移动平均AA赋值:1日前的收盘价BBB赋值:收盘价-AA和0的较大值的21日[1日权重]移动平均/收盘价-AA的绝对值的21日[1日权重]移动平均*10HHH赋值:BBB-27日内BBB的最低值CCC赋值:27日内BBB的最低值-BBB输出心: (HHH的2日简单移动平均*3+HHH*13)/16,COLORFF00FF,线宽为3输出知:HHH的4日简单移动平均,线宽为1,画绿色输出肚: (CCC的2日简单移动平均*3+CCC*13)/16,COLORFF00FF,线宽为3输出明:CCC的4日简单移动平均,线宽为1,画绿色画带状线画带状线画带状线量比赋值:福的3日指数移动平均量2赋值:-2*(福-量比)*5,COLOR8000FF,线宽为3量1赋值:2*(福-量比)*5,COLOR8000FF,线宽为3画带状线GT赋值:福,画黄色,线宽为3MA81赋值:量比的2日简单移动平均SJ1赋值:上次GT上穿MA81距今天数+1SJ2赋值:上次MA81上穿GT距今天数+1输出有心:如果SJ1 =SJ2,返回1日前的SJ2,否则返回0/30,COLOR80FFFF,线宽为3推荐阅读:增强版macd指标公式源码    DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);    DEA:=EMA(DIF,9);    MACD:=2*(DIF-DEA);    DIF =0ANDCROSS(DIF,DEA)ANDV/MA(V,5)     注:DIF已上0轴,DEA线将上但还未跨上0轴时放量有望加速    N1:=12;N2:=26;M:=9;    DIFF:EMA(CLOSE,N1)-EMA(CLOSE,N2),COLORBB00BB,LINETHICK2,;    DEA:EMA(DIFF,M),COLOR00BB00,LINETHICK2,;    MACD:(DIFF-DEA)*2,COLORSTICK;    今日交叉价:((REF(EMA(C,N2),1)*(N2-1)*(N1+1))+(REF(DEA,1)*(N1+1)*    (N2+1))-(REF(EMA(C,N1),1)*(N1-1)*(N2+1)))/(2*(N2-N1))NODRAW;    明日交叉    价:((EMA(C,N2)*(N2-1)*(N1+1))+(DEA*(N1+1)*(N2+1))-(EMA(C,N1)*(N1-1)    *(N2+1)))/(2*(N2-N1))NODRAW;    STICKLINE(MACD0,0,MACD,8,0),COLOR003333;    STICKLINE(MACD0,0,MACD,7,0),COLOR004444;    STICKLINE(MACD0,0,MACD,6,0),COLOR005555;    STICKLINE(MACD0,0,MACD,5,0),COLOR007777;    STICKLINE(MACD0,0,MACD,4,0),COLOR009999;    STICKLINE(MACD0,0,MACD,3,0),COLOR00BBBB;    STICKLINE(MACD0,0,MACD,2,0),COLOR00DDDD;    STICKLINE(MACD0,0,MACD,1,0),COLOR00FFFF;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,8,0),COLOR000033;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,7,0),COLOR000044;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,6,0),COLOR000055;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,5,0),COLOR000077;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,4,0),COLOR000099;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,3,0),COLOR0000BB;    STICKLINE(MACD =REF(MACD,1)AND    MACD 0,0,MACD,2,0),COLOR0000DD;    STICKLINE(MACD =REF(MACD,1)AND    MACD 0,0,MACD,1,0),COLOR0000FF;    STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,8,0),COLOR333333;    STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,7,0),COLOR444444;    STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,6,0),COLOR555555;    STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,5,0),COLOR777777;    STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,4,0),COLOR999999;    STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,3,0),COLORBBBBBB;    STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,2,0),COLORDDDDDD;    STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,1,0),COLORFFFFFF;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,8,0),COLOR333300;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,7,0),COLOR444400;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,6,0),COLOR555500;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,5,0),COLOR777700;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,4,0),COLOR999900;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,3,0),COLORBBBB00;    STICKLINE(MACD =REF(MACD,1)AND    MACD 0,0,MACD,2,0),COLORDDDD00;    STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,1,0),COLORFFFF00;    {MACD副图指标}    DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);    DEA:=EMA(DIF,9);    MACD:=(DIF-DEA)*2,COLORSTICK;    STICKLINE(MACD 0,0,MACD,-1,0),COLORMAGENTA;    STICKLINE(MACD 0,0,MACD,-1,0),COLORBLUE;    {下边标天数}    HZZ:=BARSLASTCOUNT(MACD     HDS:=MOD(HZZ,2);    LZZ:=BARSLASTCOUNT(MACD     LDS:=MOD(LZZ,2);    DRAWNUMBER(HDS,MACD*1.03,HZZ),DRAWABOVE;    DRAWNUMBER(LDS,MACD*1.03,LZZ);    DIF:EMA(CLOSE,12)-EMA(CLOSE,26);    DEA:EMA(DIF,9);    MYY:=EMA(CLOSE,3)-EMA(CLOSE,3);    YMM:=EMA(MYY,3);    MACD:(DIF-DEA)*2,COLORSTICK;    IF(DIF REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;    IF(DIF REF(DIF,1),DIF,DRAWNULL),COLORGREEN,LINETHICK2;    MACD2:=MACD;    获利比:WINNER(C),NODRAW;    STICKLINE((MACD2 =0),0,MACD2,0,1),COLORRED;    STICKLINE(((MACD2 =0)AND(MACD2     REF(MACD2,1))),0,MACD2,0,0),COLORMAGENTA;    STICKLINE((MACD2 0),0,MACD2,0,0),COLORGREEN;    STICKLINE(((MACD2REF(MACD2,1))),0,MACD2,0,1),COLORWHITE;    DRAWICON(LONGCROSS(CLOSE,MA(CLOSE,5),17),MACD2,1);    DRAWICON(LONGCROSS(MA(CLOSE,5),CLOSE,17),MACD2,2);    DRAWICON(CROSS(DIF,DEA)ANDDIF =0.2,LLV(DIF,1),29);    DRAWICON(CROSS(DIF =0,DIF DEA),DIF,1);    低位反转:=MACDREF(MACD,1)ANDREF(MACD,1) REF(MACD,2)AND    REF(MACD,2) REF(MACD,3)ANDREF(MACD,3) REF(MACD,4);    STICKLINE(低位反转,0,MACD,0.3,0),COLORRED;    高位反转:=MACD 0ANDMACDREF(MACD,2)AND    REF(MACD,2) REF(MACD,3)ANDREF(MACD,3) REF(MACD,4);    STICKLINE(高位反转,0,MACD,0.3,0),COLORGREEN;    低位金叉:=CROSS(DIF,DEA)ANDDIF -0.1;    JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA =0));    二次金叉:=CROSS(DIF,DEA)ANDDEA 0ANDCOUNT(JCCOUNT=2,21)=1;    DRAWICON(二次金叉,0,25);    三次金叉:=CROSS(DIF,DEA)ANDDEA 0ANDCOUNT(JCCOUNT=3,60)=1;    DRAWICON(三次金叉,0,26);A1:=IF(MACD2 0,1,-1);    TJ:=MACD2     T:=MACD2     DRAWTEXT(BARSLAST(TJ)=1,MACD2, 1 ),COLORYELLOW;    DRAWTEXT(BARSLAST(TJ)=2,MACD2, 2 ),COLORYELLOW;    DRAWTEXT(BARSLAST(TJ)=3,MACD2, 3 ),COLORYELLOW;    DRAWTEXT(BARSLAST(TJ)=5,MACD2, 5 ),COLORYELLOW;    DRAWTEXT(BARSLAST(TJ)=8,MACD2, 8 ),COLORYELLOW;    DRAWTEXT(BARSLAST(TJ)=13,MACD2, 13 ),COLORYELLOW;    DRAWTEXT(BARSLAST(TJ)=21,MACD2, 21 ),COLORYELLOW;    DRAWTEXT(BARSLAST(TJ)=34,MACD2, 34 ),COLORYELLOW;    DRAWTEXT(BARSLAST(TJ)=55,MACD2, 55 ),COLORYELLOW;    DRAWTEXT(BARSLAST(T)=1,MACD2, 1 ),COLORGREEN;    DRAWTEXT(BARSLAST(T)=2,MACD2, 2 ),COLORGREEN;    DRAWTEXT(BARSLAST(T)=3,MACD2, 3 ),COLORGREEN;    DRAWTEXT(BARSLAST(T)=5,MACD2, 5 ),COLORGREEN;    DRAWTEXT(BARSLAST(T)=8,MACD2, 8 ),COLORGREEN;    DRAWTEXT(BARSLAST(T)=13,MACD2, 13 ),COLORGREEN;    DRAWTEXT(BARSLAST(T)=21,MACD2, 21 ),COLORGREEN;    DRAWTEXT(BARSLAST(T)=34,MACD2, 34 ),COLORGREEN;    DRAWTEXT(BARSLAST(T)=55,MACD2, 55 ),COLORGREEN;    涨家数:INDEXADV,NODRAW,COLORRED;    跌家数:INDEXDEC,NODRAW,COLORGREEN;    正量能:涨家数/(涨家数+跌家数)*100,NODRAW,COLORMAGENTA;    负量能:跌家数/(涨家数+跌家数)*100,NODRAW,COLORYELLOW;    高开:=O REF(H,1);    隔空高开:高开,NODRAW;    低开:=O REF(L,1);    隔空低开:低开,NODRAW;    DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);    DEA:EMA(DIFF,9);    MACD1:=2*(DIFF-DEA),STICK;    MACD2:=EMA(MACD1,3);    STICKLINE(MACD1 MACD2ANDMACD1 0,0,MACD1,1,0),COLORRED;    STICKLINE(MACD1 MACD2ANDMACD1 0,0,MACD1,1,0),COLORGREEN;    STICKLINE(MACD1 MACD2,0,MACD1,1,0),COLORCBCBC0;    STICKLINE(MACD1 =0ORMACD1 =0,0,0,50,1),COLORWHITE;    DIFF,COLOR33FF33;    DEA,COLORYELLOW;    MACD:MACD1,NODRAW,COLORMAGENTA;    强:IF(DIFF =DEA,DIFF,DRAWNULL),COLORRED,LINETHICK1;    弱:IF(DEA =DIFF,DEA,DRAWNULL),COLORFF9900,LINETHICK1;    DRAWICON(CROSS(DIFF,DEA),DEA-0.02,1);    跳高:=L (REF(H,1)+0.01);    跳低:=H (REF(L,1)-0.01);    T1:=HHV(H,BARSLAST(跳低)+1);    T2:=REF(L,BARSLAST(跳低)+1);    未补:=T1     补:=T1     岛反:补 REF(补,1);    DRAWGBK(O C,RGB(10,10,10),RGB(0,50,40),0, 01 ,0);    JJ:=(C*2+H+L)/4;    DIFF:=EMA(JJ,13)-EMA(JJ,21);    长DEA:EMA(DIFF,3),NODRAW;    长DEA2:EMA(DIFF,10),NODRAW;    XC:=长DEA-长DEA2;    STICKLINE(XC =REF(XC,1),0,0,2,0),COLOR1000FF;    STICKLINE(XC REF(XC,1),0,0,2,0),COLORFFFF00;    DRAWBAND(长DEA,RGB(180,0,180),长DEA2,RGB(0,120,0));    短DIFF1:EMA(C,7)-EMA(C,21),COLOR1000FF,LINETHICK2;    短DIFF2:EMA((0.668*REF(短DIFF1,1)+0.333*短    DIFF1),1),COLOR00FF00,LINETHICK2;    DIFF:=EMA(CLOSE,13)-EMA(CLOSE,34);    DEA:=EMA(DIFF,9);    AA:=MA(DEA,21);    AB:=MA(AA,5);    SL:MA(DIFF,88),COLORYELLOW,LINETHICK3;    STICKLINE(AA AB,AA,AB,3,0),COLORMAGENTA;    STICKLINE(AADEA,DIFF,DEA,3,0),COLORRED;    STICKLINE(DIFF DEA,DIFF,DEA,3,0),COLORGREEN;    DIFF1:EMA(CLOSE,12)-EMA(CLOSE,26);    DEA1:EMA(DIFF1,9);    DIFF77:=EMA(CLOSE,12)-EMA(CLOSE,26);    DEA77:=EMA(DIFF77,9);    牛股攻击:2*(DIFF77-DEA77),COLORSTICK;    STICKLINE(牛股攻击 REF(牛股攻击,1)ANDDIFF77 DEA77,牛股攻    击,0,10,0),COLORRED;    STICKLINE(牛股攻击 REF(牛股攻击,1)ANDDIFF77 DEA77,牛股攻    击,0,1,0),COLORYELLOW;    {主升:DIFF1 0ANDDIFF1 DEA1,COLOR0000FF,POINTDOT,LINETHICK0;}    DRAWBAND(DEA1,DRAWNULL,DIFF1,RGB(250,0,0));    DIFF:DIFF1,COLORWHITE;    DEA:DEA1,COLORYELLOW;    A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));    B1:=REF(C,A1+1) CANDREF(DIFF,A1+1) DIFFANDCROSS(DIFF,DEA);    A2:=BARSLAST(REF(CROSS( KDJ.K (9,3,3), KDJ.D (9,3,3)),1));    B2:=REF(C,A2+1) CANDREF( KDJ.K (9,3,3),A2+1) KDJ.K (9,3,3)AND    CROSS( KDJ.K (9,3,3), KDJ.D (9,3,3));    A3:=BARSLAST(REF(CROSS( RSI.RSI1 (6,12,24), RSI.RSI2 (6,12,24)),1));    B3:=REF(C,A3+1) CANDREF( RSI.RSI1 (6,12,24),A3+1) RSI.RSI1 (6,12,24)    ANDCROSS( RSI.RSI1 (6,12,24), RSI.RSI2 (6,12,24));    C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));    D1:=REF(C,C1+1)DIFFANDCROSS(DEA,DIFF);    C2:=BARSLAST(REF(CROSS( KDJ.D (9,3,3), KDJ.K (9,3,3)),1));    D2:=REF(C,C2+1) KDJ.K (9,3,3)AND    CROSS( KDJ.D (9,3,3), KDJ.K (9,3,3));    C3:=BARSLAST(REF(CROSS( RSI.RSI2 (6,12,24), RSI.RSI1 (6,12,24)),1));    D3:=REF(C,C3+1) RSI.RSI1 (6,12,24)    ANDCROSS( RSI.RSI2 (6,12,24), RSI.RSI1 (6,12,24));    MACD底背:IF(B1 0,-0.1,0),COLORRED,POINTDOT;    KDJ底背:IF(B2 0,-0.1,0),COLORFF00FF,POINTDOT;    RSI底背:IF(B3 0,-0.1,0),COLORYELLOW,POINTDOT;    MACD顶背:IF(D1 0,0.1,0),COLOR00FF00,POINTDOT;    KDJ顶背:IF(D2 0,0.1,0),COLORFFCC66,POINTDOT;    RSI顶背:IF(D3 0,0.1,0),COLORWHITE,POINTDOT;    STICKLINE(B1 0,-0.04,0,3,0),COLORRED,LINETHICK3;    STICKLINE(B2 0,-0.04,0,3,0),COLORFF00FF,LINETHICK5;    STICKLINE(B3 0,-0.04,0,3,0),COLORYELLOW,LINETHICK5;    STICKLINE(D1 0,0.04,0,3,0),COLOR00FF00,LINETHICK5;    STICKLINE(D2 0,0.04,0,3,0),COLORFFCC66,LINETHICK5;    STICKLINE(D3 0,0.04,0,3,0),COLORWHITE,LINETHICK5;    {MACD背离指标}    DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORWHITE;    DEA:EMA(DIFF,9),COLORYELLOW;    MACD:2*(DIFF-DEA),COLORSTICK;    STICKLINE(MACD0,0,MACD,0,0),COLORYELLOW;    STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,0,0),COLORGREEN;    低位金叉:=CROSS(DIFF,DEA)ANDDIFF -0.1;    STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;    DRAWTEXT(低位金叉,0.16, 低金叉 ),COLORWHITE;    JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA =0));    二次金叉:=CROSS(DIFF,DEA)ANDDEA 0ANDCOUNT(JCCOUNT=2,21)=1;    STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;    DRAWICON(二次金叉,DEA*0.9,1);    DRAWTEXT(二次金叉,0.2, 二次金叉 ),COLORYELLOW;    A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));    底背离:=REF(CLOSE,A1+1) CLOSEANDDIFF REF(DIFF,A1+1)ANDCROSS(DIFF,DEA);    STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;    底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;    DRAWTEXT(底背离,0.12, 底背离 ),COLORFF00FF;    A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));    顶背离:=REF(CLOSE,A2+1)DIFFANDCROSS(DEA,DIFF);    顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;    DRAWTEXT(低位金叉AND二次金叉AND底背离,0.25, 三全项    ),COLOR0000FF,LINETHICK2;    IF(DIFF 0,DIFF,0),COLORRED,LINETHICK1;    IF(DIFF 0,0,DIFF),COLORRED,LINETHICK1;    IF(DIFF DEA,DIFF,DEA),COLOR00FF00,LINETHICK1;    IF(DIFF DEA,DEA,DEA),COLORWHITE,LINETHICK1;    金叉:CROSS(DIFF,DEA)ANDDIFF 每日公式解答:    不回补缺口的选股公式    2021/5/1018:49:32    公式编写要求:    向上跳空然后在之后3日不回补缺口的选股公式。    公式编写方法:    XG:BARSLAST(L REF(H,1))=2 LLV(L,BARSLAST(L REF(H,1))) REF(H,BARSLAST(L REF(H,1))+1);

    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 指标资讯 加入收藏