通达信帝狄马克的TD序列主图(又添加)
本人用的较好,需要通达信公式编辑器5.0适用
n 1 100 20
m 1 100 32
p1 1 100 80
p2 1 100 100
VAR1:=(C+H+O+L)/4;
卖出:=XMA(VAR1,N)*(1+P1/1000),COLORFFFFFF,LINETHICK3;
买入:=XMA(VAR1,M)*(1-P2/1000),COLOR0000FF,LINETHICK3;
DRAWBAND(卖出,RGB(200,50,55),卖出*1.03,RGB(0,100,50));
DRAWBAND(买入,RGB(0,100,0),买入*0.97,RGB(55,55,0));
幅度:100*(卖出-买入)/买入,NODRAW;
MA1:=MA(VAR1,3);
STICKLINE(卖出>LOW AND 卖出<HIGH,卖出,MAX(卖出,MAX(OPEN,CLOSE)),3,0),COLORGREEN;
STICKLINE(卖出>MIN(C,O) AND 卖出<MAX(C,O),卖出,MAX(OPEN,CLOSE),3,0),COLORGREEN;
STICKLINE(卖出>LOW AND 卖出<HIGH,卖出,HIGH,0,0),COLORGREEN;
STICKLINE(卖出<LOW,OPEN,CLOSE,3,0),COLORGREEN;
STICKLINE(卖出<LOW,HIGH,LOW,0,0),COLORGREEN;
STICKLINE(买入>LOW AND 买入<HIGH,买入,MIN(MIN(OPEN,CLOSE),买入),3,0),COLORMAGENTA;
STICKLINE(买入>MIN(C,O) AND 买入<MAX(C,O),买入,MIN(OPEN,CLOSE),3,0),COLORMAGENTA;
STICKLINE(买入>LOW AND 买入<HIGH,买入,LOW,0,0),COLORMAGENTA;
DRAWTEXT(CROSS(C,卖出),卖出*1.05,'卖出'),COLOR00FFFF;
机会来临:=REF(IF((MA(C,5)-C)/C>0.04 AND (MA(C,10)-MA(C,5))/MA(C,5)>0.04,30,0),1),COLORF00FF0,LINETHICK2;
RSV2:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K2:=REF(MA(RSV2,3),1)+(RSV2-REF(MA(RSV2,3),1))/3;
D2:=REF(MA(K2,3),1)+(K2-REF(MA(K2,3),1))/3;
J2:=3*K2-2*D2;
BB1:=EMA(J2,5);
BB2:=REF(BB1,1);
金叉:=CROSS(BB1,BB2);
DRAWTEXT(CROSS(C,买入) AND BB1>BB2 AND C>REF(O,2),买入*0.95,'买入'),COLOR0000FF;
DRAWICON(CROSS(C,买入) AND 金叉 AND 机会来临 ,LOW*0.96,26);
DRAWTEXT(CROSS(C,买入) AND 金叉 AND 机会来临,LOW*0.92,'【绝杀点】'),COLOR00FF00;
{行业地域}
DRAWTEXT_FIX(ISLASTBAR,0.62,0.00,0,CODE),COLORYELLOW;
Z1:=STRCAT(HYBLOCK,' ');
Z2:=STRCAT(Z1,DYBLOCK);
Z3:=STRCAT(Z2,' ');
DRAWTEXT_FIX(ISLASTBAR,0.66,0.00,0,STRCAT(Z3,GNBLOCK)),COLOR00C0C0;
A:=DRAWTEXT(C<REF(L,4),LOW,'*');
LS0:=BARSLAST(A);
LS11:=IF(1,LS0=1,A);
LS21:=IF(1,LLV(L,1)>REF(L,1),1);
A1:=LS11 AND LS21;
LS12:=IF(2,LS0=2,A);
LS22:=IF(2,LLV(L,2)>REF(L,2),1);
A2:=LS12 AND LS22;
LS13:=IF(3,LS0=3,A);
LS23:=IF(3,LLV(L,3)>REF(L,3),1);
A3:=LS13 AND LS23;
LS14:=IF(4,LS0=4,A);
LS24:=IF(4,LLV(L,4)>REF(L,4),1);
A4:=LS14 AND LS24;
LS15:=IF(5,LS0=5,A);
LS25:=IF(5,LLV(L,5)>REF(L,5),1);
A5:=LS15 AND LS25;
LS16:=IF(6,LS0=6,A);
LS26:=IF(6,LLV(L,6)>REF(L,6),1);
A6:=LS16 AND LS26;
LS17:=IF(7,LS0=7,A);
LS27:=IF(7,LLV(L,7)>REF(L,7),1);
A7:=LS17 AND LS27;
LS18:=IF(8,LS0=8,A);
LS28:=IF(8,LLV(L,8)>REF(L,8),1);
A8:=LS18 AND LS28;
LS19:=IF(9,LS0=9,A);
LS29:=IF(9,LLV(L,9)>REF(L,9),1);
A9:=LS19 AND LS29;
DRAWTEXT(A1,L-0.5,'1'),COLORGREEN;
DRAWTEXT(A2,L-0.5,'2'),COLORGREEN;
DRAWTEXT(A3,L-0.5,'3'),COLORGREEN;
DRAWTEXT(A4,L-0.5,'4'),COLORGREEN;
DRAWTEXT(A5,L-0.5,'5'),COLORGREEN;
DRAWTEXT(A6,L-0.5,'6'),COLORGREEN;
DRAWTEXT(A7,L-0.5,'7'),COLORGREEN;
DRAWTEXT(A8,L-0.5,'8'),COLORGREEN;
DRAWTEXT(A9,L-0.5,'9'),COLORGREEN;
{黄金分割}
NB:=80;
MB:=3;
MA5X:=MA(C,5);
MA13X:=MA(C,13);
高:=REF(HHV(H,NB),MB);
低:=REF(LLV(L,NB),MB);
H19:=高-(高-低)*0.191;
H38:=高-(高-低)*0.382;
H中:=高-(高-低)*0.5;
H61:=高-(高-低)*0.618;
H80:=高-(高-低)*0.809;
一:REFDATE(高,DATE),POINTDOT,COLORWHITE;
二:REFDATE(H19,DATE),POINTDOT,COLORYELLOW;
三:REFDATE(H38,DATE),POINTDOT,COLORMAGENTA;
四:REFDATE(H中,DATE),POINTDOT,COLORRED;
五:REFDATE(H61,DATE),POINTDOT,COLORMAGENTA;
六:REFDATE(H80,DATE),POINTDOT,COLORYELLOW;
七:REFDATE(低,DATE),POINTDOT,COLORWHITE;
DRAWTEXT(ISLASTBAR,一,' 高'),COLORWHITE;
DRAWTEXT(ISLASTBAR,二,' 809'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,三,' 618'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,四,' 中'),COLORRED;
DRAWTEXT(ISLASTBAR,五,' 382'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,六,' 191'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,七,' 低'),COLORWHITE;
{短期支撑压力线}
N1:=5;
A10:=REF(H,N1)=HHV(H,2*N1+1);
B10:=FILTER(A10,N1);
C1:=BACKSET(B10,N1+1);
D1:=FILTER(C1,N1);
A20:=REF(L,N1)=LLV(L,2*N1+1);
B2:=FILTER(A20,N1);
C2:=BACKSET(B2,N1+1);
D20:=FILTER(C2,N1);
E1:=(REF(LLV(L,2*N1),1)+REF(HHV(H,2*N1),1))/2;
E2:=(H+L)/2;
H1:=(D1 AND NOT(D20 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(C)=1;
L1:=(D20 AND NOT(D1 AND E1<E2));
H2:=D1 AND NOT(D20 AND E1>=E2);
X1:=REF(BARSLAST(H1),1)+1;
F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,L,10000),X1));
G1:=F1>REF(F1,1);
I1:=BACKSET(G1,2);
LD:=I1>REF(I1,1);
L2:=LD OR ISLASTBAR OR BARSCOUNT(C)=1;
X2:=REF(BARSLAST(L2),1)+1;
F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,H,0),X2));
G2:=F2>REF(F2,1);
I2:=BACKSET(G2,2);
HD:=I2>REF(I2,1);
R1:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
S1:=R1>REF(R1,1);
T1:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
U1:=T1>REF(T1,1);
R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2);
S2:=R2>REF(R2,1);
T2:=BACKSET(U1,REF(BARSLAST(LD),1)+2);
U2:=T2>REF(T2,1);
短压力线:DRAWLINE(S2,H,S1,H,1),COLORGREEN;
短支撑线:DRAWLINE(U2,L,U1,L,1),COLORRED;
降△边:DRAWLINE(HIGH>=HHV(HIGH,10),HIGH,LOW<=LLV(LOW,3),HHV(HIGH,3),1),COLORCYAN,DOTLINE;
涨△边:DRAWLINE(LOW<=LLV(LOW,10),LOW,HIGH>=HHV(HIGH,3),LLV(LOW,3),1),COLORCYAN,DOTLINE;
DRAWKLINE(H,O,L,C);
黄金柱:=V/REF(V,1)>=1.9;
K1:=SUMBARS(黄金柱,1) ;
K0:=SUMBARS(黄金柱,2);
K3:=SUMBARS(黄金柱,3);
K4:=SUMBARS(黄金柱,4);
K5:=SUMBARS(黄金柱,5);
K6:=SUMBARS(黄金柱,6);
K7:=SUMBARS(黄金柱,7);
K8:=SUMBARS(黄金柱,8);
K9:=SUMBARS(黄金柱,9);
K10:=SUMBARS(黄金柱,10);
AA:STICKLINE(K1,REF(L,K1-1)*1.002,REF(L,K1-1),5,0),COLORYELLOW;
STICKLINE(C/REF(C,1)>1.095,C,O,2,0),COLORYELLOW;
N:=75;P:=5;P1:=10;
E10:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);
F10:=E10>REF(E10,1);
短压:DRAWLINE(D1,H,F10,H,1),COLORCYAN,DOTLINE;
A00:=AMOUNT/V/100;
VARA:=EMA((((A00-EMA(A00,13))/EMA(A00,13))*(0-100)),5);
QQ:=EMA(((VARA/10)+EMA(A00,13)),0);
行情线:=MA(A00,1);
重心:=(C+0.618*REF(C,1)+0.382*REF(C,1)+0.236*REF(C,3)+0.146*REF(C,4))/2.382;
【操盘线】:EMA(((SLOPE(C,22)*20)+C),55),COLORYELLOW,LINETHICK2;
【黄金线】:IF(重心>=【操盘线】,【操盘线】,DRAWNULL),COLORRED,LINETHICK1;
【空仓线】:IF(重心<【操盘线】,【操盘线】,DRAWNULL),COLORCYAN,LINETHICK1;
{DRAWTEXT(ISLASTBAR,【操盘线】,'【操盘线】'),COLORRED;}
{引:EMA(CLOSE,2),LINETHICK1,COLORMAGENTA;
探:MA(CLOSE,5),LINETHICK1;}
变:EMA(CLOSE,5),LINETHICK1,COLORYELLOW;
金:IF(变>REF(变,1),变,DRAWNULL),COLORRED,LINETHICK1;
空:IF(变<REF(变,1),变,DRAWNULL),COLORGREEN,LINETHICK1;
{DRAWTEXT(ISLASTBAR,变,'【雷达线】'),COLORRED;}
{顶底信号}
DA:=(EMA(H,1)+EMA(L,1)+EMA(H,1)+EMA(H,1))/4;
DB:=EMA(REF(HHV(H,25),1),2),COLORGREEN,LINETHICK1;
{DRAWTEXT(CROSS(DB,DA),DB,'←险'),COLORGREEN,LINETHICK1;}
DRAWTEXT(CROSS(DA,【操盘线】),【操盘线】-0.5,'★B'),COLORYELLOW,LINETHICK1;
{涨跌停显示}
涨停:=IF((C-REF(C,1))*100/REF(C,1)>=(10-0.01*100/REF(O,1)),1,0);
STICKLINE(涨停,O,C,3,0),COLORYELLOW;
ZDF:=(C-REF(C,1))/REF(C,1)*100;
STICKLINE(ZDF<-9.9,O,C,3,0),COLORGREEN;
DA9:=(EMA(C,1)+EMA(C,2)+EMA(C,3)+EMA(C,4))/4;
DB9:=(EMA(C,10)+EMA(C,20)+EMA(C,40)+EMA(C,80))/4;
DRAWTEXT(CROSS(DA9-DB9,0),L*0.98,'B'),COLORYELLOW;
JH9:=SMA(MAX(C-REF(C,1),0),5,1)/SMA(ABS(C-REF(C,1)),5,1)*100;
DRAWTEXT(CROSS(84,JH9),H*1.02,'☆S'),COLORGREEN;
市场成本:"MCST.MCST",POINTDOT,COLORCYAN,LINETHICK4;
丁丁主力线:=EMA(C,3),COLORWHITE;
丁丁跟随主力线:=EMA(C,5),COLORYELLOW;
丁丁辅助主力线:=EMA(C,7),COLORBROWN;
丁短线回踩支撑:=EMA(C,10),COLORLIGREEN;
丁丁启动线:=EMA(C,20),COLORRED,LINETHICK2;
SS:=CROSS(丁丁主力线,丁丁跟随主力线) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018
OR CROSS(丁丁跟随主力线,丁丁辅助主力线) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018
OR CROSS(丁丁跟随主力线,丁短线回踩支撑) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018
OR CROSS(丁丁主力线,丁丁辅助主力线) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018
OR CROSS(丁丁主力线,丁短线回踩支撑) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018
OR CROSS(丁丁跟随主力线,丁丁辅助主力线) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018
OR CROSS(丁丁跟随主力线,丁丁启动线) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018
OR CROSS(丁丁辅助主力线,丁短线回踩支撑) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018
OR CROSS(丁丁跟随主力线,丁丁启动线) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018 AND CROSS(丁丁主力线,丁丁启动线);
DRAWTEXT(SS,L-0.04,'丁丁买入'),COLORMAGENTA;
DRAWICON(SS,L-0.04,5);
N00:=20;
M00:=INTPART(3*N00/5);
AAA0:=REF(H,M00)=HHV(H,2*M00+1);
QYY:=BACKSET(AAA0,M00+1);
CCC:=FILTER(QYY,M00) AND H=HHV(H,M00+1);
DDDD:=BARSLAST(CCC),NODRAW;
GDTSS:=IF(CCC,CURRBARSCOUNT,0);
DINGBUTSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS);
GDCS11:=CONST(DINGBUTSS);
DINGBUTS11:=REF(DINGBUTSS,DDDD+1);
GDCS22:=CONST(DINGBUTS11);
AA11:=REF(L,M00)=LLV(L,2*M00+1);
QY11:=BACKSET(AA11,M00+1);
CC11:=FILTER(QY11,M00) AND L=LLV(L,M00+1);
DD11:=BARSLAST(CC11);
DDTSS:=IF(CC11,CURRBARSCOUNT,0);
DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS);
DDCS11:=CONST(DDTS11);
DDTS22:=REF(DDTS11,DD11+1);
DDCS22:=CONST(DDTS22);
线1:DRAWLINE(CURRBARSCOUNT=GDCS22,H,CURRBARSCOUNT=GDCS11,H,1),COLORYELLOW,LINETHICK1,DOTLINE;
线2:DRAWLINE(CURRBARSCOUNT=DDCS22,L,CURRBARSCOUNT=DDCS11,L,1) COLORYELLOW,LINETHICK1,DOTLINE;
突破:H>=线1 AND REF(H<线1,1),NODRAW;
破位:L<=线2 AND REF(L>线2 ,1),NODRAW;
STICKLINE(突破,O,C,3,0),COLORLIMAGENTA;
STICKLINE(破位,O,C,3,0),COLORLICYAN;
A100:=REF(H,8)=HHV(H,2*8+1);
B100:=FILTER(A100,8);
C100:=BACKSET(B100,8+1);
D100:=FILTER(C100,8);{高点}
R11:=BACKSET(ISLASTBAR,BARSLAST(D100)+1); S11:=R11>REF(R11,1);
DRAWLINE(D100,H,S11,H,1),COLORBLUE;
A200:=REF(L,8)=LLV(L,2*8+1);
B200:=FILTER(A200,8);
C200:=BACKSET(B200,8+1);
D0:=FILTER(C200,8);{低点}
T11:=BACKSET(ISLASTBAR,BARSLAST(D0)+1); U11:=T11>REF(T11,1);
DRAWLINE(D0,L,U11,L,1),COLORCYAN,DOTLINE;
M:=INTPART(3*8/5);
A12:=REF(H,M)=HHV(H,2*M+1);
B12:=FILTER(A12,M);
C12:=BACKSET(B12,M+1);
D12:=FILTER(C12,M);{高点}
R112:=BACKSET(ISLASTBAR,BARSLAST(D12)+1); S112:=R112>REF(R112,1);
DRAWLINE(D12,H,S112,H,1),COLOR38B0DE,LINETHICK2;
A22:=REF(L,M)=LLV(L,2*M+1);
B22:=FILTER(A22,M);
C22:=BACKSET(B22,M+1);
D22:=FILTER(C22,M);{低点}
T112:=BACKSET(ISLASTBAR,BARSLAST(D22)+1); U112:=T112>REF(T112,1);
DRAWLINE(D22,L,U112,L,1),COLOR38B0DE,LINETHICK2;
VAR1111:=BACKSET(REF(HIGH,2)=HHV(HIGH,5),3);
VAR2222:=CROSS(VAR1111,0.9);
VAR3333:=BACKSET(REF(LOW,2)=LLV(LOW,5),3);
VAR4444:=CROSS(VAR3333,0.9);
压力:= REF(HIGH,BARSLAST(VAR2222));
STICKLINE(CLOSE,REF(HIGH,BARSLAST(VAR2222)),REF(HIGH,BARSLAST(VAR2222)),0.5,1),COLOREA91B5,LINETHICK3;
支撑:= REF(LOW,BARSLAST(VAR4444));
STICKLINE(CLOSE,REF(LOW,BARSLAST(VAR4444)),REF(LOW,BARSLAST(VAR4444)),0.5,1),COLOR00B4FF,LINETHICK3;
下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);
RRRSV:=SMA(下档线,3,1);
KKK:=SMA(RRRSV,3,1);
DDD:=((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,DDD),HIGH,REF(HIGH,BARSLAST(CROSS(D24,DDD)))),COLORFFFFFF;
压力位:=IF(ISLASTBAR,压力2,DRAWNULL);
STICKLINE(ISLASTBAR ,压力位,压力位,120,0),LINETHICK4,COLORFFFFFF;
底部:=LLV(HIGH,30),COLOR00FF00;
底部位:=IF(ISLASTBAR,底部,DRAWNULL);
STICKLINE(ISLASTBAR ,底部位,底部位,100,0),LINETHICK4,COLOR00FF00;
HV:=HHV(V,5)=V OR V/REF(V,1)>=5;
FT:=BARSLAST(HV);
量能平台:=IF(HV,C,REF(C,FT));
DRAWTEXT(量能平台>REF(量能平台,1)AND C<REF(C,1),L,'●量跌');
DRAWTEXT(量能平台<REF(量能平台,1) AND C>REF(C,1),L,'●缩涨');
DRAWTEXT(量能平台>REF(量能平台,1) AND C>REF(C,1) AND C>MA(C,13) AND C=HHV(C,20) AND C/REF(C,1)>1.05,L,'*突破');
VAR90:=((((HHV((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,26)),9)))*2),4)<0) AND ((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,26)),9)))*2)>REF((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,26)),9)))*2),1))) AND (REF((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,26)),9)))*2),1)<REF((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,26)),9)))*2),2))) AND (REF((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,26)),9)))*2),2)<REF((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,26)),9)))*2),3)));
DRAWTEXT(VAR90,L*0.98,'短买');
VAR326:=IF(CLOSE>REF(CLOSE, 1),88,0);
VAR327:=IF(CLOSE/REF(CLOSE, 1)>1.050 AND HIGH/CLOSE<1.010 AND VAR326>0, 91, 0);
STICKLINE(VAR327>90,L*0.99,L*1,1,0),COLORYELLOW;
DRAWTEXT(VAR327>90,LOW*0.95,'起爆'),COLORYELLOW;
VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3);
DRAWTEXT(VAR11 AND COUNT(VAR11,30)=1,LOW*0.95,'●机构进'),LINETHICK1,COLORFF00FF;
{千股千评}
DRAWTEXT_FIX(1,0.4,0.01,0,STRCAT('千股千评: ',EXTERNSTR(0,5))),COLORYELLOW;
DRAWTEXT_FIX(1,0.00,0.04,0,'主题投资:')COLOR0000FF;
DRAWTEXT_FIX(1,0.07,0.04,0,EXTERNSTR(0,1))COLOR0000FF;
DRAWTEXT_FIX(1,0.00,0.08,0,'主营业务:')COLORFF00FF;
DRAWTEXT_FIX(1,0.07,0.08,0,EXTERNSTR(0,2))COLORFF00FF;
DRAWTEXT_FIX(1,0.00,0.12,0,'出千概念:')COLORFF88FF;
DRAWTEXT_FIX(1,0.07,0.12,0,EXTERNSTR(0,3))COLORFF88FF;
DRAWTEXT_FIX(1,0.00,0.16,0,'愚民主题概念:'),COLOR00FFFF;
DRAWTEXT_FIX(1,0.09,0.16,0,EXTERNSTR(0,4)),COLOR00FFFF;