通达信公式源码概况:

指标类别:通达信公式

授权方式: 免费版

指标评级: ★★★★★

指标分类: 策略

画线方法: 副图

一、通达信机智资金流指标公式

  

小单买:=1-BIGORDER(1,1)*V/CAPITAL;  

小单卖:=1-BIGORDER(2,1)*V/CAPITAL;  

散户净买:=(小单买-小单卖)*100;  

散户:sum(散户净买,1),linethick0,COLORGREEN;  

中户买:=BIGORDER(1,1)*V/CAPITAL-BIGORDER(1,2)*V/CAPITAL;  

中户卖:=BIGORDER(2,1)*V/CAPITAL-BIGORDER(2,2)*V/CAPITAL;  

中户净买:=(中户买-中户卖)*100;  

中户:sum(中户净买,1),linethick0,colorf00ff0;  

大户买:=BIGORDER(1,2)*V/CAPITAL-BIGORDER(1,3)*V/CAPITAL;  

大户卖:=BIGORDER(2,2)*V/CAPITAL-BIGORDER(2,3)*V/CAPITAL;  

大户净买:=(大户买-大户卖)*100;  

大户:sum(大户净买,1),linethick0,colorf0f000;  

机构买:=BIGORDER(1,3)*V/CAPITAL;  

机构卖:=BIGORDER(2,3)*V/CAPITAL;  

机构净买:=(机构买-机构卖)*100;  

超大:sum(机构净买,1),linethick0,color3399FF;  

大单买:=BIGORDER(1,2)*V/CAPITAL;  

大单卖:=BIGORDER(2,2)*V/CAPITAL;  

主力:(大单买-大单卖)*100,linethick0,COLORRED;  

散户增减:=散户-ref(散户,3);  

中户增减:=中户-ref(中户,5);  

大户增减:=大户-ref(大户,3);  

超大增减:=超大-ref(超大,10);  

主力增减:=主力-ref(主力,5);  

S3:=ref(散户,3);  

Z3:=ref(中户,3);  

D3:=ref(大户,3);  

F3:=ref(超大,3);  

J3:=ref(主力,3);  

S5:=ref(散户,5);  

Z5:=ref(中户,5);  

D5:=ref(大户,5);  

F5:=ref(超大,5);  

J5:=ref(主力,5);  

S10:=ref(散户,10);  

Z10:=ref(中户,10);  

D10:=ref(大户,10);  

F10:=ref(超大,10);  

J10:=ref(主力,10);  

S20:=ref(散户,20);  

Z20:=ref(中户,20);  

D20:=ref(大户,20);  

F20:=ref(超大,20);  

J20:=ref(主力,20);  

BL3:=400/MAX(S3,Z3,D3,F3,J3);  

BL5:=400/MAX(S5,Z5,D5,F5,J5);  

BL10:=400/MAX(S10,Z10,D10,F10,J10);  

BL20:=400/MAX(S20,Z20,D20,F20,J20);  

S3B:=999-S3*BL3;  

Z3B:=999-Z3*BL3;  

D3B:=999-D3*BL3;  

F3B:=999-F3*BL3;  

J3B:=999-J3*BL3;  

S5B:=999-S5*BL5;  

Z5B:=999-Z5*BL5;  

D5B:=999-D5*BL5;  

F5B:=999-F5*BL5;  

J5B:=999-J5*BL5;  

S10B:=999-S10*BL10;  

Z10B:=999-Z10*BL10;  

D10B:=999-D10*BL10;  

F10B:=999-F10*BL10;  

J10B:=999-J10*BL10;  

S20B:=999-S20*BL20;  

Z20B:=999-Z20*BL20;  

D20B:=999-D20*BL20;  

F20B:=999-F20*BL20;  

J20B:=999-J20*BL20;  

{画直方图}  

DRAWRECTREL(10,S3B,40,999,RGB(0,255,0));  

DRAWRECTREL(30,Z3B,60,999,RGB(180,0,100));  

DRAWRECTREL(50,D3B,80,999,RGB(0,0,255));  

DRAWRECTREL(70,F3B,100,999,RGB(180,100,0));  

DRAWRECTREL(90,J3B,120,999,RGB(255,0,0));  

DRAWRECTREL(140,S5B,170,999,RGB(0,255,0));  

DRAWRECTREL(160,Z5B,190,999,RGB(180,0,100));  

DRAWRECTREL(175,D5B,210,999,RGB(0,0,255));  

DRAWRECTREL(200,F5B,230,999,RGB(180,100,0));  

DRAWRECTREL(220,J5B,250,999,RGB(255,0,0));  

DRAWRECTREL(270,S10B,300,999,RGB(0,255,0));  

DRAWRECTREL(290,Z10B,320,999,RGB(180,0,100));  

DRAWRECTREL(310,D10B,340,999,RGB(0,0,255));  

DRAWRECTREL(330,F10B,360,999,RGB(180,100,0));  

DRAWRECTREL(350,J10B,380,999,RGB(255,0,0));  

DRAWRECTREL(400,S20B,430,999,RGB(0,255,0));  

DRAWRECTREL(420,Z20B,450,999,RGB(180,0,100));  

DRAWRECTREL(440,D20B,470,999,RGB(0,0,255));  

DRAWRECTREL(460,F20B,490,999,RGB(180,100,0));  

DRAWRECTREL(480,J20B,510,999,RGB(255,0,0));  

DRAWTEXTREL(80,5,'散户'),color00ff00;  

DRAWTEXTREL(160,5,'中户'),colorf00ff0;  

DRAWTEXTREL(240,5,'大户'),colorffaa66;  

DRAWTEXTREL(320,5,'超大'),color0099ff;  

DRAWTEXTREL(400,5,'主力'),colorred;  

DRAWTEXTREL(30,70,'今日'),colorddffff;  

DRAWTEXTREL(80,70,NUMTOSTRN(散户,2)),color00ff00;  

DRAWTEXTREL(160,70,NUMTOSTRN(中户,2)),colorf00ff0;  

DRAWTEXTREL(240,70,NUMTOSTRN(大户,2)),colorffaa66;  

DRAWTEXTREL(320,70,NUMTOSTRN(超大,2)),color0099ff;  

DRAWTEXTREL(400,70,NUMTOSTRN(主力,2)),colorred;  

DRAWTEXTREL(30,140,'3日'),colorddffff;  

DRAWTEXTREL(80,140,NUMTOSTRN(S3,2)),color00ff00;  

DRAWTEXTREL(160,140,NUMTOSTRN(Z3,2)),colorf00ff0;  

DRAWTEXTREL(240,140,NUMTOSTRN(D3,2)),colorffaa66;  

DRAWTEXTREL(320,140,NUMTOSTRN(F3,2)),color0099ff;  

DRAWTEXTREL(400,140,NUMTOSTRN(J3,2)),colorred;  

DRAWTEXTREL(30,210,'5日'),colorddffff;  

DRAWTEXTREL(80,210,NUMTOSTRN(S5,2)),color00ff00;  

DRAWTEXTREL(160,210,NUMTOSTRN(Z5,2)),colorf00ff0;  

DRAWTEXTREL(240,210,NUMTOSTRN(D5,2)),colorffaa66;  

DRAWTEXTREL(320,210,NUMTOSTRN(F5,2)),color0099ff;  

DRAWTEXTREL(400,210,NUMTOSTRN(J5,2)),colorred;  

DRAWTEXTREL(30,280,'10日'),colorddffff;  

DRAWTEXTREL(80,280,NUMTOSTRN(S10,2)),color00ff00;  

DRAWTEXTREL(160,280,NUMTOSTRN(Z10,2)),colorf00ff0;  

DRAWTEXTREL(240,280,NUMTOSTRN(D10,2)),colorffaa66;  

DRAWTEXTREL(320,280,NUMTOSTRN(F10,2)),color0099ff;  

DRAWTEXTREL(400,280,NUMTOSTRN(J10,2)),colorred;  

DRAWTEXTREL(30,350,'20日'),colorddffff;  

DRAWTEXTREL(80,350,NUMTOSTRN(S20,2)),color00ff00;  

DRAWTEXTREL(160,350,NUMTOSTRN(Z20,2)),colorf00ff0;  

DRAWTEXTREL(240,350,NUMTOSTRN(D20,2)),colorffaa66;  

DRAWTEXTREL(320,350,NUMTOSTRN(F20,2)),color0099ff;  

DRAWTEXTREL(400,350,NUMTOSTRN(J20,2)),colorred;  

DRAWTEXTREL(5,800,'3'),COLORRED;  

DRAWTEXTREL(3,900,'日'),COLORRED;  

DRAWTEXTREL(135,800,'5'),COLORRED;  

DRAWTEXTREL(130,900,'日'),COLORRED;  

DRAWTEXTREL(260,800,'10'),COLORRED;  

DRAWTEXTREL(260,900,'日'),COLORRED;  

DRAWTEXTREL(390,800,'20'),COLORRED;  

DRAWTEXTREL(390,900,'日'),COLORRED;  

一日资金流入:=amount*BIGORDER(1,2)/10000;  

一日资金流出:=amount*BIGORDER(2,2)/10000;  

资金流:=一日资金流入-一日资金流出;  

进出【万元】:资金流,color3d,coloryellow;  

IF资金流<0THEN  

DRAWFLAGTEXT(1,资金流,'当日资金流出'+STR(ABS(资金流))+'【万元】↓');  

ELSE  

DRAWFLAGTEXT(1,资金流,'当日资金流入'+STR(ABS(资金流))+'【万元】↑'),COLORRED;  

流进:BIGORDER(1,2)*V/CAPITAL,LINETHICK0,COLORRED;  

流出:BIGORDER(2,2)*V/CAPITAL,LINETHICK0,COLORGREEN;  

FILLRGN(流进,流出,流进>流出,RGB(255,0,0)),COLOR000000;  

FILLRGN(流出,流进,流进<流出,RGB(0,255,0)),COLOR000000  

VAR3:=(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100;  

VAR4:=(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100;  

VAR5:=(CLOSE-MA(CLOSE,32))/MA(CLOSE,32)*100;  

VAR6:=(VAR3+VAR4+VAR5)/3;  

VAR7:=EMA(VAR6,5);  

指标:EMA(EMA(VAR3,5),5)*3,COLORSTICK;  

VAR8:=IF(VAR6<=-20,10,0);  

VAR9:=HHV(VAR8,10);  

STICKLINE(VAR8=10,20,10,5,0),COLOR6666FF;  

VARA:=IF(VAR9ANDCROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0);  

K:EMA(VAR7,5)*2, COLORFF00FF;  

D:EMA(K,5), COLORWHITE;  

J:K*3-D*2,COLORYELLOW;  

VARB:=BETWEEN(CLOSE,MA(CLOSE,3),MA(CLOSE,5))ANDJ>10;  

换手:VOL/CAPITAL*100, COLORGREEN;  

成交〖万手〗:VOL/10000,COLORYELLOW;  

DRAWTEXT(VAR8=10ANDFILTER(VAR8=10,5),-10{15},'接近底部'),LINETHICK1,COLORYELLOW;  

STICKLINE(VAR8=10ANDFILTER(VAR8=10,5),-1.6{20},-10,5,0),COLORYELLOW;  

DRAWTEXT(VARA=20,15,'底部'),LINETHICK1,COLORWHITE;  

STICKLINE((VARA=20),0,10,5,0),COLORWHITE;  

VARC:=(ZIG(3,5)>REF(ZIG(3,5),1))AND(REF(ZIG(3,5),1)<=REF(ZIG(3,5),2))AND(REF(ZIG  

(3,5),2)<=REF(ZIG(3,5),3));  

VARD:=(ZIG(3,5)<REF(ZIG(3,5),1))AND(REF(ZIG(3,5),1)>=REF(ZIG(3,5),2))AND(REF(ZIG  

(3,5),2)>=REF(ZIG(3,5),3));  

STICKLINE((VARC=1),(-14),0,4,0),COLOR0000FF;  

DRAWTEXT((VARC=1),(-14),'买'),COLOR0000FF;  

STICKLINE((VARD=1),14,0,4,0),COLOR00FF00;  

DRAWTEXT((VARD=1),18,'卖'),COLOR00FF00;  

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

VARF:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA  

((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);  

VAR10:=100-3*SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA  

((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);  

VAR11:=VARF<REF(VAR10,1)ANDVOL>REF(VOL,1)ANDCLOSE>REF(CLOSE,1);  

DRAWTEXT(VAR11ANDCOUNT(VAR11,30)=1,15,'大资金活动'),LINETHICK1,COLORFF00FF;  

STICKLINE(VAR11ANDCOUNT(VAR11,30)=1,1,10,5,0),COLORFF00FF;  

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

VAR13:=(VAR12-MA(VAR12,14))/(0.015*AVEDEV(VAR12,14));  

VAR14:=(VAR12-MA(VAR12,70))/(0.015*AVEDEV(VAR12,70));  

VAR15:=IF(VAR13>=150ANDVAR13<200ANDVAR14>=150ANDVAR14<200,10,0);  

VAR16:=IF(VAR13<=-150ANDVAR13>-200ANDVAR14<=-150ANDVAR14>-200,-10,VAR15);  

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

VAR18:=100-ABS(VAR17);  

VAR19:=IF(VAR18<90,VAR18,100);  

VAR1A:=IF(VARE>0,VARE,0);  

VAR1B:=IF(VAR14>=200ANDVAR13>=150,15,IF(VAR14<=-200ANDVAR13<=-150,-15,VAR16))+60;  

VAR1C:=VAR1A>48ANDVAR1B>60ANDVAR19<100;  

DRAWTEXT(VAR1CANDCOUNT(VAR1C,30)=1,15,'大笔出货'),LINETHICK1,COLORFFCC66;  

STICKLINE(VAR1CANDCOUNT(VAR1C,30)=1,0,10,5,0),COLORFFCC66;  

image.png

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

N赋值:10

统计N日中满足收盘价>1日前的收盘价*1.098的天数>=1 AND 最近2日收盘价连跌

每日通达信公式解答:

公式编写要求:

N天内涨停出现二连阴的选股公式。

公式编写方法:

N:=10;
COUNT(C>REF(C,1)*1.098,N)>=1 AND DOWNNDAY(C,2);

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