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

    正文概述    2024-05-04 04:25:48  


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


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


    授权方式: 免费版


    指标评级: ★★★★★


    指标分类: 策略


    画线方法: 副图



    一、指标公式源码

     

    J1:MA(C,7),COLORWHITE; 

    J2:MA(C,21),COLORYELLOW; 

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

    DEA:=EMA(DIFF,9); 

    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)ANDCROSS( 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)); 

    DRAWICON(B1 0,L-0.20,5); 

    DRAWTEXT(B1,L-0.30, MACD底背 ),COLORWHITE; 

    DRAWICON(B2 0,L-0.20,4); 

    DRAWTEXT(B2,L-0.30, KDJ底背 ),COLORFF00FF; 

    DRAWICON(B3 0,L-0.20,3); 

    DRAWTEXT(B3,L-0.30, RSI底背 ),COLORYELLOW; 

    DRAWICON(CROSS(DIFF,DEA)ANDCROSS( KDJ.K (9,3,3), KDJ.D (9,3,3)),L-0.20,6); 

    DRAWTEXT(CROSS(DIFF,DEA)ANDCROSS( KDJ.K (9,3,3), KDJ.D (9,3,3)),L-0.30, ),COLOR0099FF; 

    N1:=14;N:=8; 

    AAQ:=/((HIGH-LOW)*2-ABS(CLOSE-OPEN)); 

    买量:=IF(CLOSE OPEN,AAQ*(HIGH-LOW),IF(CLOSE OPEN,AAQ*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2)),LINETHICK0,COLORRED; 

    卖量:=IF(CLOSE OPEN,0-AAQ*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE OPEN,0-AAQ*(HIGH-LOW),0-VOL/2)),LINETHICK0,COLORCYAN; 

    进出量:=买量+卖量,COLOR00FFFF; 

    N日内净流入:SUM(进出量,5),LINETHICK2,COLORFF55BB; 

    流入:=IF(N日内净流入 REF(N日内净流入,1),N日内净流入,DRAWNULL),COLORYELLOW,LINETHICK2; 

    RSI1:=N日内净流入; 

    AA:=REF(RSI1,N)=HHV(RSI1,2*N+1); 

    BB:=BACKSET(AA,N+1); 

    CC:=FILTER(BB,N)ANDRSI1=HHV(RSI1,N+1); 

    A1:=BARSLAST(REF(CC,1)); 

    顶:=REF(CLOSE,A1+1) CLOSEANDREF(RSI1,A1+1) RSI1ANDCC; 

    STICKLINE(FILTER(顶背离 0,5),100,RSI1,1,0),COLORRED; 

    DRAWLINE(CC,RSI1,FILTER(顶背离 0,5),RSI1,0),COLORRED; 

    AA2:=REF(RSI1,N)=LLV(RSI1,2*N+1); 

    BB2:=BACKSET(AA2,N+1); 

    CC2:=FILTER(BB2,N)ANDRSI1=LLV(RSI1,N+1); 

    A2:=BARSLAST(REF(CC2,1)); 

    底背离:=REF(CLOSE,A2+1) CLOSEANDREF(RSI1,A2+1) RSI1ANDCC2; 

    STICKLINE(FILTER(底背离 0,5),0,RSI1,1,0),COLORCYAN; 

    DRAWLINE(CC2,RSI1,FILTER(底背离 0,5),RSI1,0),COLORCYAN; 

    0,LINETHICK2,COLORGREEN; 

    M1:=2;M2:=60; 

    MID1:=(3*CLOSE+LOW+OPEN+HIGH)/6; 

    乖离率:(SMA(MID1,M1,1)-MA(SMA(MID1,2,1),M2))/MA(SMA(MID1,2,1),M2)*100,COLOR999999; 

    MID:=乖离率; 

    MA1:(10*MID+9*REF(MID,1)+8*REF(MID,2)+7*REF(MID,3)+6*REF(MID,4)+5*REF(MID,5) 

    +4*REF(MID,6)+3*REF(MID,7)+2*REF(MID,8)+1*REF(MID,9))/55,COLOR0000DD; 

    MA2:EMA(MA1,8),COLORWHITE;{MA1取普通平均值} 

    IF(MA1 =REF(MA1,1),MA1,DRAWNULL),COLOR22FF22; 

    IF(MA2 =REF(MA2,1),MA2,DRAWNULL),COLOR33FF33; 

    {长中短周期把握} 

    N1A:=BARSLAST(CROSS(C,MA(C,13))); 

    N2A:=BARSLAST(CROSS(MA(C,13),C)); 

    跟踪:IF(N1A N2A,N1A+1,N2A+1)*0.01,COLORYELLOW,NODRAW;{上穿或下穿13线计时}; 

    N1B:=BARSLAST(CROSS(C,MA(C,60))); 

    N2B:=BARSLAST(CROSS(MA(C,60),C)); 

    跟踪:IF(N1B N2B,N1B+1,N2B+1)*0.01,COLORRED,NODRAW;{上穿或下穿60线计时}; 

    N1C:=BARSLAST(CROSS(C,MA(C,250))); 

    N2C:=BARSLAST(CROSS(MA(C,250),C)); 

    跟踪:IF(N1C N2C,N1C+1,N2C+1)*0.01,COLORGRAY,NODRAW;{上穿或下穿250线计时}; 

    V0:0,COLOR666666;{零轴}; 

    Z1:=STRCAT(HYBLOCK,  

    Z2:=STRCAT(Z1,DYBLOCK); 

    Z3:=STRCAT(Z2,  

    DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLORRED; 

    HAN:=DATE 1141230; 

    当前获利:=IF(WINNER(CLOSE),WINNER(CLOSE)*100,0); 

    DRAWKLINE(H,O,L,C); 

    九十集中:=(COST(95)-COST(5))/(COST(95)+COST(5))*100; 

    成本价:COST(九十成本集中),LINETHICK2,COLORMAGENTA; 

    入1:IF(成本价 REF(成本价,1),成本价,DRAWNULL),COLORRED,LINETHICK2; 

    出1:IF(成本价 REF(成本价,1),成本价,DRAWNULL),COLORGREEN,LINETHICK2; 

    STICKLINE(成本价 LOWAND成本价 HIGH,成本价,MIN(MIN(OPEN,CLOSE),成本价),3.2,0)*HAN,COLOR0077FF; 

    STICKLINE(成本价 LOWAND成本价 HIGH,成本价,MIN(MIN(OPEN,CLOSE),成本价),2.5,0)*HAN,COLOR0099FF; 

    STICKLINE(成本价 LOWAND成本价 HIGH,成本价,MIN(MIN(OPEN,CLOSE),成本价),1.9,0)*HAN,COLOR00BBFF; 

    STICKLINE(成本价 LOWAND成本价 HIGH,成本价,MIN(MIN(OPEN,CLOSE),成本价),1.2,0)*HAN,COLOR00DDFF; 

    STICKLINE(成本价 LOWAND成本价 HIGH,成本价,MIN(MIN(OPEN,CLOSE),成本价),0.3,0)*HAN,COLOR00FFFF; 

    STICKLINE(成本价 MIN(C,O)AND成本价 MAX(C,O),成本价,MIN(OPEN,CLOSE),3.2,0)*HAN,COLOR0077FF; 

    STICKLINE(成本价 MIN(C,O)AND成本价 MAX(C,O),成本价,MIN(OPEN,CLOSE),2.5,0)*HAN,COLOR0099FF; 

    STICKLINE(成本价 MIN(C,O)AND成本价 MAX(C,O),成本价,MIN(OPEN,CLOSE),1.9,0)*HAN,COLOR00BBFF; 

    STICKLINE(成本价 MIN(C,O)AND成本价 MAX(C,O),成本价,MIN(OPEN,CLOSE),1.2,0)*HAN,COLOR00DDFF; 

    STICKLINE(成本价 MIN(C,O)AND成本价 MAX(C,O),成本价,MIN(OPEN,CLOSE),0.3,0)*HAN,COLOR00FFFF; 

    STICKLINE(成本价 HIGH,CLOSE,OPEN,3.2,0)*HAN,COLOR0077FF; 

    STICKLINE(成本价 HIGH,CLOSE,OPEN,2.5,0)*HAN,COLOR0099FF; 

    STICKLINE(成本价 HIGH,CLOSE,OPEN,1.9,0)*HAN,COLOR00BBFF; 

    STICKLINE(成本价 HIGH,CLOSE,OPEN,1.2,0)*HAN,COLOR00DDFF; 

    STICKLINE(成本价 HIGH,CLOSE,OPEN,0.3,0)*HAN,COLOR00FFFF; 

    STICKLINE(成本价 HIGH,HIGH,LOW,0,0),COLORGREEN; 

    DF2:=(C-REF(C,1))/REF(C,1)*100  

    DF3:=(C-O)/O*100  

    当天涨幅:(C-O)/O*100,NODRAW; 

    V型:=L 成本价ANDDF2; 

    V型反转2:=CROSS(C,成本价)ANDDF2; 

    V型反转3:=L 成本价ANDDF3; 

    DRAWTEXT(V型反转,L*0.98, ↖狙击 ),COLORCYAN; 

    DRAWTEXT(V型反转2,L*0.98, ↖狙击 ),COLORCYAN; 

    DRAWTEXT(V型反转3,L*0.98, ↖狙击 ),COLORCYAN; 

    STICKLINE(V型反转=1,C,O,3.2,0),COLORRED; 

    STICKLINE(V型反转2=1,C,O,3.2,0),COLORRED; 

    STICKLINE(V型反转3=1,C,O,3.2,0),COLORRED;


    image.png

    公式解读:

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


    BIAS1赋值:(收盘价/收盘价的6日简单移动平均-1)*100

    BIAS2赋值:(收盘价/收盘价的12日简单移动平均-1)*100

    BIAS3赋值:(收盘价/收盘价的24日简单移动平均-1)*100

    AA1赋值:((成交额(元)的5日简单移动平均/(手)的5日简单移动平均-成交额(元)的110日简单移动平均/成交量(手)的110日简单移动平均)/(成交额(元)的5日简单移动平均/成交量(手)的5日简单移动平均)) -0.273

    当满足条件AA1ANDBIAS1 =-7ANDBIAS2 =-11ANDBIAS3 =-14时,在1和33位置之间画柱状线,宽度为1,0不为0则画空心柱.,画红色



    推荐阅读:智能买卖指标公式源码

    公式解读:

    每日公式解答:

    公式编写要求:

    连续3年加权净资产收益率在20%的公式。

    公式编写方法:

    XG:BARSLASTCOUNT(FINANCE(33)/FINANCE(34)*100 20)=3;


    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 趋势买卖指标公式源码(日线买卖指标公式源码) 加入收藏