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

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

授权方式: 免费版

指标评级: ★★★★★

指标分类: 策略

画线方法: 副图

一、阴线买入指标公式无未来函数

    E40:EXPMA(CLOSE,40);

    工作线:=MA(CLOSE,1);

    M3:MA(CLOSE,3)COLORRED;

    M13:MA(CLOSE,13)COLORGREEN;

    收:C,COLORRED,NODRAW;

    高:H,NODRAW;

    三:C*1.0348,NODRAW;

    五:C*1.055,NODRAW;

    八:C*1.0848,NODRAW;

    十:C*1.1048,NODRAW;

    十五:C*1.1548,NODRAW;

    廿:C*1.2048,NODRAW;

    止:C*(1-0.025),NODRAW;

    TT2:=DMA((((HIGH+LOW)+(CLOSE*2))/4.15),0.9);

    TT1:=REF(EMA(TT2,3),1);

    RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;

    K:=SMA(RSV,3,1);

    D:=SMA(K,3,1);

    J:=3*K-2*D;

    LC:=REF(CLOSE,1);

    RSI:=((SMA(MAX((CLOSE-LC),0),3,1)/SMA(ABS((CLOSE-LC)),3,1))*100);

    FF:=EMA(CLOSE,3);

    稻壳1:EMA(CLOSE,144),POINTDOT,COLORWHITE;

    稻壳2:EMA(C,318);

    AA1:=AMOUNT/VOL;

    BB1:=L<AA1*0.9;

    CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;

    DD1:=L<MA(C,5)*0.921;

    EE1:=VOL<MA(V,5)*1.5;

    FF1:=BB1ANDCC1ANDDD1ANDEE1;

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

    P1:=IF(C<REF(O,1)ANDF<0,1,0);

    P2:=IF(C<REF(O,2)ANDF<0,1,0);

    TT3:=P1=0ANDREF(P1,1)=1ANDP2=0ANDREF(P2,1)=1;

    TT4:=P1=1ANDREF(P1,1)=0ANDP2=1ANDREF(P2,1)=0;

    Z1:=MA(C,13);

    ZX:=REF(Z1,13/2+1);

    DRAWICON(CROSS(ZX,C),H*1.01,2);

    {DRAWTEXT(CROSS(工作线,M13)ANDJ<55,LOW,'入')COLORWHITE;}

    DRAWTEXT(CROSS(CLOSE,TT1)ANDJ<55,LOW,'买'),COLORRED;

    DRAWTEXT(CROSS(88,RSI),HIGH*1.02,'顶'),COLOR00FFFF;

    {DRAWTEXT(FF1,L*0.99,'超短'),COLOR00FF00;}

    STICKLINE(TT3,OPEN,CLOSE,3,0),COLORFF00FF;

    {STICKLINE(TT4,OPEN,CLOSE,3,0),COLORGREEN;};

    日跌:L*0.99,NODRAW,COLORFF00FF;

    周跌:L*0.94,NODRAW,COLORFF00FF;

    流通:=(AMOUNT/VOL);

    资金流量:=(CLOSE-REF(CLOSE,1))*流通;

    VAR111:=SMA(资金流量,10,1);

    MID111:=MA(VAR111,26);

    UPPER111:=MID111+2*STD(VAR111,26);

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

    总次数:=SUM(ZF>7,120)>=4;

    多头:=MA(C,20)>=REF(MA(C,20),1);

    强势:=VAR111>=UPPER111;

    TT1:=C/REF(C,1)>=1.07;

    强势买:=强势ANDTT1AND多头AND总次数;

    SS1:=O<=REF(C,1);

    指数300:="399300$CLOSE";

    DP:=指数300>=MA(指数300,5);

    低开买:CAPITAL/1000000<=8.888ANDMA(C,5)<48ANDREF(强势买,1)ANDSS1ANDDP;

    A2:=AMOUNT/(100*VOL);

    中线成本均线:=MA(A2,13);

    CYS:100*(C-中线成本均线)/中线成本均线+50,COLORCYAN,;

    VAR1:=(CLOSE*50)/100;

    VAR2:=MA(VAR1,30)*0.83;

    VAR3:=MA(VAR1/VAR2,3);

    IF(VAR3<1.06,VAR1*1.1+10,0)+30,COLORYELLOW,LINETHICK2;

    30;35;40;

    VAR51:=(CLOSE-MA(CLOSE,50))/MA(CLOSE,50)*100<-23;

    VAR52:=SMA(MAX(CLOSE-REF(CLOSE,1),0),3,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),3,1)*100>16;

    VAR53:=100*(HHV(HIGH,27)-CLOSE)/(HHV(HIGH,27)-LLV(LOW,27));

    旭日东升:VAR51ANDVAR52ANDCROSS(VAR53,79)AND(OPEN>CLOSEOROPEN<CLOSE)AND(OPEN-REF(CLOSE,1))/REF(CLOSE,1)<0.05ANDVOL>MA(VOL,23),COLORRED;

image.png

二、卖出指标公式无未来函数

    D:=72;

    TR1:=REF(HIGH,1)-REF(LOW,1);

    CDP1:=(REF(H,1)+REF(L,1)+REF(C,1))/3;

    AH1:=CDP1+TR1;

    BH1:=(CDP1+CDP1)-REF(L,1);

    YYK:=1;

    ARK:=1;

    BL1:=(CDP1+CDP1)-REF(H,1);

    AL1:=CDP1-TR1;

    TR8:=HIGH-LOW;

    CGP:=1;

    CDP:=(H+L+C)/3;

    AH:=CDP+TR8;

    BHD:=1;

    BH:=(CDP+CDP)-L;

    BL:=(CDP+CDP)-H;

    PAK:=1;

    AL:=CDP-TR8;

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

    DAE:=1;

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

    胜算买入:=(25),;

    高胜算炒股:=1;

    高胜算炒股系统:=1;

    安全操盘:=1;

    买入操盘:=1;

    卖出操盘:=IFN(买入操盘AND高胜算炒股系统ANDBHD,0,1);

    胜算系统:=IF(NOT(卖出操盘*高胜算炒股系统ANDCGPANDARK),0,1);

    买入:=IF(NOT(高胜算炒股AND买入操盘AND安全操盘*高胜算炒股AND高胜算炒股系统),0,1);

    卖出:=IFN(高胜算炒股AND高胜算炒股系统AND卖出操盘*高胜算炒股系统AND安全操盘*高胜算炒股,0,1);

    胜算操盘:=IFN(安全操盘ANDBHDAND高胜算炒股系统,0,1);

    安全线操盘:=IF(NOT(买入ANDDAE*ARKAND高胜算炒股系统),0,1);

    操盘线操盘:=IF(买入操盘*ARK*PAK*BHD,1,0);

    牛熊分界线操盘:=IFN(卖出,0,1);

    高胜算买入:=IF(NOT(安全操盘*高胜算炒股AND安全操盘*DAEAND安全线操盘AND高胜算炒股系统),0,1);

    高胜算卖出:=IFN(卖出操盘AND胜算系统*卖出操盘*ARKAND操盘线操盘,0,1);

    建仓:=IFN(NOT(高胜算炒股*买入AND买入操盘AND买入*高胜算炒股AND高胜算炒股系统),1,0);

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

    VAR4:=100-(3)*(VAR2)+(2)*(VAR3);

    加仓:=IFN(NOT(高胜算炒股*买入ANDDAEAND买入操盘*BHDAND卖出*高胜算炒股),1,0);

    清仓:=IFN(NOT(高胜算炒股*BHD*卖出AND卖出AND卖出*高胜算炒股AND高胜算炒股系统),1,0);

    高胜算出卖:=(-98),;

    VAR5:=((3)*(VAR2)+(2)*(VAR3))/(4);

    止损:=IFN(NOT(高胜算炒股*卖出操盘AND买入操盘AND安全操盘*高胜算炒股ANDPAK),1,0);

    操盘线:IF(安全线操盘AND高胜算炒股*清仓AND建仓*高胜算炒股系统AND止损*ARKAND买入*DAE,MA(C,4)*止损,0),COLORRED,LINETHICK3;

    VAR8:=REF(VAR5,1);

    操盘线标准:=(132),;

    X1:=(C+L+H)/3;

    X2:=EMA(X1,6);

    X3:=EMA(X2,5);

    安全线标准:=(24),;

    安全线:IF(安全线操盘*建仓ANDPAKAND止损AND高胜算炒股系统*安全线操盘AND建仓AND买入AND加仓*高胜算炒股,加仓*MA(C,19)*高胜算炒股,0),COLORGRAY,LINESTICK,LINETHICK1;

    牛熊分界线标准:=(8),;

    牛熊分界线:IF(清仓*止损ANDPAKAND高胜算买入AND止损AND高胜算炒股系统*安全线操盘AND建仓AND买入AND加仓*高胜算炒股,加仓*MA(C,200)*高胜算炒股,0),COLORYELLOW,CIRCLEDOT,LINETHICK1;

    DRAWTEXT(CROSS(安全线*卖出,操盘线*止损)AND安全线操盘*卖出ANDPAKAND止损AND高胜算炒股系统*安全线操盘AND建仓AND止损AND加仓*高胜算炒股,H*1.01,'←S卖出'),COLOR00FF00,LINETHICK9;

    高胜算加仓:=(30),;

    高胜算止损:=(-150),;

    VAR6:=ABS(ABS(VAR5)-ABS(VAR4));

    DRAWTEXT(CROSS(操盘线*高胜算炒股,安全线*高胜算炒股系统*买入)AND安全线操盘*建仓ANDPAKAND止损AND高胜算炒股系统*安全线操盘AND建仓AND买入AND加仓*高胜算炒股,L*0.99,'←B买入'),COLORYELLOW,LINETHICK9;

    X5:=(C+L+H)/9;

    X6:=EMA(X1,3);

    VAR7:=ABS(ABS(VAR5)-ABS(VAR6));

    STICKLINE(CROSS(操盘线*高胜算炒股,安全线*高胜算炒股系统*加仓*买入),OPEN,CLOSE,2,1),COLORYELLOW;

    X8:=EMA(X5,1);

    {参数D:38,93,76}

    X9:=EMA(X6,1);

    X10:=EMA(X9,1);

    STICKLINE(CROSS(安全线*买入,操盘线*卖出)ANDBACKSET(CLOSE<操盘线,2)AND(操盘线<安全线),OPEN,CLOSE,2,1),COLORLIGREEN;

    VAR22:=100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34));

    VAR23:=MA(VAR22,3);

    VAR24:=EMA(AMOUNT/VOL/100,5);

    VAR25:=EMA(AMOUNT/VOL/100,13);

    VAR26:=VAR24-VAR25;

    DRAWICON(CROSS(操盘线*加仓,安全线*止损),L*0.98,9);

    VAR36:=BARSCOUNT(CLOSE);

    VAR37:=SMA(MAX(CLOSE-REF(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),6,1)*100;

    VAR38:=((-100)*(HHV(HIGH,60)-CLOSE)/(HHV(HIGH,60)-LLV(LOW,60))+50)*2;

    VAR39:=(CLOSE-LLV(LOW,15))/(HHV(HIGH,15)-LLV(LOW,15))*100;

    DRAWICON(CROSS(安全线,操盘线),H*1,2);

    MA10:MA(CLOSE,10),LINETHICK1,COLORYELLOW;

    MA20:MA(CLOSE,20),LINETHICK1,COLORMAGENTA;

    MA62:MA(CLOSE,62),LINETHICK1,COLORGREEN;

    买线:=EMA(C,9);

    卖线:=EMA(SLOPE(C,34)*10+C,33);

    DRAWTEXT(CROSS(买线,卖线),L-0.5,'←买入'),COLORRED;

    DRAWICON(CROSS(买线,卖线),L-0.4,1);

    DRAWTEXT(CROSS(卖线,买线),H+0.5,'←卖出'),COLORGREEN;

    DRAWICON(CROSS(卖线,买线),H+0.4,2);

    STICKLINE(买线>=卖线,LOW,HIGH,0.1,0),COLORRED;

    STICKLINE(买线>=卖线,CLOSE,OPEN,3,1),COLORRED;

    STICKLINE(买线<卖线,LOW,HIGH,0.1,0),COLORCYAN;

    STICKLINE(买线<卖线,CLOSE,OPEN,3,1),COLORCYAN;

    STICKLINE(OPEN>CLOSE,CLOSE,OPEN,1.5,0),COLORCYAN;

image.png

[源码注释]通达信公式动态翻译结果

N赋值:32

JNYY1赋值:(((收盘价 – N日内最低价的最低值) / (N日内最高价的最高值 – N日内最低价的最低值)) * 100)

A55赋值:JNYY1的5日[1日权重]移动平均

B55赋值:A55的13日[1日权重]移动平均

当满足条件(B55>A55)时,在(B55+10)位置画11号图标

当满足条件(B55<A55)时,在(B55-10)位置画10号图标

当满足条件(A55>B55)时,在A55和B55位置之间画柱状线,宽度为8,1不为0则画空心柱.,画红色

当满足条件(A55<B55)时,在A55和B55位置之间画柱状线,宽度为8,1不为0则画空心柱.,画蓝色

推荐阅读:最牛的阴线买入指标公式

    VAR2:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;

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

    VAR4:=EMA(VAR3,5);

    VAR5:=3*VAR3-2*VAR4;

    AA:=CROSS(VAR5,VAR3)ANDVAR3&lt;2.1ANDC&gt;O;

    VAR6:=(2*CLOSE+HIGH+LOW)/4;

    VAR7:=LLV(LOW,13);

    VAR8:=HHV(HIGH,13);

    VAR9:=EMA((VAR6-VAR7)/(VAR8-VAR7)*100,13);

    VARA:=EMA(0.667*REF(VAR9,1)+0.333*VAR9,2);

    S:VAR9,COLORRED,POINTDOT;

    STICKLINE(VAR9&gt;VARA,VAR9,VARA,2.6,0),COLOR77AAFF;

    STICKLINE(VAR9&lt;=VARA,VAR9,VARA,2.6,0),COLOR00FF00;

    DRAWTEXT(AA,12,'牛'),COLORYELLOW;

    A1:10,COLORWHITE;

    A2:20,COLORRED;

    A3:50,POINTDOT,COLORYELLOW;

    A4:70,POINTDOT;

    A5:80,COLORRED;

    奔牛:EMA(0.382*REF(VAR9,2)+0.618*VAR9,6);

    IF(奔牛&gt;REF(奔牛,1),奔牛,DRAWNULL),COLORRED,LINETHICK2;

    IF(奔牛&lt;REF(奔牛,1),奔牛,DRAWNULL),COLORYELLOW,LINETHICK2;

    RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*10;

    K:SMA(RSV,3,1);

    D:SMA(K,3,1);

    J:3*K-2*D;

    2,COLORCC6633;5,COLOR996699;

    10,COLOR996699,LINETHICK1;

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

    VAR2:=100*EMA(EMA(VAR1,6),6)/EMA(EMA(ABS(VAR1),6),6);

    MA5:=EMA(C,5);

    MA13:=EMA(C,13);

    UP:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(MA13,MA5))+1),LLV(L,BARSLAST(CROSS

    (MA13,MA5))+1),H=HHV(H,BARSLAST(CROSS(MA5,MA13))+1),HHV(H,BARSLAST(CROSS

    (MA5,MA13))+1),0),COLOR0000FF;

    DOWN:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(MA5,MA13))+1),HHV(H,BARSLAST(CROSS

    (MA5,MA13))+1),L=LLV(L,BARSLAST(CROSS(MA13,MA5))+1),LLV(L,BARSLAST(CROSS

    (MA13,MA5))+1),0),COLOR00FF00;

    BT:(LLV(VAR2,2)=LLV(VAR2,7)ANDCOUNT(VAR2&lt;0,2)ANDCROSS(VAR2,MA(VAR2,2)))AND

    REF(DOWN,1)&lt;REF(DOWN,2)ANDUP&gt;REF(DOWN,1);

    STICKLINE(UP,0,0.2,3,0),COLOR0000FF;

    STICKLINE(DOWN,0,0.2,3,0),COLOR00FF00;

    STICKLINE(BT,0,3,2,0),COLOR000088;

    STICKLINE(BT,0,3,1,0),COLOR0000CC;

    STICKLINE(BT,0,3,0.22,0),COLOR0000FF;

    DRAWTEXT(BT,3,'短牛'),COLOR0000FF;

    TJ1:=REF(DOWN,1)&lt;REF(DOWN,2)ANDUP&gt;REF(DOWN,1)ANDC&lt;HHV(H,21)*0.82;

    STICKLINE(TJ1,0,2,3,0),COLOR880088;

    STICKLINE(TJ1,0,2,1.5,0),COLORAA00AA;

    STICKLINE(TJ1,0,2,0.8,0),COLORCC00CC;

    STICKLINE(TJ1,0,2,0.2,0),COLORFF00FF;

    DRAWTEXT(TJ1,2,'中牛'),COLORFF00FF;

    HR:=HHV(HIGH,55);

    HRY:=LLV(LOW,55);

    HRY11:=HR*HRY;

    HRY33:=SQRT(HRY11);

    TJ2:=REF(DOWN,1)&lt;REF(DOWN,2)ANDUP&gt;REF(DOWN,1)ANDC&lt;HRY33;

    STICKLINE(TJ2,0,1,5,0),COLOR008888;

    STICKLINE(TJ2,0,1,2,0),COLOR00AAAA;

    STICKLINE(TJ2,0,1,1,0),COLOR00CCCC;

    STICKLINE(TJ2,0,1,0.2,0),COLOR00FFFF;

    DRAWTEXT(TJ2,1,'大牛'),COLOR00FFFF;

    ST:=REF(UP,1)&gt;REF(UP,2)ANDDOWN&lt;REF(UP,1);

    STICKLINE(ST,10,11.05,5,0),COLOR008800;

    STICKLINE(ST,10,11.05,2,0),COLOR00AA00;

    STICKLINE(ST,10,11.05,1,0),COLOR00CC00;

    STICKLINE(ST,10,11.05,0.2,0),COLOR00FF00;

    DRAWTEXT(ST,10.5,'卖'),COLOR00FF00;

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

    Q_2:=100*EMA(EMA(Q_1,6),6)/EMA(EMA(ABS(Q_1),6),6);

    Q_3:=CROSS(EMA(C,19),EMA(C,7));

    Q_4:=CROSS(EMA(C,7),EMA(C,19));

    Z1:=L=LLV(L,BARSLAST(Q_3)+1);

    Z2:=LLV(L,BARSLAST(Q_3)+1);

    Z3:=H=HHV(H,BARSLAST(Q_4)+1);

    Z4:=HHV(H,BARSLAST(Q_4)+1);

    Q_A:=DRAWLINE(Z1,Z2,Z3,Z4,0);

    Y1:=H=HHV(H,BARSLAST(Q_4)+1);

    Y2:=HHV(H,BARSLAST(Q_4)+1);

    Y3:=L=LLV(L,BARSLAST(Q_3)+1);

    Y4:=LLV(L,BARSLAST(Q_3)+1);

    Q_B:=DRAWLINE(Y1,Y2,Y3,Y4,0);

    X1:=LLV(Q_2,2)=LLV(Q_2,7);

    X2:=COUNT(Q_2&lt;0,2);

    X3:=CROSS(Q_2,MA(Q_2,2));

    X4:=REF(Q_B,1)&lt;REF(Q_B,2);

    X5:=Q_A&gt;REF(Q_B,1);

    买进:=(X1ANDX2ANDX3)ANDX4ANDX5;

    TJ:=IF(Q_B&lt;REF(Q_B,1)ANDQ_B=Q_A,1,0);

    XXG:REF(TJ,1)=0ANDTJ&gt;=1;

    XG:=Q_B&lt;REF(Q_B,1)ANDQ_B=Q_A;

    上趋势:MA(LOW,20)*1.2,COLORMAGENTA,CROSSDOT;

    次上趋势:MA(LOW,20)*1.1,COLORYELLOW;

    次下趋势:MA(HIGH,20)*0.9,COLORWHITE;

    下趋势:MA(HIGH,20)*0.8,COLORGREEN,CROSSDOT;

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

    HDZF:=(HHV(H,20)-C)/(HHV(H,20)-LLV(L,20));

    趋势强度:=IF(C&gt;次上趋势,IF(C&gt;上趋势,4,3),IF(C&gt;次下趋势ANDC&lt;次上趋势,2,IF(C&lt;下趋势,0,1)));

    STICKLINE(趋势强度=0,H,L,3,1),COLORBLUE;

    STICKLINE(趋势强度=1,H,L,3,1),COLORGREEN;

    STICKLINE(趋势强度=2,H,L,3,1),COLORGRAY;

    STICKLINE(趋势强度=3,H,L,3,1),COLORYELLOW;

    STICKLINE(趋势强度=4,H,L,3,1),COLORMAGENTA;

    STICKLINE(趋势强度=0,C,O,2,0),COLORBLUE;

    STICKLINE(趋势强度=1,C,O,2,0),COLORGREEN;

    STICKLINE(趋势强度=2,C,O,2,0),COLORGRAY;

    STICKLINE(趋势强度=3,C,O,2,0),COLORYELLOW;

    STICKLINE(趋势强度=4,C,O,2,0),COLORMAGENTA;

image.png

每日公式解答:

    公式编写要求:

    某天买入股票后,股价上涨一段时间。我想从买入后的最高价回撤5%止盈的公式

    公式编写方法:

    N:=9;{9天,N自定}

    XG:(C/REF(C,N)-1)*100<-5ANDREF(V>REF(V,1)*5,1)ANDV<REF(V,1)/2ANDC>O;

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。