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

    正文概述    2024-05-04 04:03:12  


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


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


    授权方式: 免费版


    指标评级: ★★★★★


    指标分类: 策略


    画线方法: 副图



    一、指标公式

     

    A:=VOL*CLOSE; 

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

    B1:=EMA(B,17); 

    主力:=(B-B1)*100/B,COLORYELLOW; 

    买:IF(主力 0AND0 =REF(主力,1),6,DRAWNULL),CROSSDOT,LINETHICK3,COLORRED; 

    买1:IF(REF(主力,1) 3ANDREF(主力,1) 0AND(主力-REF(主力,1)) 6,6,DRAWNULL),CROSSDOT,LINETHICK3,COLORRED; 

    卖 

    2:IF(REF(主力,1) 0 

    :IF(主力 0 

    AND(主力-REF(主 

    0 =REF(主力,1)) 6,6,DRAWNULL),CROSSDOT,LINETHICK3,COLORRED; 

    AND 

    AND 

    力,1),6,DRAWNULL),CROSSDOT,LINETHICK3,COLORGREEN; 

    1:IF(REF(主力,1) 8REF(主力,1)-主力 6,6,DRAWNULL),CROSSDOT,LINETHICK3,COLORGREEN; 

    {黄金作为中线指标} 

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

    AA:=EMA(JJ,5); 

    BB:=REF(AA,1); 

    CC:IF(AA BB,0,DRAWNULL),CIRCLEDOT,LINETHICK3,COLOR 

    RED; 

    DD:IF(AA =BB,0,DRAWNULL),CIRCLEDOT,LINETHICK3,COLO 

    RGREEN; 

    {20日作为指标} 

    EE:=EMA(JJ,20); 

    持持股币 

    :IF(EE REF(EE,1),- 

    :IF(EE =REF(EE,1),- 

    3,DRAWNULL),CROSSDOT,LINETHICK3,COLORRED; 

    3,DRAWNULL),CROSSDOT,LINETHICK3,COLORGREEN; 

    {3日均线作为指标} 

    FF:IF(EMA(CLOSE,3) REF(EMA(CLOSE,3),1),3,DRAWNULL),CI 

    RCLEDOT,LINETHICK3,COLORRED; 

    GG:IF(EMA(CLOSE,3) =REF(EMA(CLOSE,3),1),3,DRAWNULL), 

    CIRCLEDOT,LINETHICK3,COLORGREEN; 

    {利多方舟} 

    VAR100:=(100-((90*(HHV(HIGH,20)-CLOSE))/ 

    (HHV(HIGH,20)-LLV(LOW,20)))); 

    VAR200:=(100-((90*(HHV(HIGH,20)-CLOSE))/ 

    (HHV(HIGH,20)-LLV(LOW,20)))); 

    VAR300:=(100-MA(((100*(HHV(HIGH,5)-CLOSE))/ 

    (HHV(HIGH,5)-LLV(LOW,5))),34)); 

    {综合判断}

    N1:=9;N2:=5; 

    MTM:=C-REF(C,1); 

    主⼒轨迹:100*EMA(EMA(MTM,N1),N1)/EMA(EMA(ABS(MTM),N1),N1),COLORWHITE; 

    MAZL:MA(主⼒轨迹,N2),COLORYELLOW; 

    VAR1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1); 

    VAR2:=SMA(ABS(LOW-VAR1),13,1)/SMA(MAX(LOW-VAR1,0),10,1); 

    VAR3:=EMA(VAR2,10); 

    VAR4:=LLV(LOW,33); 

    VAR5:=EMA(IF(LOW =VAR4,VAR3,0),3); 

    主⼒进场:IF(VAR5 REF(VAR5,1),VAR5,0),COLORRED,NODRAW; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,3,0),COLOR000055; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,2.6,0),COLOR000077; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,2.1,0),COLOR000099; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,1.5,0),COLOR0000BB; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,0.9,0),COLOR0000DD; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,0.3,0),COLOR0000FF; 

    洗盘:IF(VAR5 REF(VAR5,1),VAR5,0),COLOR000079,NODRAW; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,3,0),COLOR000079; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,2.6,0),COLOR000093; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,2.1,0),COLOR0000C6; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,1.5,0),COLOR4A4AFF; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,0.9,0),COLOR7D7DFF; 

    STICKLINE(VAR5 REF(VAR5,1),0,VAR5,0.3,0),COLORAAAAFF; 

    VAR21:=SMA(ABS(HIGH-VAR1),13,1)/SMA(MIN(HIGH-VAR1,0),10,1); 

    VAR31:=EMA(VAR21,10); 

    VAR41:=HHV(HIGH,33); 

    VAR51:=EMA(IF(HIGH =VAR41,VAR31,0),3); 

    主⼒拉⾼:IF(VAR51 REF(VAR51,1),VAR51,0),COLORYELLOW,NODRAW; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,3,0),COLOR005555; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,2.6,0),COLOR007777; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,2.1,0),COLOR009999; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,1.5,0),COLOR11BBBB; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,0.9,0),COLOR33DDDD; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,0.3,0),COLOR55FFFF; 

    出货:IF(VAR51 REF(VAR51,1),VAR51,0),COLORCYAN,NODRAW; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,3,0),COLORCYAN; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,3,0),COLOR555555; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,2.6,0),COLOR777777; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,2.1,0),COLOR999999; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,1.5,0),COLORBBBBBB; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,0.9,0),COLORDDDDDD; 

    STICKLINE(VAR51 REF(VAR51,1),0,VAR51,0.3,0),COLORFFFFFF


    image.png


    二、主力副图顶底指标公式

     

    n1(1.100.9),n2(1,100,5) 

    主力:EMA(100*(C￾LLV(LOW,30)/(HHV(H,30)-LLV(LOW,30),3),COLORRED,LINETHICK2; 

    即将爆发线:65,COLOR00FF00; 

    起爆线:80,COLORWHITE,LINETHICKI; 

    DRAWTEXT(CROSS(主力资金,起爆线),主力资金,爆 

    发!),COLORYELLOW; 

    TMD:=C-REF(C,1); 

    线: 

    100*EMA(EMA(TMD,NI),NID/EMA(EMA(ABSITMD),ND,NID,COLORWHITE 

    ,LINETHICKI; 

    银线:MA(金线,N2),COLOROOFF00,LINETHICKI;STICKLINE(金线 银 

    线,金线,银线 

    ,2.5,0 ,COLORRED,LINETHICK2; 

    ST1CKLINE(银线 金线,金线,银 

    线,2.5,0),COLORGREEN,LINETHICK2; 

    爆发线:30,COLORFF00FF,LINETHICKI;起步线: 

    0,COLORWHITE,LINETHICKI; 

    DRAWTEXT(CROSS(起爆线,主力资金),起爆线,:空 

    仓!),COLORYELLOW; 

    线:-25,COLORWHITE,LINETHICKI; 

    DRAWTEXTICROSS(金线,爆发线),金线,爆发!),COLORWHITE; 

    DRAWTEXT(CROSS(主力资金,即将爆发线),主力资金;加 

    仓”,COLORWHITE; 

    DRAWTEXT(CROSS(金线,起步线),金线,加仓!”,COLORWHITE; 

    DRAWTEXT(CROSS(金线,抄底线),金线,半仓!),COLORWHITE; 

    LC=REF(C,1); 

    F1:=ZIG(3,10); 

    方向:IF(F1  

    REF(F1,1),40,105),COLOROOFF00,LINETHICK2; 

    DRAWTEXT(CROSS(抄底线,方向),抄底线,逢低进场!), 

    COLORRED; 

    DRAWTEXT(CROSS(方向,抄底线),方向+20,逢高出 

    场!”,COLORWHITE; 

    DRAWTEXTICROSS(金线,起爆线),金线,爆发!),COLORWHITE;

     

    N:=35;M:=35;N1:=3; 

    B1:=(HHV(H,N)-C)/(HHV(H,N)-LLV(LOW,N))*100-M; 

    B2:=SMA(B1,N,1)+100; 

    B3:=(C-LLV(L,N))/(HHV(H,N)-LLV(L,N))*100; 

    B4:=SMA(B3,3,1); 

    B5:=SMA(B4,3,1)+100; 

    B6:=B5-B2; 

    控盘程度:(IF(B6 N1,B6-N1+2,0))*2.5,COLORYELLOW; 

    控盘度:100,COLORRED; 

    STICKLINE(控盘程度,0,控盘程度,1.7,0),COLOR00FFFF; 

    STICKLINE(控盘程度AND控盘程度 100,100,控盘程 

    度,1.7,0),COLORRED;主力状态 

    ZLCM:=EMA(WINNER(CLOSE)*70,3);{//主力估算} 

    SHCM:=EMA((WINNER(CLOSE*1.1)-WINNER(CLOSE*0.9))*8 

    0,3);{//筹码估算} 

    ZSHTL:=SHCM/(ZLCM+SHCM)*100;{//散户套牢筹码比率} 

    ZZLKP:=ZLCM/(ZLCM+SHCM)*100;{//主力控盘筹码比率}

    ZCMZL:=MA(ZLCM+SHCM,13);{//市场筹码总量} 

    ZZNTS:=BARSLAST(ZSHTL90);{//走牛天数} 

    ZSHJJ:=EMA(ZSHTL,89);{//散户警戒} 

    ZZLJJ:=EMA(ZZLKP,89);{//主力警戒} 

    ZJLRQD:=INTPART(ZZLKP-ZZLJJ);{//资金流入强度} 

    SH8:=EMA(ZSHTL,8); 

    DKB:=IF(ZZLKP-REF(ZZLKP,1) ZSHTL-REF(ZSHTL,1),1,0); 

    {散户套牢筹码} 

    STICKLINE(C 0,ZSHTL,ZZLKP,1,0),COLORFFFFFF; 

    {散户筹码警戒} 

    STICKLINE(ZSHJJ REF(ZSHJJ,1),ZSHTL,ZSHJJ,2,0),COLOR00F 

    F00; 

    {主力控盘筹码} 

    STICKLINE(C 0,ZZLKP,0,1,0),COLORA4A4A4; 

    {筑顶风险区} 

    STICKLINE(ZZLKP 75,ZZLKP,0,1,0),COLORFFFFFF; 

    {顶部:(ZZLKP 75),COLORFFFFFF;} 

    {主力筹码警戒} 

    STICKLINE(ZZLJJ REF(ZZLJJ,1),ZZLKP,ZZLJJ,2,0),COLORRED; 

    {筑底散兵坑} 

    STICKLINE(ZSHTL =90,ZZLKP,0,2,0),COLOR66FFCC; 

    {底部:(ZSHTL =90),COLOR66FFCC;} 

    {筹码总量上升} 

    IF(ZCMZL,ZCMZL REF(ZCMZL,1),0),COLOR0066FF,LINETHIC 

    K1; 

    {增量资金}; 

    {//------【数值显示】} 

    散户套牢系数:INTPART(ZSHTL),COLORCYAN,LINETHICK2; 

    主力控盘系数:INTPART(ZZLKP),COLORYELLOW,LINETHICK2; 

    资金流入强度:ZJLRQD,LINETHICK2,COLORRED; 

    资金流入强度 

    2:IF(ZJLRQD 10,ZJLRQD,0),LINETHICK2,COLORWHITE; 

    市场筹码总量:INTPART(ZCMZL),COLORWHITE,LINETHICK0; 

    DRAWICON(CROSS(主力控盘系数,散户套牢系数),散户套牢 

    系数-5,11); 

    DRAWICON(CROSS(资金流入强度,散户套牢系数),散户套牢 

    系数-5,17);


    image.png


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


    A赋值:(手)*收盘价

    B赋值:A的1日累和/成交量(手)的1日累和

    B1赋值:B的17日指数移动平均

    输出进:当满足条件((B-B1)*1500/B) =0AND0 =1日前的0时,在0和((B-B1)*1500/B)位置之间画柱状线,宽度为2,1不为0则画空心柱.,画红色

    输出出:当满足条件((B-B1)*1500/B) 0AND0 =1日前的0时,在0和((B-B1)*1500/B)位置之间画柱状线,宽度为2,1不为0则画空心柱.,画绿色

    输出主力:(B-B1)*1500/B 画红色,NODRAW

    100

    输出XG:主力突破 100

    当满足条件主力突破 100ANDNOT(最低价=最高价)AND主力突破 1日前的主力突破时,在主力突破位置画24号图标

    N赋值:8

    M赋值:13

    P赋值:60

    S赋值:3

    V1赋值:(收盘价*2+最高价+最低价)/4*10

    V2赋值:V1的13日指数移动平均-V1的34日指数移动平均

    V3赋值:V2的5日指数移动平均

    V4赋值:2*(V2-V3)*5.5

    输出超大主力吃: 如果V4 =0,返回V4,否则返回0,画黄色,线宽为3

    输出超大主力吐: 如果V4 =0,返回V4,否则返回0,COLOR66FF00,线宽为3

    V5赋值:(8日内的最高价的最高值-大盘的收盘价)/(8日内大盘的最高价的最高值-8日内大盘的最低价的最低值)*8

    V6赋值:3*V5-2*V5的18日[1日权重]移动平均的5日指数移动平均

    V7赋值:(大盘的收盘价-8日内大盘的最低价的最低值)/(8日内大盘的最高价的最高值-8日内大盘的最低价的最低值)*10

    V8赋值:(大盘的收盘价*2+大盘的最高价+大盘的最低价)/4

    V9赋值:V8的13日指数移动平均-V8的34日指数移动平均

    VA赋值:V9的3日指数移动平均

    VB赋值:(V9-VA)/2

    输出超大主力吃线:28,COLORFF80FF,线宽为3


    推荐阅读:顶底王指标公式

     

    AA:=LLV(LOW,34); 

    BB:=HHV(HIGH,30); 

    DD:=(EMA(((CLOSE-AA)/(BB-AA))*(4),4))*(25); 

    ⾕:=(((DD-LLV(DD,21))/(HHV(DD,21)-LLV(DD,21)))*(4))*(25); 

    VAR1:=(CLOSE-LLV(LOW,36))/(HHV(HIGH,36)-LLV(LOW,36))*100; 

    VAR2:=SMA(VAR1,3,1); 

    VAR3:=SMA(VAR2,3,1); 

    VAR4:=SMA(VAR3,3,1); 

    波:VAR3,COLORWHITE; 

    段:VAR4,COLORYELLOW; 

    VAR6:=CROSS(VAR3,VAR4)ANDVAR3  

    DRAWTEXT(FILTER(VAR6,10)=1,40, 买 ),LINETHICK1,COLOR00AAFF; 

    STICKLINE(FILTER(VAR6,10)=1,0,90,1,0),COLORRED; 

    VAR7:=CROSS(VAR4,VAR3)ANDVAR3  

    STICKLINE(FILTER(VAR7,5)=1,0,90,1,0),COLORGREEN; 

    DRAWTEXT(FILTER(VAR7,5)=1,70, 卖 ),LINETHICK1,COLORFFCC66; 

    :3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)- 

    2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)- 

    LLV(LOW,27))*100,5,1),3,1),LINETHICK0,COLORWHITE; 

    VAR8:=CROSS(VAR2,VAR3)ANDVAR3 80ANDVAR3 VAR4; 

    VAR9:=CROSS(趋势,VAR2)AND趋势 20and=  

    分批卖出:STICKLINE(VAR8,50,90,1,0),COLOR008360,LINETHICK3; 

    分批买⼊:STICKLINE(VAR9,40,0,1,0),COLOR000080,LINETHICK3; 

    90,COLORGREEN; 

    0,COLORYELLOW; 

    VAR01:=EMA((CLOSE-LLV(LOW,25))/(HHV(HIGH,25)-LLV(LOW,25))*100,5); 

    VAR02:=(HHV(HIGH,25)-LLV(LOW,25))/EMA((CLOSE-LLV(LOW,25)),5); 

    VAR03:=CROSS(VAR02,VAR01); 

    VAR04:=REF(VAR02,2)  

    VAR05:=COUNT(VAR03,7) 0ANDVAR04; 

    VAR06:=REF((LOW+OPEN+CLOSE+HIGH)/4,1); 

    VAR07:=SMA(ABS(LOW-VAR06),13,1)/SMA(MAX(LOW-VAR06,0),10,1); 

    VAR08:=EMA(VAR07,10); 

    VAR09:=EMA(C,5); 

    VAR10:=LLV(LOW,33); 

    VAR11:=EMA(IF(LOW  

    VAR12:=IF(VAR11 100,VAR11*0.312,VAR11); 

    资⾦⼊场:VAR02,COLORRED; 

    BAR1:=REF(LOW,1); 

    BAR2:=SMA(ABS(LOW-BAR1),13,1)/SMA(MAX(LOW-BAR1,0),13,1)*4; 

    BAR3:=EMA(BAR2,13); 

    BAR4:=LLV(LOW,34); 

    BAR5:=EMA(IF(LOW  

    BAR6:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)- 

    LLV(LOW,75))*100,20,1)+2*SMA(SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)- 

    LLV(LOW,75))*100,20,1),15,1); 

    BAR7:=100-3*SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)- 

    LLV(LOW,75))*100,20,1)+2*SMA(SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)- 

    LLV(LOW,75))*100,20,1),15,1); 

    BAR8:=BAR6VOL REF(VOL,1)ANDCLOSE REF(CLOSE,1); 

    散户:STICKLINE(BAR5 REF(BAR5,1),0,BAR5,0.5,0),COLORGREEN,LINETHICK1; 

    STICKLINE(BAR8ANDCOUNT(BAR8,30)=1,0,18,0.5,0),COLORBLUE,LINETHICK3; 

    STICKLINE(BAR8ANDCOUNT(BAR8,30)=1,18,36,0.5,0),COLORFF7700,LINETHICK3; 

    STICKLINE(BAR8ANDCOUNT(BAR8,30)=1,36,60,1,0),COLORYELLOW; 

    DRAWTEXT(BAR8ANDCOUNT(BAR8,30)=1,90, 主⼒进场★ ),COLORYELLOW; 

    RE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20; 

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

    R13:=(R12-MA(R12,14))/(0.015*AVEDEV(R12,14)); 

    R14:=(R12-MA(R12,70))/(0.015*AVEDEV(R12,70)); 

    R15:=IF(R13 =150ANDR13 200and= r14= =150ANDR14  

    R16:=IF(R13 =-150and= r13= -200ANDR14 =-150and= r14= -200,-10,R15); 

    R17:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100; 

    R18:=100-ABS(R17); 

    R19:=IF(R18  

    R1A:=IF(RE 0,RE,0); 

    R1B:=IF(R14 =200ANDR13 =150,15,IF(R14 =-200and=  

    R1C:=R1A 48ANDR1B 60ANDR19  

    DRAWTEXT(R1CANDCOUNT(R1C,25)=1,80, 分批出货 ),LINETHICK1,COLORFFCC66; 

    STICKLINE(R1CANDCOUNT(R1C,25)=1,90,60,0.5,0),COLORFFCC66;


    image.png


    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 主力顶底指标公式(主力副图顶底指标公式) 加入收藏