当前位置: 网站首页 > 股票软件公式 > 通达信公式 > 文章 当前位置: 通达信公式 > 文章

通达信源码精选:换手异动,涨跌周期分析,自用分时主图

点击: 次    来源:顶尖财经    作者:股市狙击 - 小 + 大

1、换手异动,量能指标

{公式名称: 换手异动}

换手:VOL/CAPITAL*100,NODRAW;
低换手:换手<2,NODRAW,COLORCYAN;
VAR1:=IF(DATETODAY(DATE)<9885,1,1);
STICKLINE(换手<2,0,换手,2.3,0),COLORFF4400;
STICKLINE(换手<2,0,换手,1.8,0),COLORFF6600;
STICKLINE(换手<2,0,换手,1.3,0),COLORFF9900;
STICKLINE(换手<2,0,换手,0.6,0),COLORFFCC00;
STICKLINE(换手<2,0,换手,0.3,0),COLORGREEN;
VAR2:=1171230;
VAR3:=IF(1<2342.459961*500,1,DRAWNULL);
温和换手:换手>2 AND 换手<5*VAR3 AND VAR1,NODRAW,COLORMAGENTA;
STICKLINE(换手>2 AND 换手<5,0,换手,2.3,0),COLORFF0033;
STICKLINE(换手>2 AND 换手<5,0,换手,1.8,0),COLORFF0066;
STICKLINE(换手>2 AND 换手<5,0,换手,1.2,0),COLORFF0099;
STICKLINE(换手>2 AND 换手<5,0,换手,0.6,0),COLORFF00CC;
STICKLINE(换手>2 AND 换手<5,0,换手,0.3,0),COLORMAGENTA;
热换手:换手>5 AND 换手<11*VAR3 AND VAR1,NODRAW,COLORYELLOW;
STICKLINE(换手>5 AND 换手<11,0,换手,2.3,0),COLOR0035FF;
STICKLINE(换手>5 AND 换手<11,0,换手,1.8,0),COLOR0064FF;
STICKLINE(换手>5 AND 换手<11,0,换手,1.3,0),COLOR0093FF;
STICKLINE(换手>5 AND 换手<11,0,换手,0.8,0),COLOR00C2FF;
STICKLINE(换手>5 AND 换手<11,0,换手,0.3,0),COLORYELLOW;
烫手换手:换手>11 AND 换手<17*VAR3 AND VAR1,NODRAW,COLORRED;
STICKLINE(换手>11 AND 换手<17,0,换手,2.3,0),COLOR000055;
STICKLINE(换手>11 AND 换手<17,0,换手,2,0),COLOR000077;
STICKLINE(换手>11 AND 换手<17,0,换手,1.8,0),COLOR000099;
STICKLINE(换手>11 AND 换手<17,0,换手,1.5,0),COLOR0000BB;
STICKLINE(换手>11 AND 换手<17,0,换手,0.9,0),COLOR0000DD;
STICKLINE(换手>11 AND 换手<17,0,换手,0.3,0),COLORRED;
高潮换手:换手>17*VAR3 AND VAR1,NODRAW,COLORGREEN;
STICKLINE(换手>17,0,换手,2.3,0),COLOR006000;
STICKLINE(换手>17,0,换手,2.1,0),COLOR007500;
STICKLINE(换手>17,0,换手,1.8,0),COLOR009100;
STICKLINE(换手>17,0,换手,1.3,0),COLOR00A600;
STICKLINE(换手>17,0,换手,0.8,0),COLOR00BB00;
STICKLINE(换手>17,0,换手,0.3,0),COLOR00CC00;
DRAWICON(换手>25,换手,15);
五日换手:MA(换手,5)*VAR3;
十日换手:MA(换手,10);



2、涨跌周期分析

{涨跌周期分析}

最高点:REFDATE(CONST(REF(HHV(H,0),0)),DATE),LINETHICK9,COLORMAGENTA;
最低点:REFDATE(CONST(REF(LLV(L,0),0)),DATE),LINETHICK9,COLORGREEN;
当期开盘:DOPEN,NODRAW;
当期收盘:DCLOSE,NODRAW;
当期最高:DHIGH,NODRAW;
当期最低:DLOW,NODRAW;
当期上影:DHIGH-MAX(DOPEN,DCLOSE),NODRAW;
当期下影:MIN(DOPEN,DCLOSE)-DLOW,NODRAW;
当期实体:ABS(DCLOSE-DOPEN),NODRAW;
当期涨幅:(DCLOSE-DOPEN)/DOPEN*100,NODRAW;
当期波幅:(DHIGH-DLOW)/DLOW*100,NODRAW;
涨跌周期:BARSLAST(O=DOPEN AND DVOL!=REF(DVOL,1))+1,NODRAW,COLORRED;
DRAWNUMBER(REFX(涨跌周期,1)<=涨跌周期 OR ISLASTBAR ,DHIGH,涨跌周期),DRAWABOVE;
DRAWTEXT_FIX(1,0.1,0.991,1,STRCAT('多空涨跌周期计算:',CON2STR(涨跌周期,2))),COLORWHITE;
高低价差:=(最高点-最低点),DOTLINE;
区间1:最高点-高低价差*0.90,DOTLINE;
区间2:最高点-高低价差*0.80,DOTLINE;
区间3:最高点-高低价差*0.70,DOTLINE;
区间4:最高点-高低价差*0.60,DOTLINE;
区间5:最高点-高低价差*0.50,DOTLINE;
区间6:最高点-高低价差*0.40,DOTLINE;
区间7:最高点-高低价差*0.30,DOTLINE;
区间8:最高点-高低价差*0.20,DOTLINE;
区间9:最高点-高低价差*0.10,DOTLINE;
HB:=COST(99.999);
LB:=COST(0.001);
B3:=(HB-LB)/50;
B31:=HB-B3;
B32:=HB-2*B3;
B33:=HB-3*B3;
B34:=HB-4*B3;
B35:=HB-5*B3;
B36:=HB-6*B3;
B37:=HB-7*B3;
B38:=HB-8*B3;
B39:=HB-9*B3;
B310:=HB-10*B3;
B311:=HB-11*B3;
B312:=HB-12*B3;
B313:=HB-13*B3;
B314:=HB-14*B3;
B315:=HB-15*B3;
B316:=HB-16*B3;
B317:=HB-17*B3;
B318:=HB-18*B3;
B319:=HB-19*B3;
B320:=HB-20*B3;
B321:=HB-21*B3;
B322:=HB-22*B3;
B323:=HB-23*B3;
B324:=HB-24*B3;
B325:=HB-25*B3;
B326:=HB-26*B3;
B327:=HB-27*B3;
B328:=HB-28*B3;
B329:=HB-29*B3;
B330:=HB-30*B3;
B331:=HB-31*B3;
B332:=HB-32*B3;
B333:=HB-33*B3;
B334:=HB-34*B3;
B335:=HB-35*B3;
B336:=HB-36*B3;
B337:=HB-37*B3;
B338:=HB-38*B3;
B339:=HB-39*B3;
B340:=HB-40*B3;
B341:=HB-41*B3;
B342:=HB-42*B3;
B343:=HB-43*B3;
B344:=HB-44*B3;
B345:=HB-45*B3;
B346:=HB-46*B3;
B347:=HB-47*B3;
B348:=HB-48*B3;
B349:=HB-49*B3;
A1:=WINNER(HB)*100-WINNER(B31)*100;
A2:=WINNER(B31)*100-WINNER(B32)*100;
A3:=WINNER(B32)*100-WINNER(B33)*100;
A4:=WINNER(B33)*100-WINNER(B34)*100;
A5:=WINNER(B34)*100-WINNER(B35)*100;
A6:=WINNER(B35)*100-WINNER(B36)*100;
A7:=WINNER(B36)*100-WINNER(B37)*100;
A8:=WINNER(B37)*100-WINNER(B38)*100;
A9:=WINNER(B38)*100-WINNER(B39)*100;
A10:=WINNER(B39)*100-WINNER(B310)*100;
A11:=WINNER(B310)*100-WINNER(B311)*100;
A12:=WINNER(B311)*100-WINNER(B312)*100;
A13:=WINNER(B312)*100-WINNER(B313)*100;
A14:=WINNER(B313)*100-WINNER(B314)*100;
A15:=WINNER(B314)*100-WINNER(B315)*100;
A16:=WINNER(B315)*100-WINNER(B316)*100;
A17:=WINNER(B316)*100-WINNER(B317)*100;
A18:=WINNER(B317)*100-WINNER(B318)*100;
A19:=WINNER(B318)*100-WINNER(B319)*100;
A20:=WINNER(B319)*100-WINNER(B320)*100;
A21:=WINNER(B320)*100-WINNER(B321)*100;
A22:=WINNER(B321)*100-WINNER(B322)*100;
A23:=WINNER(B322)*100-WINNER(B323)*100;
A24:=WINNER(B323)*100-WINNER(B324)*100;
A25:=WINNER(B324)*100-WINNER(B325)*100;
A26:=WINNER(B325)*100-WINNER(B326)*100;
A27:=WINNER(B326)*100-WINNER(B327)*100;
A28:=WINNER(B327)*100-WINNER(B328)*100;
A29:=WINNER(B328)*100-WINNER(B329)*100;
A30:=WINNER(B329)*100-WINNER(B330)*100;
A31:=WINNER(B330)*100-WINNER(B331)*100;
A32:=WINNER(B331)*100-WINNER(B332)*100;
A33:=WINNER(B332)*100-WINNER(B333)*100;
A34:=WINNER(B333)*100-WINNER(B334)*100;
A35:=WINNER(B334)*100-WINNER(B335)*100;
A36:=WINNER(B335)*100-WINNER(B336)*100;
A37:=WINNER(B336)*100-WINNER(B337)*100;
A38:=WINNER(B337)*100-WINNER(B338)*100;
A39:=WINNER(B338)*100-WINNER(B339)*100;
A40:=WINNER(B339)*100-WINNER(B340)*100;
A41:=WINNER(B340)*100-WINNER(B341)*100;
A42:=WINNER(B341)*100-WINNER(B342)*100;
A43:=WINNER(B342)*100-WINNER(B343)*100;
A44:=WINNER(B343)*100-WINNER(B344)*100;
A45:=WINNER(B344)*100-WINNER(B345)*100;
A46:=WINNER(B345)*100-WINNER(B346)*100;
A47:=WINNER(B346)*100-WINNER(B347)*100;
A48:=WINNER(B347)*100-WINNER(B348)*100;
A49:=WINNER(B348)*100-WINNER(B349)*100;
A50:=WINNER(B349)*100-WINNER(LB)*100;
STICKLINE(ISLASTBAR,HB ,HB ,A1*DATE ,0 ),COLORMAGENTA;
STICKLINE(ISLASTBAR,B31 ,B31 ,A1*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B32 ,B32 ,A2*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B33 ,B33 ,A3*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B34 ,B34 ,A4*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B35 ,B35 ,A5*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B36 ,B36 ,A6*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B37 ,B37 ,A7*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B38 ,B38 ,A8*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B39 ,B39 ,A9*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B310 ,B310 ,A10*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B311 ,B311 ,A11*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B312 ,B312 ,A12*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B313 ,B313 ,A13*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B314 ,B314 ,A14*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B315 ,B315 ,A15*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B316 ,B316 ,A16*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B317 ,B317 ,A17*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B318 ,B318 ,A18*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B319 ,B319 ,A19*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B320 ,B320 ,A20*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B321 ,B321 ,A21*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B322 ,B322 ,A22*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B323 ,B323 ,A23*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B324 ,B324 ,A24*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B325 ,B325 ,A25*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B326 ,B326 ,A26*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B327 ,B327 ,A27*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B328 ,B328 ,A28*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B329 ,B329 ,A29*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B330 ,B330 ,A30*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B331 ,B331 ,A31*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B332 ,B332 ,A32*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B333 ,B333 ,A33*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B334 ,B334 ,A34*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B335 ,B335 ,A35*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B336 ,B336 ,A36*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B337 ,B337 ,A37*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B338 ,B338 ,A38*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B339 ,B339 ,A39*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B340 ,B340 ,A40*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B341 ,B341 ,A41*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B342 ,B342 ,A42*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B343 ,B343 ,A43*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B344 ,B344 ,A44*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B345 ,B345 ,A45*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B346 ,B346 ,A46*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B347 ,B347 ,A47*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B348 ,B348 ,A48*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,B349 ,B349 ,A49*100 ,0 ),COLORRED;
STICKLINE(ISLASTBAR,LB ,LB ,A50*DATE ,0 ),COLORGREEN;
STICKLINE(DOPEN<DCLOSE,DHIGH,DLOW,4,0),COLOR33BBBB;
STICKLINE(DOPEN<DCLOSE,DOPEN,DCLOSE,4,0),COLOR8833CC;
STICKLINE(DOPEN>DCLOSE,DHIGH,DLOW,4,0),COLORAA3333;
STICKLINE(DOPEN>DCLOSE,DOPEN,DCLOSE,4,0),COLOR668833;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
{黄金分割  普通 等系坐标}
DRAWRECTREL(990,2,998,188,RGB(0,150,180)),NOFRAME;
DRAWRECTREL(990,188,998,375,RGB(200,200,0)),NOFRAME;
DRAWRECTREL(990,375,998,491,RGB(100,200,0)),NOFRAME;
DRAWRECTREL(990,491,998,607,RGB(200,10,80)),NOFRAME;
DRAWRECTREL(990,607,998,794,RGB(150,0,0)),NOFRAME;
DRAWRECTREL(990,794,998,982,RGB(150,150,150)),NOFRAME;
DRAWTEXT(YEAR!=REF(YEAR,1),HIGH+0.3,VARCAT(VAR2STR(YEAR,0),' 年 ')),COLORMAGENTA;
STICKLINE(YEAR!=REF(YEAR,1)=1,CONST(HHV(H,0)),CONST(LLV(L,0)),0,-1),COLORMAGENTA;
DRAWTEXT(MONTH!=REF(MONTH,1),LOW-0.2,VARCAT(VAR2STR(MONTH,0),' 月 ')),COLORMAGENTA;
STICKLINE(MONTH!=REF(MONTH,1)=1,CONST(HHV(H,0)),CONST(LLV(L,0)),0,-1),COLORMAGENTA;
{DRAWTEXT(WEEKOFYEAR!=REF(WEEKOFYEAR,1),LOW,VARCAT(VAR2STR(WEEKOFYEAR,0),' 周 ')),COLORWHITE;
STICKLINE(WEEKOFYEAR!=REF(WEEKOFYEAR,1)=1,CONST(HHV(H,0)),CONST(LLV(L,0)),0,-1),COLORWHITE;}
{用文字来描述空间位置,便于快速识别}
DRAWTEXT(CURRBARSCOUNT=1,最低点,'          最低点位'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间1,'           低位一区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间2,'           低位二区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间3,'           低位三区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间4,'           中位四区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间5,'           中位五区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间6,'           中位六区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间7,'           高位七区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间8,'           高位八区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间9,'           高位九区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,最高点,'          最高点位'),COLORWHITE;




3、自用分时主图,几个公式组合而成

本文公式,是用了几个公式组合而成。适用于通达信分时主图( 股民学院: http://www.58188.com )

{分时主图}
IF(MACD.DEA<0,CLOSE,DRAWNULL),COLORRED,LINETHICK9;
X_1:=MAX(DYNAINFO(3),DYNAINFO(5));
X_2:=MIN(DYNAINFO(3),DYNAINFO(6));
X_3:=X_1-X_2;
X_4:=X_2+X_3*7/8;
X_5:=X_2+X_3*0.5/8;
DRAWICON(LONGCROSS(X_5,CLOSE,2),CLOSE,1);
DRAWICON(LONGCROSS(CLOSE,X_4,2),CLOSE,2);
X_6:=DYNAINFO(4);
X_7:=DYNAINFO(5);
X_8:=DYNAINFO(6);
X_9:=DYNAINFO(11);
X_10:=CLOSE;
X_11:=BARSCOUNT(X_10);
X_12:=SUM(VOL*CLOSE,0)/SUM(VOL,0);
X_13:=MA(X_10,X_11);
X_14:=X_13+2*STD(X_10,3);
X_15:=X_13-2*STD(X_10,3);
DRAWICON(CROSS(X_12,X_13),X_12,38);
X_16:=TIME>93000;
X_17:=X_10/REF(CLOSE,1)>1.02;
X_18:=X_10/REF(CLOSE,1)<0.98;
X_19:=(HHV(X_10,X_11)-LLV(X_10,X_11))/X_10<0.05;
X_20:=SMA(VOL,30,1);
X_21:=(X_20-LLV(LLV(X_20,1),30))/(HHV(HHV(X_20,1),30)-LLV(LLV(X_20,1),30))>0.95;
X_22:=X_17 OR X_18;
X_23:=X_22=0 AND X_19 AND X_21 AND CROSS(X_12,X_13);
DRAWTEXT(FILTER(X_23,10),X_12,3),COLORYELLOW;
X_24:=X_22=0 AND X_19 AND X_21 AND CROSS(CLOSE,X_12) AND CROSS(CLOSE,X_13);
DRAWTEXT(FILTER(X_24,10),X_12*0.99,4),COLORRED;
 
FX1:=VOL/CLOSE/3;
FX2:=SUM(IF(FX1>0.2 AND CLOSE>REF(CLOSE,1),FX1,0),0);
FX3:=SUM(IF(FX1>0.2 AND CLOSE<REF(CLOSE,1),FX1,0),0);
FX4:=FX2+FX3;
FX5:=1;
FX6:=FX2/FX3;
FX7:=EMA((-100)*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),4)+100;
FX8:=MAX(DYNAINFO(3),DYNAINFO(5));
FX9:=MIN(DYNAINFO(3),DYNAINFO(6));
FX10:=FX8-FX9;
FX11:=FX9+FX10*7/8;
FX12:=FX9+FX10*0.5/8;
FX13:=SUM(CLOSE*VOL,240)/SUM(VOL,240);
FX14:=BARSCOUNT(CLOSE);
FX15:=MA(CLOSE,FX14);
FX16:=FX15+2*STD(CLOSE,3);
FX17:=FX15-2*STD(CLOSE,3);
FX18:=TIME>93000;
FX19:=CLOSE/REF(CLOSE,1)>1.02;
FX20:=CLOSE/REF(CLOSE,1)<0.98;
FX21:=(HHV(CLOSE,FX14)-LLV(CLOSE,FX14))/CLOSE<0.05;
FX22:=SMA(VOL,30,1);
FX23:=(FX22-LLV(LLV(FX22,1),30))/(HHV(HHV(FX22,1),30)-LLV(LLV(FX22,1),30))>0.95;
FX24:=FX19 OR FX20;
FX25:=FX24=0 AND FX21 AND FX23 AND CROSS(FX13,FX15);
IF(MACD.DEA<0,CLOSE,DRAWNULL),COLORRED,LINETHICK9;
FX26:=SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(VOL*100,BARSCOUNT(CLOSE));
FX27:=EXPMA(CLOSE/FX26,20);
FX28:=EXPMA(CLOSE/FX26,60);
FX29:=EXPMA(CLOSE/FX26,120);
FX30:=1;
1.02,NODRAW;
FX31:=1.03;
FX32:=FX27>FX28 AND FX27>1.003 AND FX28>FX29 AND CLOSE>EXPMA(CLOSE,20) AND EXPMA(CLOSE,10)>EXPMA(CLOSE,20) AND EXPMA(CLOSE,20)>EXPMA(CLOSE,60);
DRAWICON(FX27>FX28 AND FX28>FX29 AND CLOSE>EXPMA(CLOSE,20) AND EXPMA(CLOSE,10)>EXPMA(CLOSE,20) AND EXPMA(CLOSE,20)>EXPMA(CLOSE,60) AND FX27=HHV(FX27,30) AND CROSS(FX27,1.003),CLOSE,25);
DRAWICON(CROSS(FX27,1.02),CLOSE,24);
DRAWICON(CROSS(FX27,1.04),CLOSE,26);
 
FX36:=SUM(IF(CLOSE>REF(CLOSE,1) AND VOL>4000,VOL/1000,0),0);
FX37:=SUM(IF(CLOSE<REF(CLOSE,1) AND VOL>4000,VOL/1000,0),0);
FX38:=SUM(IF(CLOSE>REF(CLOSE,1),VOL/1000,0),0);
FX39:=SUM(IF(CLOSE<REF(CLOSE,1),VOL/1000,0),0);
FX40:=FX38-FX36;
FX41:=FX39-FX37;
FX42:=FX36;
FX43:=FX37;
FX44:=FX40;
FX45:=FX41;
FX46:=FX36-FX37;
FX47:=FX40-FX41;
FX48:=FX38-FX39;
FX49:=CONST(MAX(ABS(FX42),MAX(ABS(FX43),MAX(ABS(FX44),ABS(FX45)))));
地:EMA(FX13,50)/0.97,COLORGREEN,LINETHICK2;
IF(地>REF(地,1),地,DRAWNULL),COLORRED,LINETHICK2;
平衡线:(FX13+地)/2,DOTLINE,COLORGREEN;
FX50:=COUNT(VOL>4000 AND CLOSE>REF(CLOSE,1),0);
黄次数:COUNT(VOL>DYNAINFO(16)*10 AND CLOSE>REF(CLOSE,1),0),NODRAW,COLORYELLOW;
DRAWICON(FX50>REF(FX50,1) AND 黄次数>REF(黄次数,1) AND CROSS(CLOSE,地),CLOSE,7);
DRAWICON(FX40>FX41 AND FX36>FX40 AND FX41>FX37,FX13,38);
 
 
 H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L1:=MIN(DYNAINFO(3),DYNAINFO(6));
 P1:=H1-L1; 阻力:L1+P1*7/8,COLORLIMAGENTA,DOTLINE;
支撑:L1+P1*0.5/8,COLORCYAN,DOTLINE;
中:(支撑+阻力)/2,COLORLIGRAY,POINTDOT,LINETHICK2;
均价:SUM(V*C,0)/SUM(V,0),COLORYELLOW,DOTLINE,NODRAW; 
现价:CLOSE,COLORWHITE,LINETHICK1,NODRAW;
DRAWTEXT(ISLASTBAR  AND 现价,现价,STRCAT('←',CON2STR(现价,2))),COLORYELLOW;STICKLINE(CROSS(支撑,现价),支撑,中,0,-1),COLORYELLOW;
STICKLINE(CROSS(现价,阻力),阻力,中,0,-1),COLORGREEN; DRAWTEXT(LONGCROSS(支撑,现价,2),C*0.9982,'  买'),COLORYELLOW;
DRAWTEXT(LONGCROSS(现价,阻力,2),C*1.0018,'  卖'),COLORCYAN,LINETHICK2;
STICKLINE(C<支撑,支撑,C,1,0),COLORYELLOW;DRAWICON(CROSS(支撑,现价),(支撑-中)/5+支撑,26);
DRAWICON(CROSS(现价,阻力),阻力-(支撑-中)/5,15);
DRAWTEXT(CURRBARSCOUNT=8,阻力+0.003,'顶'),COLORYELLOW,LINETHICK2;
DRAWTEXT(CURRBARSCOUNT=8,支撑-0.003,'底'),COLORGREEN,LINETHICK2;
DRAWTEXT(CURRBARSCOUNT=8,(支撑+阻力)/2,'中'),COLORLIRED,LINETHICK2;
 
成交额:=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);
A6:=(A2+A3);
A7:=IF((ISLASTBAR),((100*A2)/A6),0);A8:=IF((ISLASTBAR),((100*A3)/A6),0);DD1:=1;
AAA1:=STRCAT(STRCAT('机构买',CON2STR((100*A2)/A6,0)),'%');
AAA2:=STRCAT(STRCAT('机构卖',CON2STR((100*A3)/A6,0)),'%');
AAA3:=STRCAT(STRCAT('机构总买入',CON2STR((100*(A2-A3))/A6,0)),'%');
A000:=DRAWTEXT_FIX(DD1=1,0,0.02,0,AAA1);
A001:=DRAWTEXT_FIX(DD1=1,0,0.13,0,AAA2);DRAWTEXT_FIX(DD1=1,0.842,1,0,AAA3),COLORYELLOW;
现手买:BUYVOL*DYNAINFO(7)*100/10000 COLOR0000FF,NODRAW;
现手卖:SELLVOL*DYNAINFO(7)*100/10000 COLOR00FF00,NODRAW;
合:=ABS(现手买)+ABS(现手卖)COLOR80FFFF,NODRAW;
差:=ABS(现手买)-ABS(现手卖)COLOR80FFFF,NODRAW;
MPB1:=ABS(现手买)/合*100; 
MPB2:=ABS(现手卖)/合*100;
TESTSKIP(NOT(现手买 OR 现手卖 OR 合 OR 差 OR MPB1 OR MPB2)!=0);
DRAWRECTREL(595,1000,795,940,RGB(0,128,0));
DRAWRECTREL(595,995,795,945,RGB(0,148,0));
DRAWRECTREL(595,990,795,950,RGB(0,168,0));
DRAWRECTREL(595,985,795,955,RGB(0,188,0));
DRAWRECTREL(595,980,795,960,RGB(0,208,0));
DRAWRECTREL(595,975,795,965,RGB(0,228,0));
DRAWRECTREL(595,970,795,970,RGB(0,248,0));
DRAWRECTREL(595,1000,595+现手买*210/合,940,RGB(128,0,0));
DRAWRECTREL(595,995,595+现手买*210/合,945,RGB(148,0,0));
DRAWRECTREL(595,990,595+现手买*210/合,950,RGB(168,0,0));
DRAWRECTREL(595,985,595+现手买*210/合,955,RGB(188,0,0));
DRAWRECTREL(595,980,595+现手买*210/合,960,RGB(208,0,0));
DRAWRECTREL(595,975,595+现手买*210/合,965,RGB(228,0,0));
DRAWRECTREL(595,970,595+现手买*210/合,970,RGB(248,0,0));
DRAWRECTREL(595+现手买*210/合,940,595+现手买*210/合,1000,RGB(128,0,0));
DRAWRECTREL(795,940,795,1000,RGB(0,0.0,10));DRAWRECTREL(594.8,939.8,594.8,1000,RGB(0,0,10));
DRAWRECTREL(594.8,939.8,594.8,939.8,RGB(0,0,10));
DRAWRECTREL(594.8,1000,594.8,1000,RGB(0,0,10));
DRAWTEXT_FIX(1,0.560,0.89,0,STRCAT(STRCAT('',CON2STR(现手买,1)),'万')),COLORRED;
DRAWTEXT_FIX(1,0.800,0.89,0,STRCAT(STRCAT('',CON2STR(现手卖,1)),'万')),COLORGREEN;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)>0,0.678,0.888,0,STRCAT('  ',STRCAT(CON2STR(差,1),'万'))) COLORRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)<0,0.678,0.888,0,STRCAT('  ',STRCAT(CON2STR(差,1),'万'))) COLORGREEN,LINETHICK2;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)=0,0.678,0.888,0,STRCAT('  ',STRCAT(CON2STR(差,1),'万'))) COLOR80FFFF;
DRAWTEXT_FIX(1,0.800,0.98,0,STRCAT(STRCAT(' ',CON2STR(MPB2,1)),'%')),COLORGREEN;
DRAWTEXT_FIX(1,0.560,0.98,0,STRCAT(STRCAT('',CON2STR(MPB1,1)),'%')),COLORRED;
 
 
市盈率:=STRCAT('市盈率: ',CON2STR(C/FINANCE(33),2));
市销率:=STRCAT('市销率: ',CON2STR(C/(FINANCE(20)/FINANCE(1)),2));市净率:=STRCAT('市净率: ',CON2STR(C/FINANCE(34),2));
净资收益率:=STRCAT('净资收益率: ',CON2STR(FINANCE(33)/FINANCE(34)*100,2));毛利率:=STRCAT('毛利率: ',CON2STR((FINANCE(20)-FINANCE(21))/FINANCE(20)*100,2));
净利润率:=STRCAT('净利润率 ',CON2STR(FINANCE(30)/FINANCE(20)*100,2));主营利润率:=STRCAT('主营利润率 ',CON2STR(FINANCE(23)/FINANCE(20)*100,2));利润同比:=STRCAT('利润同比: ',CON2STR(FINANCE(43),2));收入同比:=STRCAT('收入同比: ',CON2STR(FINANCE(44),2));X1:=(FINANCE(11)-FINANCE(15))/FINANCE(10)*1.2;X2:=(FINANCE(31)+FINANCE(17))/FINANCE(10)*1.4;X3:=FINANCE(23)/FINANCE(10)*3.3;X4:=FINANCE(19)/FINANCE(15)*0.6;X5:=FINANCE(20)/FINANCE(15)*0.999;
Z值:=X1+X2+X3+X4+X5;预警:=IF(Z值<1.2,'重警',IF(Z值>=1.2 AND Z值<2.6,'轻警','无警'));财务预警:=STRCAT('财务预警: ',STRCAT(预警,STRCAT('-Z值: ',CON2STR(Z值,3))));
优质资产率:=STRCAT(' 优质资产率: ',CON2STR((FINANCE(19)-FINANCE(22)-FINANCE(27))/FINANCE(19),2));现金负债比:=STRCAT(' 现金负债比: ',CON2STR(FINANCE(25)/FINANCE(15),3));
财务系数:=STRCAT('风险系数: ',STRCAT(STRCAT(财务预警,优质资产率),现金负债比));DRAWTEXT_FIX(ISLASTBAR,0.222,0.96,0,财务系数),COLORLIBLUE;D1:=YEAR AND MONTH AND DAY;AA1:=STRCAT(CON2STR(YEAR,0),'年');
AA2:=STRCAT(CON2STR(MONTH,0),'月');AA3:=STRCAT(CON2STR(DAY,0),'日');AA4:=STRCAT('星期',IF(WEEKDAY=1,'一',IF(WEEKDAY=2,'二',IF(WEEKDAY=3,'三',IF(WEEKDAY=4,'四',IF(WEEKDAY=5,'五',IF(WEEKDAY=6,'六','日')))))));
AA:=STRCAT(STRCAT(STRCAT(AA1,AA2),STRCAT(AA3,AA4)),'');DRAWTEXT_FIX(D1,0.888,0.001,0,AA),COLORLIGRAY;
 
MZ0:=(BARSLAST(((HOUR=9) AND (MINUTE=31)))+1);
上穿分时:IF(((SETCODE<2) AND (CONST(MZ0)<241)),CONST(IF((TIME<1000),HHV(CLOSE,0),SUM((IF((TIME=1000),1,0)*HHV(CLOSE,0)),0))),DRAWNULL),LINETHICK2,COLORLIRED;
底支:IF(((SETCODE<2) AND (CONST(MZ0)<241)),CONST(IF((TIME<1000),HHV(CLOSE,0),SUM((IF((TIME=1000),1,0)*LLV(CLOSE,0)),0))),DRAWNULL),LINETHICK2,COLORLIGREEN;
STICKLINE(TIME=931 OR TIME=1000,上穿分时,底支,0,-1),COLORLIBLUE;分时上突:=CROSS(C,上穿分时);上突:=C<上穿分时 AND 上穿分时>底支;DRAWICON(分时上突,C,5);股价支撑线:=MA(CLOSE,20);
底价线:股价支撑线-2*STD(CLOSE,20),NODRAW,COLORMAGENTA,LINETHICK2;DRAWTEXT_FIX(1,0.0001,0.00,0,STRCAT(STRCAT('【今日强势有效突破】',CON2STR(上穿分时,2)),' 元 买入稳赚')),COLORWHITE,LINETHICK1;
DRAWTEXT_FIX(1,0.5001,0.00,0,STRCAT(STRCAT('【底部得到有效支撑】',CON2STR(底支,2)),' 元 可以参考')),COLORLIRED,LINETHICK1;
 
所属板块:=STRCAT('【所属板块】',STRCAT(STRCAT(STRCAT('     [行业]—',HYBLOCK),STRCAT('     [地域]—',DYBLOCK)),STRCAT('     [概念]—',GNBLOCK)));
DRAWTEXT_FIX(ISLASTBAR,0.005,0.05,0,所属板块),COLORWHITE;
{题材数据}
DRAWTEXT_FIX(ISLASTBAR,0.005,0.15,0,FGBLOCK),COLORWHITE;
 
E:=EMA(C,50),COLORRED,LINETHICK2;
 
开盘:='辅助公式.开盘价#DAY',DOTLINE,COLORWHITE;
 
DRAWTEXT_FIX(1,0.5,0.87,0,DYBLOCK)COLORMAGENTA;
 
万手额:=C*100;
DRAWTEXT_FIX(1,0.6,0.87,0,STRCAT('',STRCAT(VAR2STR(万手额,0),'万')))COLORGRAY;
 
成交额1:=DYNAINFO(10)/100000000;
DRAWTEXT_FIX(1,0.75,0.76,0,STRCAT('额:',STRCAT(VAR2STR(成交额1,2),'亿')))COLORCYAN;
 
开盘金额:=DYNAINFO(15)/10000;
DRAWTEXT_FIX(1,0.75,0.69,0,STRCAT('开:',STRCAT(VAR2STR(开盘金额,0),'万')))COLORCYAN;
 
流:=FINANCE(46)*C/100000000;
DRAWTEXT_FIX(1,0.75,0.83,0,STRCAT('流:',STRCAT(VAR2STR(流,2),'亿')))COLORLIGREEN;
 
换手Z:=成交额1/流*100,NODRAW;
DRAWTEXT_FIX(1,0.75,0.89,0,STRCAT('换:',STRCAT(VAR2STR(换手Z,2),'%')))COLORLIGREEN;

上一篇:通达信源码精选:五彩K线,立体3D K线,自动黄金分割

下一篇:通达信公式下载:神渔低开,牛熊线 买卖参考