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

    正文概述    2024-05-04 04:02:59  


    通达信指标公式源码概况:


    指标类别: 通达信指标公式


    授权方式: 免费版


    指标评级: ★★★★★


    指标分类: 策略


    画线方法: 副图



    一、画线主图指标公式

     

    数:=REF(BARSLAST(BARSLASTCOUNT(NOT(MONTH-REF(MONTH,1)=0)), 

    1); 

    本月天 

    数:=BARSLAST(BARSLASTCOUNT(NOT(MONTH-REF(MONTH,1)=0))); 

    月1:=IF(本月天数-上月天数=1,REF(C,本月天数+1),DRAWNULL); 

    月2:=IF(本月天数-上月天数=1,REF(月1,本月天数+1),DRAWNULL); 

    月3:=IF(本月天数-上月天数=1,REF(月2,本月天数+1),DRAWNULL); 

    月4:=IF(本月天数-上月天数=1,REF(月3,本月天数+1),DRAWNULL); 

    月5:=IF(本月天数-上月天数=1,REF(月4,本月天数+1),DRAWNULL); 

    月6:=IF(本月天数-上月天数=1,REF(月5,本月天数+1),DRAWNULL); 

    月7:=IF(本月天数-上月天数=1,REF(月6,本月天数+1),DRAWNULL); 

    月8:=IF(本月天数-上月天数=1,REF(月7,本月天数+1),DRAWNULL); 

    月9:=IF(本月天数-上月天数=1,REF(月8,本月天数+1),DRAWNULL); 

    月10:=IF(本月天数-上月天数=1,REF(月9,本月天数+1),DRAWNULL); 

    月11:=IF(本月天数-上月天数=1,REF(月10,本月天数+1),DRAWNULL); 

    五月均:(月1+月2+月3+月4+C)/5; 

    十月均:(月1+月2+月3+月4+月5+月6+月7+月8+月9+C)/10; 

    {STICKLINE(五月均 十月均AND 

    MONTH=REF(MONTH,1),五月均,十月均,6,0),COLORRED; 

    STICKLINE(五月均 十月均AND 

    MONTH=REF(MONTH,1),五月均,十月均,6,0),COLORBLUE;} 

    DRAWBAND(五月均,RGB(255,0,0),十月均,RGB(20,200,80)); 

    STICKLINE(C =O,C,O,3,0),COLOR000045; 

    STICKLINE(C =O,C,O,2.5,0),COLOR000065; 

    STICKLINE(C =O,C,O,2,0),COLOR000085; 

    STICKLINE(C =O,C,O,1.5,0),COLOR0000A5; 

    STICKLINE(C =O,C,O,1,0),COLOR0000C5; 

    STICKLINE(C =O,C,O,0.5,0),COLOR0000E5; 

    STICKLINE(C =O,H,L,0,0),COLOR0000F5; 

    STICKLINE(C O,C,O,3,0),COLOR353500; 

    STICKLINE(C O,C,O,2.5,0),COLOR454500; 

    STICKLINE(C O,C,O,2,0),COLOR555500; 

    STICKLINE(C O,C,O,1.5,0),COLOR656500; 

    STICKLINE(C O,C,O,1,0),COLOR757500; 

    STICKLINE(C O,C,O,0.5,0),COLOR858500; 

    STICKLINE(C O,H,L,0,0),COLOR959500; 

    EMA120:EMA(C,120),COLORLIBLUE,LINETHICK2; 

    EMA250:EMA(C,250),COLORYELLOW,LINETHICK2; 

    MA20:MA(C,20),LINETHICK4。 

    VAR1:=(CLOSE+LOW+HIGH)/3; 

    VAR2:=EMA(VAR1,6); 

    VAR3:=EMA(VAR2,5); 

    生命线:EMA(VAR3,30),COLORRED,LINETHICK3; 

    VAR4:=5; 

    VAR5:=6; 

    VAR6:=6; 

    VAR7:=8; 

    VAR8:=IF(DATE 1910612,1,0); 

    VAR9:=(HIGH+MAX(CLOSE,OPEN))/2; 

    VAR10:=MA(VAR9,3); 

    VAR11:=(LOW+MIN(CLOSE,OPEN))/2; 

    VAR12:=MA(VAR11,3); 

    超短生命线:MA(VAR9,3),COLORWHITE; 

    VAR13:=(HIGH+LOW+CLOSE+OPEN)/4; 

    VAR14:=MA(VAR13,3); 

    VAR15:=REF((CLOSE+OPEN)/2,1) REF((CLOSE+OPEN)/2,2)ANDREF( 

    MIN(CLOSE,OPEN),1) REF(MAX(CLOSE,OPEN),2); 

    VAR16:=(MAX(VAR13,VAR14)-MIN(VAR13,VAR14))/MIN(VAR13,VAR 

    14)*100; 

    VAR17:=(VAR14-(REF(VAR14,1)-VAR14)-LOW)/LOW*100; 

    VAR18:=(VAR10+(VAR10-REF(VAR10,1))-LOW)/LOW*100; 

    VAR19:=VAR14-(REF(VAR14,1)-VAR14); 

    VAR20:=VAR10+(VAR10-REF(VAR10,1)); 

    VAR21:=IF(VAR15,VAR18,VAR17); 

    P:=10; 

    豆:=REF(HIGH,P)=HHV(HIGH,2*P+1); 

    豆豆:=FILTER(豆,P); 

    豆豆1981:=BACKSET(豆豆,P+1); 

    豆1981:=FILTER(豆豆1981,P);{高点}压力:REF(HIGH,BARSLAST(豆 

    1981)),COLORFF00FF,POINTDOT; 

    R11:=BACKSET(ISLASTBAR,BARSLAST(豆1981)+1); 

    S11:=R11 REF(R11,1); 

    压力轨:DRAWLINE(豆 

    1981,HIGH,S11,HIGH,1),COLORYELLOW; 

    AA2:=REF(LOW,P)=LLV(LOW,2*P+1); 

    {GUPIAOFF.COM};BB2:=FILTER(AA2,P); 

    CC2:=BACKSET(BB2,P+1);{000001ZX.coM};DD2:=FILTER(CC2 

    ,P);{低点} 

    支撑:REF(LOW,BARSLAST(DD2)),COLOR00FF00,POINTDOT; 

    T11:=BACKSET(ISLASTBAR,BARSLAST(DD2)+1); 

    U11:=T11 REF(T11,1); 

    支撑轨:DRAWLINE(DD2,LOW,U11,LOW,1),COLORBLUE; 

    中轨:(压力轨+支撑轨)/2,COLORWHITE;


    image.png



    二、趋势线副图指标


     

    A:=VOL*CLOSE; 

    B:=SUM(A,1)/SUM(VOL,1); 

    B1:=EMA(B,17); 

    :=(B-B1)*100/B; 

    DIFF:EMA(资金,12)-EMA(资金,26); 

    DEA:EMA(DIFF,9); 

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

    STICKLINE(MACD =0,MACD,0,4,1),COLORF00FF0; 

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

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,3,0),COLOR00AAFF; 

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,2.2,0),COLOR00BBFF; 

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,1.8,0),COLOR00CCFF; 

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,1.3,0),COLOR00DDFF; 

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,0.9,0),COLOR00EEFF; 

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,0.5,0),COLOR00FFFF; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,4,0),COLOR0000AA; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,3.3,0),COLOR0011BB; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,2.2,0),COLOR0022CC; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,1.65,0),COLOR0033DD; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,1.1,0),COLOR0044EE; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,0.55,0),COLOR0055FF; 

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,4,0),COLORAA00BB; 

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,3.3,0),COLORBB11BB; 

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,2.2,0),COLORCC22BB; 

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,1.65,0),COLORDD33BB; 

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,1.1,0),COLOREE44BB; 

    STICKLINE(MACD REF(MACD,1)AND 

    MACD 0,0,MACD,0.55,0),COLORFF55BB; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,4,0),COLORFFAA00; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,3.3,0),COLORFFBB11; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,2.2,0),COLORFFCC22; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,1.65,0),COLORFFDD33; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,1.1,0),COLORFFEE44; 

    STICKLINE(MACD =REF(MACD,1)AND 

    MACD 0,0,MACD,0.55,0),COLORFFFF55; 

    IF(DIFF 0,DIFF,0),COLORRED,LINETHICK1; 

    IF(DIFF 0,0,DIFF),COLORYELLOW,LINETHICK1; 

    IF(DIFF DEA,DIFF,DEA),COLOR00FF00,LINETHICK1; 

    IF(DIFF DEA,DEA,DEA),COLORWHITE,LINETHICK1; 

    低位:=CROSS(DIFF,DEA)ANDDIFF -0.1; 

    STICKLINE(低位金叉,0,-4.5,2,0),COLORYELLOW; 

    DRAWTEXT(低位金叉,-4, 低位金叉 ),COLORYELLOW; 

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

    二次金叉:=CROSS(DIFF,DEA) 

    COUNT(JCCOUNT=2,21)=1; 

    STICKLINE(二次金叉,0,-2.5,5,0),COLORFF00FF; 

    DRAWICON(二次金叉,DEA*1.2,11); 

    DRAWTEXT(二次金叉,-2, 二次金叉 ),COLORFF00FF; 

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

    底:=REF(CLOSE,A1+1) CLOSEANDDIFF REF(DIFF,A1+1) 

    ANDCROSS(DIFF,DEA); 

    STICKLINE(底背离,0,2.5,3,0),COLOR00FF00; 

    DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2; 

    DRAWTEXT(底背离,2, 底背离 ),COLOR00FF00; 

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

    顶背离:=REF(CLOSE,A2+1) CLOSEAND 

    REF(DIFF,A2+1) DIFFANDCROSS(DEA,DIFF); 

    STICKLINE(顶背离,0,4.5,3,0),COLORFFFF00; 

    DRAWLINE(A2=0,DEA, 

    离,DEA,0),COLORFFFF00,LINETHICK2; 

    DRAWTEXT(顶背离,4, 顶背离 ),COLORFFFF00; 

    MMS:=MA(SMA((L+H+2*C)/4-REF((L+H+2*C)/4,1),5,1)/SM 

    A(ABS((L+H+2*C)/4-REF((L+H+2*C)/4,1)),5,1)*100,1)+50; 

    G1:=IF(-MMS 95,0,20); 

    UOO:=(-(((CLOSE-LLV(CLOSE,7))/(HHV(CLOSE,7)- 

    LLV(CLOSE,7))*100=100) 0ANDG1)+1); 

    KS:=(((CLOSE-EMA(CLOSE,13))/EMA(CLOSE,13))*(0- 

    100)); 

    KS1:=IF(BARSCOUNT(C)=1,C/10000,(1-C/SMA(C,13,1))*10 

    0); 

    趋势线:=EMA(((KS/10)+EMA(CLOSE,10)),3); 

    AA:=-100*(趋势线-CLOSE)/趋势线; 

    AC:=(EMA(AA,5)); 

    SSL:=EMA(CLOSE,3); 

    MMV:=EMA(((SLOPE(CLOSE,22)*20)+CLOSE),55); 

    MM:=MA(MMV,1); 

    STICKLINE(((SSL MM)),SSL,MM,0.01,0),COLORRED; 

    SA:=(MM*0.985); 

    SS:=(MA(CLOSE,5)); 

    DD:=(MA(CLOSE,13)); 

    GG:=(MA(CLOSE,21)); 

    捞钱 

    手:IF(((SSL MM)),MM,SA),LINETHICK2,COLORFF00FF; 

    {IF(SSL MM,捞钱 

    手,DRAWNULL),LINETHICK2,COLORFFFFFF;} 

    能量线:=DMA(((CLOSE+OPEN)/2),(VOL/(SMA(VOL,4,1) 

    *4))); 

    上开:=O; 

    上收:=C; 

    上高:=H; 

    上低:=L; 

    JJ:=(上开+上高+上低)/3; 

    A:=EMA(JJ,4); 

    智能黄金线:A,COLORYELLOW,LINETHICK1; 

    B:=REF(A,1)


    image.png



    [源码注释]通达信公式动态公式解读

    输出XG:(收盘价/10日前的收盘价-1)*100 20


    推荐阅读:趋势主图指标公式


     

    A=(3C+H+L+O)6; 

    XJ=(A+0.618REF(A,1)+0.382REF(A,2)+0.236REF(A,3)+0.146REF(A,4))2.382; 

    YCZXH=(MA(HHV(A,2),5)+MA(HHV(A,2),13)+MA(HHV(A,2),21)+MA(HHV(A,2 

    ),32))4; 

    YCZXL=(MA(LLV(A,2),5)+MA(LLV(A,2),13)+MA(LLV(A,2),21)+MA(LLV(A,2),32 

    ))4; 

    PJ=(10A+9REF(A,1)+8REF(A,2)+7REF(A,3)+6REF(A,4)+5REF(A,5)+4REF(A,6 

    )+3REF(A,7)+2REF(A,8)+REF(A,9))55; 

    A1=EMA(PJ,3),COLOR004000;A2=EMA(PJ,5),COLOR004000; 

    A3=EMA(PJ,7),COLOR004000;A4=EMA(PJ,9),COLOR004000; 

    A5=EMA(PJ,11),COLOR004000; 

    LX=REF(XJ,1); 

    ZD=(SMA(MAX(XJ-LX,0),5,1)SMA(ABS(XJ-LX),5,1))100; 

    KX1=(CLOSE=OPEN)ANDZD=50; 

    KX2=(CLOSEOPEN)ANDZD=50; 

    KX3=(CLOSE=OPEN)ANDZD50; 

    KX4=(CLOSEOPEN)ANDZD50; 

    AAA2=SUM(IF(CLOSEREF(CLOSE,1),VOLC,0),0); 

    AAA3=SUM(IF(CLOSEREF(CLOSE,1),VOLC,0),0); 

    AAA4=SUM(IF(CLOSE=REF(CLOSE,1),VOLC,0),0); 

    BBB1=0; 

    B1万元=DVOLDCLOSE100; 

    B1差=B1万元-REF(B1万元,1); 

    B2万元=DVOLDCLOSE100; 

    B2比=B2万元REF(B2万元,1); 

    净流入万元=(AAA2-AAA3-0.5AAA4); 

    PM=MA(净流入万元,1); 

    PMA=PMREF(PM,1)1; 

    PMB=REF(PMA,1)1ANDPMA; 

    密码=(EMA(MA(B1万元,2),2))100000,COLORYELLOW,NODRAW; 

    二日比=密码REF(密码,1); 

    =PMBAND密码REF(密码,1)AND二日比1,COLORRED,NODRAW; 

    均价线=AMOUNTV100; 

    均价线2=MA(均价线,3); 

    均价线5=MA(均价线,5); 

    均价线10=MA(均价线,10); 

    均价线30=MA(均价线,30); 

    =C均价线2AND均价线2REF(均价线2,1)ANDREF(均价线2,1)REF(均价 

    线2,2) 

    ANDREF(均价线2,2)REF(均价线2,3)AND选股; 

    STICKLINE(突破,O,C,3,0),COLORYELLOW; 

    STICKLINE(突破,H,C,0.01,0),COLORYELLOW; 

    STICKLINE(突破,L,O,0.01,0),COLORYELLOW; 

    DRAWTEXT(突破,L0.98, 黄金K线 ),COLORYELLOW; 

    M3:MA(CLOSE,3); 

    M13:MA(CLOSE,13); 

    M34:MA(CLOSE,34),COLORRED,LINETHICK2; 

    IF(M34 REF(M34,1),M34,DRAWNULL),COLORGREEN,LINETHICK2; 

    STICKLINE(M3 =M13ANDM34 =REF(M34,1),H,L,0.4,0),COLOR0000DD;{红} 

    STICKLINE(M3 =M13ANDM34 =REF(M34,1)ANDC =O,O,C,3,1),COLOR000077; 

    STICKLINE(M3 =M13ANDM34 =REF(M34,1)ANDC =O,O,C,2.5,1),COLOR000099; 

    STICKLINE(M3 =M13ANDM34 =REF(M34,1)ANDC =O,O,C,1.9,1),COLOR0000BB; 

    STICKLINE(M3 =M13ANDM34 =REF(M34,1)ANDC =O,O,C,1.2,1),COLOR0000DD; 

    STICKLINE(M3 =M13ANDM34 =REF(M34,1)ANDC =O,O,C,0.4,1),COLOR0000FF; 

    STICKLINE(M3 =M13ANDM34 =REF(M34,1)ANDC O,O,C,3,0),COLOR000077; 

    STICKLINE(M3 =M13ANDM34 =REF(M34,1)ANDC O,O,C,2.5,0),COLOR000099; 

    STICKLINE(M3 =M13ANDM34 =REF(M34,1)ANDC O,O,C,1.9,0),COLOR0000BB; 

    STICKLINE(M3 =M13ANDM34 =REF(M34,1)ANDC O,O,C,1.2,0),COLOR0000DD; 

    STICKLINE(M3 =M13ANDM34 =REF(M34,1)ANDC O,O,C,0.4,0),COLOR0000FF; 

    STICKLINE(M3 M13ANDM34 =REF(M34,1),H,L,0.4,0),COLORFFBB00;{天兰} 

    STICKLINE(M3 M13ANDM34 =REF(M34,1)ANDC =O,O,C,3,1),COLORFF3300; 

    STICKLINE(M3 M13ANDM34 =REF(M34,1)ANDC =O,O,C,2.5,1),COLORFF5500; 

    STICKLINE(M3 M13ANDM34 =REF(M34,1)ANDC =O,O,C,1.9,1),COLORFF7700; 

    STICKLINE(M3 M13ANDM34 =REF(M34,1)ANDC =O,O,C,1.2,1),COLORFF9900; 

    STICKLINE(M3 M13ANDM34 =REF(M34,1)ANDC =O,O,C,0.4,1),COLORFFBB00; 

    STICKLINE(M3 M13ANDM34 =REF(M34,1)ANDC O,O,C,3,0),COLORFF1100; 

    STICKLINE(M3 M13ANDM34 =REF(M34,1)ANDC O,O,C,2.5,0),COLORFF3300; 

    STICKLINE(M3 M13ANDM34 =REF(M34,1)ANDC O,O,C,1.9,0),COLORFF5500; 

    STICKLINE(M3 M13ANDM34 =REF(M34,1)ANDC O,O,C,1.2,0),COLORFF7700; 

    STICKLINE(M3 M13ANDM34 =REF(M34,1)ANDC O,O,C,0.4,0),COLORFF9900; 

    STICKLINE(M3 M13ANDM34 REF(M34,1),H,L,0.4,0),COLOR00FF00;{绿} 

    STICKLINE(M3 M13ANDM34 REF(M34,1)ANDC =O,O,C,3,0),COLOR007700; 

    STICKLINE(M3 M13ANDM34 REF(M34,1)ANDC =O,O,C,2.5,0),COLOR009900; 

    STICKLINE(M3 M13ANDM34 REF(M34,1)ANDC =O,O,C,1.9,0),COLOR00BB00; 

    STICKLINE(M3 M13ANDM34 REF(M34,1)ANDC =O,O,C,1.2,0),COLOR00DD00; 

    STICKLINE(M3 M13ANDM34 REF(M34,1)ANDC =O,O,C,0.4,0),COLOR00FF00; 

    STICKLINE(M3 M13ANDM34 REF(M34,1)ANDC O,O,C,3,1),COLOR006600; 

    STICKLINE(M3 M13ANDM34 REF(M34,1)ANDC O,O,C,2.4,1),COLOR009900; 

    STICKLINE(M3 M13ANDM34 REF(M34,1)ANDC O,O,C,1.8,1),COLOR00BB00; 

    STICKLINE(M3 M13ANDM34 REF(M34,1)ANDC O,O,C,1.2,1),COLOR00DD00; 

    STICKLINE(M3 M13ANDM34 REF(M34,1)ANDC O,O,C,0.4,1),COLOR00FF00; 

    STICKLINE(M3 =M13ANDM34 REF(M34,1),H,L,0.4,0),COLORFF66FF;{粉} 

    STICKLINE(M3 =M13ANDM34 REF(M34,1)ANDC =O,O,C,3,1),COLOR0000BB; 

    STICKLINE(M3 =M13ANDM34 REF(M34,1)ANDC =O,O,C,2.4,1),COLOR0000DD; 

    STICKLINE(M3 =M13ANDM34 REF(M34,1)ANDC =O,O,C,1.8,1),COLORCC11FF; 

    STICKLINE(M3 =M13ANDM34 REF(M34,1)ANDC =O,O,C,1.2,1),COLORCC44FF; 

    STICKLINE(M3 =M13ANDM34 REF(M34,1)ANDC =O,O,C,0.4,1),COLORCC66FF; 

    STICKLINE(M3 =M13ANDM34 REF(M34,1)ANDC O,O,C,3,0),COLOR9900FF; 

    STICKLINE(M3 =M13ANDM34 REF(M34,1)ANDC O,O,C,2.4,0),COLORFF22FF; 

    STICKLINE(M3 =M13ANDM34 REF(M34,1)ANDC O,O,C,1.8,0),COLORFF66FF; 

    STICKLINE(M3 =M13ANDM34 REF(M34,1)ANDC O,O,C,1.2,0),COLORFF99FF; 

    STICKLINE(M3 =M13ANDM34 REF(M34,1)ANDC O,O,C,0.4,0),COLORFFCCFF;


    image.png

    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 趋势画线主图指标公式(趋势线副图指标) 加入收藏