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

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

授权方式: 免费版

指标评级: ★★★★★

指标分类: 策略

画线方法: 副图

一、四线主图指标公式

  

EMA30:EMA(C,30),COLORWHITE,LINETHICK2;  

EMA60:EMA(C,60),COLORFF00FF;  

EMA90:EMA(C,90),COLORYELLOW;  

EMA120:EMA(C,120),COLORFFCC66;  

EMA250:EMA(C,250),COLORBLUE;  

SS:=CROSS(EMA30,EMA60)ANDC>OANDC>REF(C,1)ANDC/REF(C,1)>=1.018  

ORCROSS(EMA30,EMA120)ANDC>OANDC>REF(C,1)ANDC/REF(C,1)>=1.018  

ORCROSS(EMA60,EMA90)ANDC>OANDC>REF(C,1)ANDC/REF(C,1)>=1.018  

ORCROSS(EMA30,EMA90)ANDC>OANDC>REF(C,1)ANDC/REF(C,1)>=1.018{AND  

CROSS(EMA30,EMA120)};  

DRAWICON(SS,L-0.04,1);  

DD:=CROSS(EMA60,EMA90)ANDC>OANDC>REF(C,1)ANDC/REF(C,1)>=1.018  

ORCROSS(EMA60,EMA250)ANDC>OANDC>REF(C,1)ANDC/REF(C,1)>=1.018  

ORCROSS(EMA90,EMA120)ANDC>OANDC>REF(C,1)ANDC/REF(C,1)>=1.018  

ORCROSS(EMA60,EMA120)ANDC>OANDC>REF(C,1)ANDC/REF(C,1)>=1.018AND  

CROSS(EMA30,EMA250);  

{DD:=CROSS(EMA30,EMA250);}  

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),COLOR656500;  

STICKLINE(C<O,C,O,2.5,0),COLOR757500;  

STICKLINE(C<O,C,O,2,0),COLOR858500;  

STICKLINE(C<O,C,O,1.5,0),COLOR959500;  

STICKLINE(C<O,C,O,1,0),COLORA5A500;  

STICKLINE(C<O,C,O,0.5,0),COLORB5B500;  

STICKLINE(C<O,H,L,0,0),COLORC5C500;  

KDJ9底:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-  

LLV(LOW,9))*100;  

K9底:=SMA(KDJ9底,3,1);  

D9底:=SMA(K9底,3,1);  

J9底:=3*K9底-2*D9底;{买涨信号,蓝色柱子}  

STICKLINE(K9底<30,OPEN,CLOSE,3,0),COLORFF0000;  

STICKLINE(K9底<30,OPEN,CLOSE,2.5,0),COLORFF1100;  

STICKLINE(K9底<30,OPEN,CLOSE,2,0),COLORFF2200;  

STICKLINE(K9底<30,OPEN,CLOSE,1.5,0),COLORFF3300;  

STICKLINE(K9底<30,OPEN,CLOSE,1,0),COLORFF4400;  

STICKLINE(K9底<30,OPEN,CLOSE,0.5,0),COLORFF5500;  

STICKLINE(K9底<30,H,L,0,0),COLORFF6600;  

{卖跌信号,绿色柱子}  

STICKLINE(K9底>70,OPEN,CLOSE,3,0),COLOR003300;  

STICKLINE(K9底>70,OPEN,CLOSE,2.5,0),COLOR004400;  

STICKLINE(K9底>70,OPEN,CLOSE,2,0),COLOR005500;  

STICKLINE(K9底>70,OPEN,CLOSE,1.5,0),COLOR006600;  

STICKLINE(K9底>70,OPEN,CLOSE,1,0),COLOR007700;  

STICKLINE(K9底>70,OPEN,CLOSE,0.5,0),COLOR008800;  

STICKLINE(K9底>70,L,H,0,0),COLOR009900;  

DRAWTEXT_FIX(1,0.01,0.82,0,'买涨信号:蓝色消失收阳线是买  

点。止损点设立:蓝色信号的最低价'),COLORMAGENTA;  

DRAWTEXT_FIX(1,0.01,0.90,0,'卖跌信号:红色消失收阴时是卖  

点,可以结合3天股价不创新高'),COLORMAGENTA;

image.png

二、六线主图指标公式

  

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

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

A1:=EMA(C,14)COLORWHITE,LINETHICK1;  

A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW;  

STICKLINE(CROSS(A1X,0),C,O,2,0)COLORYELLOW;  

STICKLINE(CROSS(0,A1X),C,O,2,0)COLORGREEN;  

AZ:=BARSCOUNT(CLOSE);  

AH:=HHV(HIGH,144);  

AL:=LLV(LOW,144);  

B0:=(AH-AL)/34;  

BL1:=HIGH+B0;  

BL2:=LOW-B0;  

STICKLINE((AZ+0)/34=FLOOR((AZ+0)/34),BL2,BL2-2*B0,2,0),COLORFFFFFF;  

DRAWTEXT((AZ+0)/34=FLOOR((AZ+0)/34),BL2-4*B0,窗),COLORFFFFFF;  

VAR3:=REF(C,1)=LLV(C,4)ANDC>=REF(C,2)ORREF(C,2)=LLV(C,4)ANDREF(C,1)<=REF(C,3)ANDREF(C,2)=REF(C,1);  

STICKLINE(VAR3,O,(O+C)/2,2.5,0),COLOR00BB00;  

STICKLINE(VAR3,O,(O+C)/2,0.2,0),COLOR00FF00;  

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

买线:=EMA(CLOSE,2);  

卖线:=EMA(SLOPE(CLOSE,32)*20+CLOSE,56),LINETHICK0;  

BU:=CROSS(买线,卖线);  

SEL:=CROSS(卖线,买线);  

DRAWTEXT(BU,LOW*0.989,点),COLORYELLOW,LINETHICK3;  

STICKLINE(CROSS(买线,卖线),OPEN,CLOSE,2,0),COLORYELLOW;  

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

A8:=100*EMA(EMA(A7,6),6)/EMA(EMA(ABS(A7),6),6);  

买3:=LLV(A8,2)=LLV(A8,7)ANDCOUNT(A8<0,2)ANDCROSS(A8,MA(A8,2));  

DRAWTEXT(FILTER(买3=1,5),LOW-0.15,进),COLORYELLOW;  

STICKLINE(买3,OPEN,CLOSE,2,0),COLORYELLOW;  

天使:=EMA(C,2);  

魔⿁:=EMA(SLOPE(C,9)*20+C,40);  

买5:=CROSS(天使,魔⿁);  

DRAWTEXT(买5,LOW*0.97,⽜),COLORMAGENTA;  

STICKLINE(CROSS(天使,魔⿁),OPEN,CLOSE,2,0),COLORYELLOW;  

AA:=CROSS(MA(C,5),MA(C,21))ANDCROSS(MA(C,5),MA(C,34))ANDCROSS(MA(C,5),MA(C,55));  

BB:=MA(C,55)>MA(C,13)ANDCROSS(MA(C,13),MA(C,34))ANDMA(C,34)>MA(C,21)ANDABS(MA(C,55)-MA(C,21))/MA(C,21)<0.05;  

CC:=MA(C,34)>MA(C,5)ANDCROSS(MA(C,5),MA(C,21))ANDMA(C,21)>MA(C,13);  

DD:=ABS((MA(C,5)-MA(C,13))+(MA(C,13)-MA(C,21))+(MA(C,21)-MA(C,34)))<0.02andma(c,5)>REF(MA(C,5),1)ANDMA(C,13)>REF(MA(C,13),1);  

EE:=MA(C,21)>MA(C,5)ANDCROSS(MA(C,5),MA(C,13))ANDMA(C,13)>MA(C,55)ANDABS(MA(C,21)-MA(C,55))/MA(C,55)<0.05;  

FFF:=AAORBBORCCORDDOREE;  

探测:=FFFANDFILTER(FFF,8);  

DRAWTEXT(探测,L*0.978,●),COLORRED;  

STICKLINE(探测,O,C,3,0),LINETHICK2,COLORWHITE;  

JRH:=HHV(C,2);  

JRL:=LLV(C,2);  

MA3:=MA(CLOSE,3);  

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

R1:=(CLOSE>REF(CLOSE,1)ANDCLOSE>REF(CLOSE,2));  

R2:=(REF(R1,1)ANDCLOSE<=ref(close,1)andclose>=REF(CLOSE,2));  

R3:=(REF(R2,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2));  

R4:=(REF(R3,1)ANDCLOSE<=ref(close,1)andclose>=REF(CLOSE,2));  

R5:=(REF(R4,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2));  

R6:=(REF(R5,1)ANDCLOSE<=ref(close,1)andclose>=REF(CLOSE,2));  

R7:=(REF(R6,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2));  

R8:=(REF(R7,1)ANDCLOSE<=ref(close,1)andclose>=REF(CLOSE,2));  

R9:=(REF(R8,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2));  

RA:=(REF(R9,1)ANDCLOSE<=ref(close,1)andclose>=REF(CLOSE,2));  

RB:=(REF(RA,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2));  

RC:=(REF(RB,1)ANDCLOSE<=ref(close,1)andclose>=REF(CLOSE,2));  

RD:=(CLOSE<REF(CLOSE,1)ANDCLOSE<REF(CLOSE,2));  

RE:=(REF(RD,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2));  

RF:=(REF(RE,1)ANDCLOSE<=ref(close,1)andclose>=REF(CLOSE,2));  

R10:=(REF(RF,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2));  

R11:=(REF(R10,1)ANDCLOSE<=REF(CLOSE,1)AND  

CLOSE>=REF(CLOSE,2));  

R12:=(REF(R11,1)ANDCLOSE>=REF(CLOSE,1)AND  

CLOSE<=REF(CLOSE,2));  

R13:=(REF(R12,1)ANDCLOSE<=REF(CLOSE,1)AND  

CLOSE>=REF(CLOSE,2));  

R14:=(REF(R13,1)ANDCLOSE>=REF(CLOSE,1)AND  

CLOSE<=REF(CLOSE,2));  

R15:=(REF(R14,1)ANDCLOSE<=REF(CLOSE,1)AND  

CLOSE>=REF(CLOSE,2));  

R16:=(REF(R15,1)ANDCLOSE>=REF(CLOSE,1)AND  

CLOSE<=REF(CLOSE,2));  

R17:=(REF(R16,1)ANDCLOSE<=REF(CLOSE,1)AND  

CLOSE>=REF(CLOSE,2));  

R18:=(REF(R17,1)ANDCLOSE>=REF(CLOSE,1)AND  

CLOSE<=REF(CLOSE,2));  

R19:=REF(RDORREORRFORR10ORR11ORR12ORR13ORR14ORR15  

ORR16ORR17ORR18,1)ANDR1;  

R1A:=((REF(R1ORR2ORR3ORR4ORR5ORR6ORR7ORR8ORR9ORRA  

ORRBORRC,1))ANDRD);  

VAR3:=IF(C<200,MA(COST(80),3),2500),NODRAW;  

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

VAR5:=EMA(((((OPEN+HIGH)+LOW)+CLOSE)/4),2330);  

VAR6:=(VAR5+((VAR5*6)/100));  

春买:=R19,NODRAW,COLOR00DD00;  

秋离场:=R1A,NODRAW,COLOR2288EE;  

红持股:=R1ORR2ORR3ORR4ORR5ORR6ORR7ORR8ORR9ORRAOR  

RBORRC,NODRAW,COLOR0000FF;  

阴观望:=RDORREORRFORR10ORR11ORR12ORR13ORR14ORR15OR  

R16ORR17ORR18,NODRAW,COLOR999999;  

急速超跌关  

注:=(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*100<-14,COLORBBBBBB,NODRA  

W;  

离场:=IF(红持股,JRL,DRAWNULL);  

明离场价:=离场,COLORFF99FF,NODRAW;  

今离场价:=REF(离场,1)COLOR0000FF,NODRAW;  

进:=IF(阴观望,JRH,DRAWNULL);  

明进场价:=进,COLOR33AACC,NODRAW;  

今进场价:=REF(明进场价,1),COLOR00FF00,NODRAW;  

STICKLINE(ISLASTBARAND(红持股ORREF(红持股,1)=1),今离场价,今离场  

价,20,1),COLOR0000FF;  

STICKLINE(ISLASTBARAND(阴观望ORREF(阴观望,1)=1),今进场价,今进场  

价,20,1),COLOR00FF00;  

XX2:EMA(EMA((CLOSE+LOW+HIGH)/3,3),23),COLORGREEN,LINETHICK2;  

XX3:=REF(XX2,1);  

IF(XX2>XX3,XX2,DRAWNULL),COLORRED,LINETHICK2;  

B11:=MA(CLOSE,1);  

B22:=SMA(SMA(SMA(B11,2,1),2,1),2,1);  

SMA2:=MA(B22,3);  

DRAWBAND(B22,RGB(255,0,0),SMA2,RGB(0,255,0));  

下档线:=(((CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13)))*100);  

RRRSV:=SMA(下档线,3,1);  

KKK:=SMA(RRRSV,3,1);  

DDDDD:=((3*RRRSV)-(2*KKK));  

JJ12:=(((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55)))*100);  

RSV24:=SMA(JJ12,3,1);  

K24:=SMA(RSV24,3,1);  

D24:=((3*RSV24)-(2*K24));  

压力  

2:=IF(CROSS(D24,DDDDD),HIGH,REF(HIGH,BARSLAST(CROSS(D24,DDDDD))  

)),COLORFFFFFF;  

底部:=LLV(HIGH,30),COLOR00FF00;  

压力位:=IF(ISLASTBAR,压力2,DRAWNULL),NODRAW;  

底部位:=IF(ISLASTBAR,底部,DRAWNULL),NODRAW;  

STICKLINE(ISLASTBAR,压力位,压力位,40,0),COLORFF00FF,LINETHICK2;  

STICKLINE(ISLASTBAR,底部位,底部位,35,0),COLOR00FFFF,LINETHICK2;  

B1:=REF(CLOSE,1);  

B2:=REF(CLOSE,2);  

B3:=REF(CLOSE,3);  

B4:=REF(CLOSE,4);  

CMAX:=MAX(MAX(MAX(CLOSE,B1),B2),B3);  

CMIN:=MIN(MIN(MIN(CLOSE,B1),B2),B3);  

持股:=(CLOSE=CMAXAND(B1>=B2ORB1>=B3))OR((B1=CMAXAND  

(B2=CMINORB3=CMIN))ANDCLOSE>=B2)OR  

(B2=CMAXANDB3=CMINANDCLOSE>=B1)OR(B3=CMAXANDCLOSE>=B1  

ANDCLOSE>=B2);  

STICKLINE(持股,B1,CLOSE,3,0),COLOR000099;  

变盘:=CLOSE=CMAXANDB1=CMIN;  

STICKLINE(变盘,B2,CLOSE,3,0),COLOR0099EF;  

下跌:=(CLOSE=CMINAND(B1<B2ORB1<B3))OR((B1=CMINAND  

(B2=CMAXORB3=CMAX))ANDCLOSE<B2)OR  

(B2=CMINANDB3=CMAXANDCLOSE<B1)OR(B3=CMINANDCLOSE<B1  

ANDCLOSE<B2);  

STICKLINE(下跌,B1,CLOSE,3,0),COLOR009900;  

STICKLINE(B1=CMAXANDCLOSE=CMIN,B2,CLOSE,3,0),COLOR009900;  

买入:=(B1=CMINANDCLOSE>=B2)OR((B2=CMINANDB1<=B3)OR  

(B3=CMINANDB1<=B2)ANDB2=B1);  

STICKLINE(买入,B1,B2,3,0),COLOR00FFFF;  

抛售:=(B1=CMAXANDCLOSEB3)OR  

(B3=CMAXANDB1>B2)ANDB2>=B4ANDCLOSE<B1);  

STICKLINE(抛售,B1,B2,3,0),COLORFFFFFF;  

STICKLINE(C>=O,L,H,0,1),COLORRED;  

STICKLINE(C<O,H,L,0,1),COLORGREEN;  

STICKLINE(持股OR买入,O,C,1.5,0),COLORRED;  

STICKLINE(下跌OR抛售,O,C,1.5,0),COLORGREEN;  

STICKLINE(C>0,O,C,0,0),COLORFFFFFF;  

MMA:=CONST(HHV(H,90));  

MMB:=CONST(LLV(L,90));  

WN:=3;{原码N:=3;}  

WA1:=REF(H,WN)=HHV(H,2*WN+1);WB1:=FILTER(WA1,WN);  

WC1:=BACKSET(WB1,WN+1);WD1:=FILTER(WC1,WN);{高点}  

WA2:=REF(L,WN)=LLV(L,2*WN+1);WB2:=FILTER(WA2,WN);  

WC2:=BACKSET(WB2,WN+1);WD2:=FILTER(WC2,WN);{低点}  

WE1:=(REF(LLV(L,2*WN),1)+REF(HHV(H,2*WN),1))/2;  

WE2:=(H+L)/2;{高低点出现在同一K线上时可作取舍}  

WH1:=(WD1ANDNOT(WD2ANDWE1>=WE2))ORISLASTBAROR  

BARSCOUNT(C)=1;  

WL1:=(WD2ANDNOT(WD1ANDWE1<WE2));WH2:=WD1ANDNOT(WD2  

ANDWE1>=WE2);  

WX1:=REF(BARSLAST(WH1),1)+1;WF1:=BACKSET(WH1AND  

COUNT(WL1,WX1)>0,LLVBARS(IF(WL1,L,10000),WX1));  

WG1:=WF1>REF(WF1,1);WI1:=BACKSET(WG1,2);  

WLD:=WI1>REF(WI1,1);{过滤后低点}  

WL2:=WLDORISLASTBARORBARSCOUNT(C)=1;  

WX2:=REF(BARSLAST(WL2),1)+1;WF2:=BACKSET(WL2AND  

COUNT(WH2,WX2)>0,HHVBARS(IF(WH2,H,0),WX2));  

WG2:=WF2>REF(WF2,1);WI2:=BACKSET(WG2,2);  

WHD:=WI2>REF(WI2,1);{过滤后高点}  

WR1:=BACKSET(ISLASTBAR,BARSLAST(WHD)+1);WS1:=WR1>REF(WR1,1);  

{前一高}  

WT1:=BACKSET(ISLASTBAR,BARSLAST(WLD)+1);WU1:=WT1>REF(WT1,1);  

{前一低}  

WR2:=BACKSET(WS1,REF(BARSLAST(WHD),1)+2);WS2:=WR2>REF(WR2,1);  

{前二高}  

WT2:=BACKSET(WU1,REF(BARSLAST(WLD),1)+2);WU2:=WT2>REF(WT2,1);  

{前二低}  

WT3:=BACKSET(WU2,REF(BARSLAST(WLD),1)+2);WU3:=WT3>REF(WT3,1);  

{前三低}  

WT4:=BACKSET(WU3,REF(BARSLAST(WLD),1)+2);WU4:=WT4>REF(WT4,1);  

{前四低}  

WR3:=BACKSET(WS2,REF(BARSLAST(WHD),1)+2);WS3:=WR3>REF(WR3,1);  

{前三高}  

WR4:=BACKSET(WS3,REF(BARSLAST(WHD),1)+2);WS4:=WR4>REF(WR4,1);  

{前四高};  

压力1:=DRAWLINE(WS2,H,WS1,H,1),COLOR008888;{★压力1:}  

支撑1:=DRAWLINE(WU2,L,WU1,L,1),COLOR008888;{★支撑1:}  

压力2:=DRAWLINE(WS3,H,WS2,H,1),COLOR888000;{★压力2:}  

支撑2:=DRAWLINE(WU3,L,WU2,L,1),COLOR888000;{★支撑2:}  

压力3:=DRAWLINE(WS4,H,WS3,H,1),COLOR0000CC;{★压力3:}  

支撑3:=DRAWLINE(WU4,L,WU3,L,1),COLOR0000CC;{★支撑3:};  

BSC:=CONST(MAX(BARSLAST(WS4),BARSLAST(WU4))*3),NODRAW;  

IF(BETWEEN(压力1,MMA,MMB),压力  

1,DRAWNULL),COLOR008888,LINETHICK1;  

IF(BETWEEN(支撑1,MMA,MMB),支撑  

1,DRAWNULL),COLOR008888,LINETHICK1;  

IF(BETWEEN(压力2,MMA,MMB),压力  

2,DRAWNULL),COLOR888000,LINETHICK1;  

IF(BETWEEN(支撑2,MMA,MMB),支撑  

2,DRAWNULL),COLOR888000,LINETHICK1;  

IF(BETWEEN(压力3,MMA,MMB),压力  

3,DRAWNULL),COLOR0000CC,LINETHICK1;  

IF(BETWEEN(支撑3,MMA,MMB),支撑  

3,DRAWNULL),COLOR0000CC,LINETHICK1;  

底:=SUM(MA(CLOSE,10),9)/11.114;  

DRAWTEXT(CROSS(LOW,底)ANDREF(底,1)>REF(HIGH,1)ORCROSS(HIGH,  

底),L,'—铁底'),COLOR00FF00;  

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

X2:=EMA(X1,10);  

X3:=REF(X2,1);  

X4:=(REF(HIGH,1)+REF(LOW,1))/2;  

X5:=MA(CLOSE,21)+2*STD(CLOSE,21);  

X6:=REF(CLOSE,1);  

X7:=(SMA(MAX(CLOSE-X6,0),7,1))/(SMA(ABS(CLOSE-X6),7,1))*100;  

X8:=CROSS(79,X7);  

X9:=FILTER(X8,4);  

WZ1:=POW(MA(CLOSE,5),2)+MA(CLOSE,5);  

WZ2:=POW(MA(LOW,5),2)+MA(LOW,5);  

WZ3:=POW(MA(HIGH,5),2)+MA(HIGH,5);  

WZ4:=(WZ1-LLV(WZ2,9))/(HHV(WZ3,9)-LLV(WZ2,9))*150+65;  

DK:=SMA(WZ4,3,1)*1.5;  

DD:=SMA(DK,3,1);  

DJ:=3*DK-2*DD;  

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

WZ6:=EMA(WZ5,9);  

WZ7:=2*(WZ5-WZ6);  

WZ8:=REF(WZ7,1);  

WZ9:=CROSS(WZ8,WZ7)ANDWZ8>0;  

VAR1T:=EMA(CLOSE,8);  

VAR2T:=EMA(VAR1T,20);  

VAR3T:=CROSS(VAR1T,VAR2T);  

VAR4T:=VAR1T<MA(CLOSE,120);  

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

VAR6T:=SMA(VAR5T,5,1);  

VAR7T:=SMA(VAR6T,8,1);  

VAR8T:=CROSS(VAR6T,VAR7T)ANDVAR7T<20;  

VAR9T:=CLOSE>LLV(CLOSE,60)+0.3*LLV(CLOSE,60)ANDVAR8T;  

VARA:=IF(CLOSE>1000,VAR8T,VAR9T);  

起步:=VAR3TANDVAR4T;  

逃遁:=VARA;  

XL1:=EMA(CLOSE,10)/100;  

XL2:=MA((XL1-REF(XL1,10))/REF(XL1,10),3)*100;  

XL3:=MA(XL2,3);  

XL4:=SMA((CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100,3,1);  

DRAWTEXT(IF(CROSS(3*XL4-2*SMA(XL4,3,1),8),87,0)ANDX2>X3,LOW,'←反  

弹'),COLOR0000FF;  

DRAWTEXT(IF(CROSS((VAR1T-LLV(VAR1T,4))/(HHV(VAR1T,4)-LLV(VAR1T,4))  

*4*25,87.5)ANDVAR1T<40,87,0)andx2>X3,LOW,'←短买'),COLOR0000AA;  

DRAWTEXT(IF(CROSS(2*(EMA((CLOSE*2+HIGH+LOW)/4,12)-EMA((CLOSE*2  

+HIGH+LOW)/4,26)-(EMA(EMA((CLOSE*2+HIGH+LOW)/4,12)-EMA((CLOSE*  

2+HIGH+LOW)/4,26),2)))*5.8,0.47),LOW,0)ANDX2>X3,LOW,'←加仓  

'),COLORFF5ED8;  

DRAWTEXT(CROSS(X4,X5),HIGH+C*0.01,'←减'),COLORB4FF00;  

DRAWTEXT(FILTER((WZ9ANDDJ>250)ORX9,5),HIGH+C*0.02,'←跑  

'),COLORBCFF8B;  

STICKLINE(起步>0,HIGH,LOW,0.8,0),COLOR00FFFF;  

STICKLINE(起步>0,OPEN,CLOSE,5,0),COLOR00FFFF;  

DRAWTEXT(逃遁>0,HIGH,'●←逃'),COLOR7FFFD6;  

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

BB13:=ATAN(EMA(X1P,13)-REF(EMA(X1P,13),1))*3.1416*10;  

EMA8:=EMA(C,8);  

DRAWTEXT(FILTER(BB13>1AND  

EMA(X1P,13)>REF(EMA(X1P,8),1),10),EMA8,'∠45上升'),COLORWHITE;  

VAR3AA:=IF((CLOSE>REF(CLOSE,1)),88,0);  

VAR4AA:=IF(((CLOSE)/(REF(CLOSE,1))>1.05)AND((HIGH)/(CLOSE)<1.01)  

AND(VAR3AA>0),91,0);  

DRAWTEXT(FILTER((VAR4AA>90),45),(LOW),'★大胆搏'),COLOR00FFFF;  

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

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

L25:=(L24-MA(L24,14))/(0.015*AVEDEV(L24,14));  

L26:=(L24-MA(L24,70))/(0.015*AVEDEV(L24,70));  

L27:=IF(L25>=150ANDL25<200andl26>=150ANDL26<200,10,0);  

L28:=IF(L25<=-150andl25>-200ANDL26<=-150andl26>-200,-10,L27);  

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

L30:=IF(L29<90,L29,100);  

L31:=IF(L23>0,L23,0);  

XL11:=(IF(L28>=200ANDL25>=150,15,IF(L26<=-200AND  

L25<=-150,-15,L28)))+60;  

XL22:=L31>48ANDXL11>60ANDL30<100;  

DRAWTEXT(XL22ANDCOUNT(XL22,30)=1,L,'大笔买入'),COLORFF00FF;  

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

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

*100,20,1),15,1);  

VAR4TD:=100-3*SMA((OPEN-LLV(LOW,42))/(HHV(HIGH,42)-LLV(LOW,42))*1  

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

00,20,1),15,1);  

VAR2TD:=VAR3TD<ref(var4td,1)andvol>REF(VOL,1)AND  

CLOSE>REF(CLOSE,1);  

DRAWTEXT(VAR2TDANDCOUNT(VAR2TD,30)=1,L,'大资金进场  

'),COLORFF00FF;  

DRAWTEXT_FIX(1,0,0,0,'市盈率:'),COLORYELLOW;  

DRAWNUMBER_FIX(1,0.08,0,0,CONST(DYNAINFO(39))),COLORYELLOW;  

DRAWTEXT_FIX(1,0.16,0,0,'每股收益(元):'),COLOR0080FF;  

DRAWNUMBER_FIX(1,0.29,0,0,CONST(FINANCE(33))),COLOR0080FF;  

DRAWTEXT_FIX(1,0.36,0,0,'莸利比例:'),COLORYELLOW;  

DRAWNUMBER_FIX(1,0.46,0,0,CONST(WINNER(C)*100)),COLORYELLOW;  

DRAWTEXT_FIX(1,0,0.05,0,'总股本(万股):'),COLORMAGENTA;  

DRAWNUMBER_FIX(1,0.13,0.05,0,CONST(FINANCE(1)/10000)),COLORMAGE  

NTA;  

DRAWTEXT_FIX(1,0,0.1,0,'所属板块:'),COLORYELLOW;  

DRAWTEXT_FIX(1,0.1,0.1,0,HYBLOCK),COLOR0080FF;  

DRAWTEXT_FIX(1,0.21,0.1,0,DYBLOCK),COLOR0080FF;  

{量能饱和}  

SAT:=IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100>100,100,(AMOU  

NT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100);  

DRAWTEXT_FIX(1,0.35,0.9,0,'量能饱和度:')COLOR00FFFF;  

DRAWNUMBER_FIX(1,0.48,0.9,0,CONST(SAT)),COLORYELLOW;  

image.png

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

DIF赋值:收盘价的12日指数移动平均-收盘价的26日指数移动平均

DEA赋值:DIF的9日指数移动平均

输出XG:上次DEA<0ANDCROSS(DIF,DEA)距今天数<5

推荐阅读:五线主图指标

  

多空平衡线:EMA(EMA(EMA(HIGH,5),5),4),colorwhite;  

⾼位⽌赢线:多空平衡线*1.1,colorred;  

获利了结线:多空平衡线*1.05,colormagenta;  

强势回挡线:多空平衡线*0.95,colorgreen;  

弱势反弹线:多空平衡线*0.9,colorblue,linethick2;  

Var2:多空平衡线*0.85,colorgray;  

YF_DDI:=(AMOUNT/VOL);  

YF_JJ:=((OPEN+CLOSE)/2);  

YF_DDING:=EMA(CLOSE,6);  

YF_MMD:=MA(YF_DDING,1);  

YF_XXD:=EMA(CLOSE,18);  

YF_YYZ:=REF(YF_MMD,1);  

YF_XXD1:=REF(YF_XXD,1);  

YF_YYZ1:=BARSCOUNT(CLOSE);  

YF_TDCG:=IF((YF_YYZ1=1),0,(((YF_MMD-YF_YYZ)/YF_YYZ)*100));  

YF_ZFD:=IF((YF_YYZ1=1),0,(((YF_XXD-YF_XXD1)/YF_XXD1)*100));  

YF_JSD2:=REF(CLOSE,1);  

CLOSE1:=IF((YF_YYZ1=1),0,(((CLOSE-YF_JSD2)/YF_JSD2)*100));  

YF_JZDF:=IF((YF_YYZ1=1),((CLOSE+OPEN)/2),YF_YYZ);  

JJ1:=REF(YF_MMD,2);  

JJ2:=(((YF_MMD+YF_YYZ)+JJ1)/3);  

JJ02:=(((ABS((YF_MMD-JJ2))+ABS((YF_YYZ-JJ2)))+ABS((JJ1-JJ2)))/3);  

SY:=REF(YF_TDCG,1);  

YF_ZFD1:=REF(YF_TDCG,2);  

YF_ZFD2:=IF((YF_YYZ1<3),0,((JJ02/YF_MMD)*100));  

YF_DHPXS:=IF((YF_YYZ1<3),0,IF((((YF_TDCG<0)AND(SY<0))AND(YF_ZFD1<0)),(0  

-1),1));  

SS:=REF(YF_TDCG,1);  

YF_YZFZ:=IF((((YF_YYZ1>11)AND(SS<0))and(yf_tdcg>0)),1,0);  

YF_JSD21:=BARSLAST((YF_YZFZ=1));  

YF_JSD:=REF(YF_JSD21,1);  

A:=IF((((YF_YYZ1>11)AND(SS<0))and(yf_tdcg>0)),(YF_JSD+1),YF_JSD);  

YF_PJJ:=IF((((YF_YYZ1>11)AND(SS>0))AND(YF_TDCG<0)),1,0);  

YF_JSD11:=YF_JZDF;  

DMRJ:=YF_JZDF;  

DMCJ:=IF(((YF_YYZ1>11)AND(YF_JSD11<OPEN)),OPEN,YF_JZDF);  

YF_DMRJ:=IF(((YF_YYZ1>11)AND(DMRJ>OPEN)),OPEN,YF_JZDF);  

YF_DCG1:=REF(YF_JZDF,1);  

YF_BDF5:=IF(((((YF_TDCG>0.5)AND((YF_ZFD2>0.215)OR(LOW>YF_JZDF)))AND  

(CLOSE>=OPEN))AND((CLOSE>=200)OR((CLOSE<200)AND(CLOSE1<11)))),1,0);  

YF_DMRA:=IF((((YF_TDCG<(0-0.3))and((yf_zfd2>0.2)OR(HIGH<YF_JZDF)))AND  

((OPEN>=CLOSE)OR(CLOSE1<(0-1)))),1,0);  

YF_DKS1:=BARSSINCE(YF_BDF5);  

YF_TDMR:=BARSSINCE(YF_DMRA);  

YF_DMRB:=(YF_DMRAORCONST(0));  

YF_DCGJ1:=((COUNT(YF_BDF5,BARSLAST(YF_DMRB))=1)ANDYF_BDF5);  

YF_DMRBUY:=((COUNT(YF_DMRB,BARSLAST(YF_BDF5))=1)ANDYF_DMRB);  

YF_DMCSELL:=BARSLAST(YF_DMRBUY);  

YF_DCG10:=BARSLAST(YF_DCGJ1);  

YF_DCG11:=((SUM(YF_DMRBUY,YF_DCG10)=0)*YF_DCG10);  

YF_DCGREAL:=REF(DMCJ,YF_DCG11);  

YF_DMRJ11:=REF(YF_DCGREAL,1);  

YF_DMRJ1:=IF((YF_DCGJ1=1),(((CLOSE-DMCJ)/DMCJ)*100),(((YF_DMRJ-  

YF_DMRJ11)/YF_DMRJ11)*100));  

YF_DCG:=IF((((YF_DCG11=0)AND(YF_DCGJ1=0))AND(YF_DMRBUY=  

0)),0,YF_DMRJ1);  

短买⼊:YF_DCGJ1,LINETHICK0;  

短卖出:YF_DMRBUY,LINETHICK0;  

短持股:YF_DCG11,LINETHICK0;  

短买价:IF((短买⼊=1),YF_DCGREAL,IF(((短持股<>0)OR(短卖出=  

1)),YF_DMRJ11,0)),LINETHICK0;  

短卖价:IF((短卖出=1),YF_DMRJ,0),LINETHICK0;  

短操盘状态:IF((短买⼊=1),1,IF((短持股>0),2,IF((短卖出=1),9,0))),LINETHICK0;  

明⽇空间买卖点:EMA(CLOSE,6),LINETHICK0;  

STICKLINE((短买⼊=1),OPEN,CLOSE,3,0),COLORMAGENTA;  

DRAWICON((短买⼊=1),LOW*0.98,25);  

STICKLINE((短持股>0),OPEN,CLOSE,3,0),COLORMAGENTA;  

STICKLINE((短卖出=1),OPEN,CLOSE,3,0),COLORGREEN;  

DRAWICON((短卖出=1),HIGH*1.02,27);

image.png

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