以下是通达信分时图T+0源码(无源码的请下载附件导入)
均:SUM(CLOSE*VOL,FROMOPEN)/SUM(VOL,FROMOPEN),COLORYELLOW,DOTLINE;
最新1:CLOSE,LINETHICK2,COLORWHITE;
{能量竖线}
MA25:=EMA(CLOSE,25);
强弱:EMA(CLOSE,905);
IF(MA25>强弱,MA25,DRAWNULL),COLOR0000FF;
IF(MA25<强弱,MA25,DRAWNULL),COLOR00FF00;
STICKLINE((MA25 >强弱),MA25,强弱,0,0),COLOR0000FF;
STICKLINE((MA25 >强弱)AND MA25<REF(MA25,1),MA25,强弱,0,0),COLORYELLOW;
STICKLINE((MA25 >强弱)AND 强弱<REF(强弱,1),MA25,强弱,0,0),COLORCYAN;
STICKLINE((MA25 <强弱),MA25,强弱,0,0),COLOR00FF00;
STICKLINE((MA25 <强弱)AND MA25>REF(MA25,1),MA25,强弱,0,0),COLORCYAN;
STICKLINE((MA25 <强弱)AND 强弱>REF(强弱,1),MA25,强弱,0,0),COLORLIRED;
DRAWICON(CROSS(MA25,强弱),强弱*0.99,0);
{区间线、买卖标志}
H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L1:=MIN(DYNAINFO(3),DYNAINFO(6));
P1:=H1-L1;
T1:(L1+P1*8.5/9),COLORFFFFFF;{白色顶线}
阻力:(L1+P1*7/9),COLOR00DD00;{绿色00DD00阻力线}
Z:(L1+P1*4.5/9),COLORWHITE,LINETHICK1,POINTDOT;{红000099中线}
B:(L1+P1*2.0/9),COLORYELLOW;{支撑线}
支撑:(L1+P1*0.5/9),COLORFFFFFF;{白色FFFFFF底线}
现价:=CLOSE,COLORYELLOW;
{DRAWTEXT( ISLASTBAR AND 现价,现价,STRCAT('←',CON2STR(现价,2))),COLORYELLOW;{分时线价格标注}
STICKLINE(CROSS(支撑,现价),Z,支撑,1,0),COLORMAGENTA;
DRAWTEXT(LONGCROSS(支撑,现价,2),支撑*1.001,'☆买'),COLORMAGENTA;{吸}
DRAWTEXT(LONGCROSS(现价,阻力,2),现价,'★卖'),COLORGREEN;{抛};
DRAWICON(CROSS(现价,T1),现价*0.999,8);
{DRAWTEXT(CROSS(现价,B),支撑,'买')COLORWHITE;}
STICKLINE(FILTER(C,60)>0,T1,支撑,0.5,0),COLORRED;{时间分割线};
DRAWTEXT(CURRBARSCOUNT=8,T1+0.003,'顶'),COLORGREEN,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=8,支撑-0.003,'底'),COLORLIRED,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=8,Z,'中'),COLORWHITE,LINETHICK1;
最新:CLOSE,LINETHICK2,COLORWHITE;
AA:=SUM(AMOUNT,BARSCOUNT(C))/SUM(VOL*100,BARSCOUNT(C));
BB:=BETWEEN(C/AA,C+H,C-H);
DRAWTEXT( ISLASTBAR AND 最新>REF(最新,1),最新,STRCAT(' 涨▲',CON2STR(最新,2))),COLORMAGENTA;
DRAWTEXT( ISLASTBAR AND 最新<REF(最新,1),最新,STRCAT(' 跌▼',CON2STR(最新,2))),COLOR00FF00;
均价:=SUM(C*V,240)/SUM(V,240),COLORYELLOW,LINETHICK2,DOTLINE;
TT:=BARSCOUNT(C);
前高:=REF(HHV(H,TT),1);
突破:=CROSS(C,REF(HHV(H,TT),1)){ AND HHVBARS(VOL,TT)=0} AND C/均价<1.09 AND TT>1 AND TT<240;
DRAWTEXT(CROSS(C,REF(HHV(H,TT),1)) AND {HHVBARS(VOL,TT)=0 AND} C/均价<1.09 AND TT>=1 AND TT<240 ,前高, '←突'),COLORRED;
主力扫盘:=COUNT(突破,13)>=3 AND CROSS(C,REF(HHV(H,TT),1)){ AND HHVBARS(VOL,TT)=0};
DRAWTEXT(主力扫盘,前高, '←扫盘'),COLORYELLOW;
{已主力扫盘:=BARSLAST(主力扫盘)<13;
DRAWTEXT(BARSLAST(主力扫盘)<8,(DYNAINFO(3))*9.5/10 , '↖已扫'),COLORGREEN;}
全仓买进:=CROSS(C,REF(HHV(H,TT),1)) AND HHVBARS(VOL,TT)=0 AND C/均价<1.09 AND TT>1 AND TT<240 AND BARSLAST(主力扫盘)>=21;
DRAWTEXT(全仓买进 ,前高, '←全仓'),COLORCYAN;
VAR1:=EMA(EMA(C,13),13);
控盘:=(VAR1-REF(VAR1,1))/REF(VAR1,1)*1000;
JJ:=DYNAINFO(11);
P:=55;
S:=8;
M1:=3;
能量:=(EMA(C,S)-EMA(C,P))*10;
空头:=EMA(能量,M1);
BTJ11:=(C-JJ)/JJ<-0.03;
BTJ2:=控盘>REF(控盘,1) AND 控盘<-0.2;
BTJ3:=CROSS(能量,空头) AND 能量<-0.3;
BTJ811:=FILTER(BTJ11 AND BTJ2 AND BTJ3,13);
有庄:=BTJ811;
DRAWTEXT(BTJ811,C*0.999,'←有庄'),COLORRED;
HHH1:=MAX(DYNAINFO(3),DYNAINFO(5));
LLL1:=MIN(DYNAINFO(3),DYNAINFO(6));
PPP1:=HHH1-LLL1;
阻力6:=LLL1+PPP1*7/8,COLORGREEN;
支撑6:=LLL1+PPP1*0.5/8,COLORMAGENTA;
{DRAWICON(LONGCROSS(支撑,C,2),C,5);
DRAWICON(LONGCROSS(C,阻力,2),C,6);}
{资金流入:=SUM(IF(C>REF(C,1),C*V,0),FROMOPEN);
资金流出:=-SUM(IF(C<REF(C,1),C*V,0),FROMOPEN);
净资金:=(资金流入+资金流出)/10000;
{DRAWTEXT_FIX(1,0.700,1-0.15,0,STRCAT(STRCAT('【净买】',CON2STR(净资金,1)),'万')),COLORRED;}
KP:=DYNAINFO(4);
ZX:=DYNAINFO(7);
分时顶:HHV(H,480),COLORRED,DOTLINE;
分时底:LLV(L,480),COLORGREEN,DOTLINE;
{DRAWICON(FILTER(CROSS(C,DYNAINFO(3)*1.1-0.01),60),C,1);}
DRAWNUMBER(FILTER(CROSS(C,DYNAINFO(3)*1.1-0.01),60),C*0.99,TIME);
DRAWNUMBER(FILTER(CROSS(C,DYNAINFO(3)*1.1-0.01),60),C*0.98,C),COLORYELLOW;
{乖离主图}
IF(MACD.DEA<0,CLOSE,DRAWNULL),COLORYELLOW,LINETHICK9;{画加仓黄线}
XA_1:=MAX(DYNAINFO(3),DYNAINFO(5));
XA_2:=MIN(DYNAINFO(3),DYNAINFO(6));
XA_3:=XA_1-XA_2;
XA_4:=XA_2+XA_3*7/8;
XA_5:=XA_2+XA_3*0.5/8;
DRAWICON(LONGCROSS(XA_5,CLOSE,2),CLOSE,1);
DRAWICON(LONGCROSS(CLOSE,XA_4,2),CLOSE,2);
XA_6:=DYNAINFO(4);
XA_7:=DYNAINFO(5);
XA_8:=DYNAINFO(6);
XA_9:=DYNAINFO(11);
XA_10:=CLOSE;
XA_11:=BARSCOUNT(XA_10);
XA_12:=SUM(VOL*CLOSE,0)/SUM(VOL,0);
XA_13:=MA(XA_10,XA_11);
XA_14:=XA_13+2*STD(XA_10,3);
XA_15:=XA_13-2*STD(XA_10,3);
DRAWICON(CROSS(XA_12,XA_13),XA_12,38);
XA_16:=TIME>93000;
XA_17:=XA_10/REF(CLOSE,1)>1.02;
XA_18:=XA_10/REF(CLOSE,1)<0.98;
XA_19:=(HHV(XA_10,XA_11)-LLV(XA_10,XA_11))/XA_10<0.05;
XA_20:=SMA(VOL,30,1);
XA_21:=(XA_20-LLV(LLV(XA_20,1),30))/(HHV(HHV(XA_20,1),30)-LLV(LLV(XA_20,1),30))>0.95;
XA_22:=XA_17 OR XA_18;
XA_23:=XA_22=0 AND XA_19 AND XA_21 AND CROSS(XA_12,XA_13);
DRAWTEXT(FILTER(XA_23,10),XA_12,506),COLORYELLOW;
XA_24:=XA_22=0 AND XA_19 AND XA_21 AND CROSS(CLOSE,XA_12) AND CROSS(CLOSE,XA_13);
DRAWTEXT(FILTER(XA_24,10),XA_12*0.99,507),COLORRED;
攻击量:=((HSL*0.50+REF(HSL,1)*0.33)+(REF(HSL,2)*0.17))*SUM(C,FROMOPEN)/FROMOPEN;
攻击量A:=SUM(IF(C>REF(C,1),攻击量*V,0),FROMOPEN),COLOR0000FF,LINETHICK0;
攻击量B:=-SUM(IF(C<REF(C,1),攻击量*V,0),FROMOPEN),COLOR00FF00,LINETHICK0;
攻击流量:=攻击量A+攻击量B,COLORSTICK;
攻击比:=攻击流量/SUM(V,FROMOPEN)*100,COLORRED,LINETHICK1;
资金攻击度:=IF(攻击比>=0,(攻击比+50),100-ABS((攻击比-50)));
资金流入:=SUM(IF(C>REF(C,1),V,0),FROMOPEN),STICK,COLORRED;
资金流出:=-SUM(IF(C<REF(C,1),V,0),FROMOPEN),STICK,COLOR00FF00;
资金出入:=资金流入+资金流出,COLORSTICK;
资金比:=资金出入/SUM(V,FROMOPEN)*100,COLOR00FFFF,LINETHICK1;
资金流量比:=IF(资金比>=0,(资金比+100)/2,100-ABS((资金比-100)/2));
DRAWTEXT_FIX(1,0.500,0.00,0,STRCAT(STRCAT('资金流量比',CON2STR(资金流量比,2)),'%买')),COLORCYAN;
DRAWTEXT_FIX(1,0.280,0.00,0,STRCAT(STRCAT('资金攻击度',CON2STR(资金攻击度,2)),' %买')),COLORCYAN;
A1:=SUM(IF(CLOSE>REF(CLOSE,1),VOL/CAPITAL*100,IF(CLOSE<REF(CLOSE,1),-VOL/CAPITAL*100,0)),0);
成交额:=V*C/100,NODRAW;
A2:=SUM((IF(((成交额/8>20) AND (CLOSE>(REF(CLOSE,1)))),成交额,0)),0);
A3:=SUM((IF(((成交额/8>20) AND (CLOSE<(REF(CLOSE,1)))),成交额,0)),0);
A4:=SUM((IF(((成交额/8<20) AND (CLOSE>(REF(CLOSE,1)))),成交额,0)),0);
A5:=SUM((IF(((成交额/8<20) AND (CLOSE<(REF(CLOSE,1)))),成交额,0)),0);
A6:=((A2+A3)+A4)+A5;
A7:=IF((ISLASTBAR),((100*A2)/A6),0);
A8:=IF((ISLASTBAR),((100*A3)/A6),0);
A9:=IF((ISLASTBAR),((100*A4)/A6),0);
A10:=IF((ISLASTBAR),((100*A5)/A6),0);
DD1:=1;
AAA1:=STRCAT(STRCAT('机构买入',CON2STR((100*A2)/A6,0)),'%');
AAA2:=STRCAT(STRCAT('机构卖出',CON2STR((100*A3)/A6,0)),'%');
AAA0:=STRCAT(STRCAT('机构总买入',CON2STR((100*(A2-A3))/A6,0)),'%');
AAA3:=STRCAT(STRCAT('散户买入',CON2STR((100*A4)/A6,0)),'%');
AAA4:=STRCAT(STRCAT('散户卖出',CON2STR((100*A5)/A6,0)),'%');
AAA5:=STRCAT(STRCAT('散户总买入',CON2STR((100*(A4-A5))/A6,0)),'%');
DRAWTEXT_FIX(DD1=1,0.100,1.00,0,AAA1),COLORRED;
DRAWTEXT_FIX(DD1=1,0.230,1.00,0,AAA2),COLORGREEN;
DRAWTEXT_FIX(DD1=1,0.360,1.00,0,AAA3),COLORRED;
DRAWTEXT_FIX(DD1=1,0.490,1.00,0,AAA4),COLORGREEN;
DRAWTEXT_FIX(DD1=1,0.620,1.00,0,AAA0),LINETHICK5,COLORYELLOW;
DRAWTEXT_FIX(DD1=1,0.780,1.00,0,AAA5),LINETHICK5,COLORCYAN;
|