通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
A:=IF((CLOSE 126.32),(AMOUNT)/(100000),VOL);
主力:MA(A,4),LINETHICK0,COLORYELLOW;
游资:MA(A,8),LINETHICK0,COLOR00FF00;
大户:MA(A,16),LINETHICK0,COLORRED;
:MA(A,32),LINETHICK0,COLORF0F000;
主比:ABS(((主力)/(主力+游资+大户+散户))*(100)),LINESTICK,COLORYELLOW;
游比:ABS(((游资)/(主力+游资+大户+散户))*(100)),LINESTICK,COLOR00FF00;
大比:ABS(((大户)/(主力+游资+大户+散户))*(100)),LINESTICK,COLORRED;
散比:ABS(((散户)/(主力+游资+大户+散户))*(100)),LINESTICK,COLORF0F000;
警戒线:MA(A,180),COLORFF66FF,LINETHICK1;
STICKLINE((主力 0),0,主力,3,0),COLOR009CFF;
STICKLINE((主力 0),0,主力,2.8,0),COLOR009CFF;
STICKLINE((主力 0),0,主力,2.5,0),COLOR00C0FF;
STICKLINE((主力 0),0,主力,1.5,0),COLOR00D1FF;
STICKLINE((主力 0),0,主力,1,0),COLOR00EAFF;
STICKLINE((主力 0),0,主力,0.7,0),COLORYELLOW;
STICKLINE((游资 0),0,游资,3,0),COLOR00C100;
STICKLINE((游资 0),0,游资,2.8,0),COLOR00CA00;
STICKLINE((游资 0),0,游资,2.5,0),COLOR00D300;
STICKLINE((游资 0),0,游资,1.5,0),COLOR00DB00;
STICKLINE((游资 0),0,游资,1,0),COLOR00EA00;
STICKLINE((游资 0),0,游资,0.7,0),COLORGREEN;
STICKLINE((大户 0),0,大户,3,0),COLOR1020AA;
STICKLINE((大户 0),0,大户,2.8,0),COLOR1020BB;
STICKLINE((大户 0),0,大户,2.5,0),COLOR1020CC;
STICKLINE((大户 0),0,大户,1.5,0),COLOR1020DD;
STICKLINE((大户 0),0,大户,1,0),COLOR1020EE;
STICKLINE((大户 0),0,大户,0.7,0),COLORRED;
STICKLINE((散户 0),0,散户,3,0),COLORFF7700;
STICKLINE((散户 0),0,散户,2.8,0),COLORFF8800;
STICKLINE((散户 0),0,散户,2.5,0),COLORFF9900;
STICKLINE((散户 0),0,散户,1.5,0),COLORFFAA00;STICKLINE((散户 0),0,散户,1,0),COLORFFBB00;
STICKLINE((散户 0),0,散户,0.7,0),COLORLIBLUE;
N:=3;
M:=6;
VARS:=100;
VARZQ:=30;
RSV:=(CLOSE-LLV(LOW,VARZQ))/(HHV(HIGH,VARZQ)-LLV(LOW,VARZQ))*VARS;
K:=SMA(RSV,5,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
HS:=VOL/CAPITAL;
SH:=(HHV(HIGH,VARZQ)-CLOSE)/(HHV(HIGH,VARZQ)-LLV(LOW,VARZQ))*VARS-10;
JG:=(CLOSE-LLV(LOW,VARZQ))/(HHV(HIGH,VARZQ)-LLV(LOW,VARZQ))*VARS;
GF:=SMA(JG,13,8);
DDJG:=JG-REF(JG,1);
DTJG:=HS*DDJG*100/4;
VARZLSCJG:=(90+SUM(DTJG,0));
主力:SUM(DTJG,0)+90,LINETHICK1,COLORRED;
STICKLINE(DTJG 0,VARZLSCJG,VARZLSCJG+DTJG,1,0),COLORRED;
STICKLINE(DTJG 0,VARZLSCJG+DTJG,VARZLSCJG,1,0),COLORGREEN;
DDSH:=SH-REF(SH,1);
DTSH:=HS*DDSH*100/4;
VARZLSCSH:=(60+SUM(DTSH,0));
散户筹码:SUM(DTSH,0)+60,LINETHICK1,COLORWHITE;
STICKLINE(DTSH 0,VARZLSCSH,VARZLSCSH+DTSH,1,0),COLORRED;
STICKLINE(DTSH 0,VARZLSCSH+DTSH,VARZLSCSH,1,0),COLORGREEN;
DDGF:=GF-REF(GF,1);
DTGF:=HS*DDGF*100/4;
VARZLSCGF:=(30+SUM(DTGF,0));
跟风筹码:SUM(DTGF,0)+30,LINETHICK1,COLORCYAN;
STICKLINE(DTGF 0,VARZLSCGF,VARZLSCGF+DTGF,1,0),COLORRED;
STICKLINE(DTGF 0,VARZLSCGF+DTGF,VARZLSCGF,1,0),COLORGREEN;
ZF:=H-L;
CB:=AMOUNT/VOL/100;
DV1:=IF(ZF 0ANDC CB,((H-C)/(H-CB))*((H-C)/(H-CB))*((H-CB)/ZF*VOL),0);
UV1:=IF(ZF 0ANDC CB,VOL-DV1,0);
UV2:=IF(ZF 0ANDC CB,((C-L)/(CB-L))*((C-L)/(CB-L))*((CB-L)/ZF*VOL),0);
DV2:=IF(ZF 0ANDC CB,VOL-UV2,0);
UV3:=IF(ZF=0ANDC REF(C,1),VOL,0);
DV3:=IF(ZF=0ANDC REF(C,1),VOL,0);
UV:=UV1+UV2+UV3;
DV:=DV1+DV2+DV3;
CBX:((UV-DV)/VOL)/CAPITAL*1000000,LINETHICK0;
STICKLINE(CBX 0,0,CBX,3,0),COLOR041CEC;
STICKLINE(CBX 0,0,CBX,3,0),COLOR0F26FB;
STICKLINE(CBX 0,0,CBX,2,0),COLOR2439FB;
STICKLINE(CBX 0,0,CBX,1,0),COLOR485AFB;
STICKLINE(CBX 0,0,CBX,0,0),COLOR6473FB;
STICKLINE(CBX 0,0,CBX,3,0),COLORCD690E;
STICKLINE(CBX 0,0,CBX,3,0),COLOREF7B12;
STICKLINE(CBX 0,0,CBX,2,0),COLORF08728;
STICKLINE(CBX 0,0,CBX,1,0),COLORF29540;
STICKLINE(CBX 0,0,CBX,0,0),COLORF5A963;
CBX1:EMA(SUM(CBX,NUM),2),COLORMAGENTA;
CBX2:EMA(CBX1,SHORT),COLORYELLOW;
CBX3:EMA(CBX1,LONG),COLORGREEN;
COST(0.02);COST(5),DOTLINE;COST(10),DOTLINE;COST(15),DOTLINE;COST(20),DOTLINE;
COST(25),DOTLINE;COST(30),DOTLINE;COST(35),DOTLINE;COST(40),DOTLINE;COST(45),DOTLINE;
COST(50),DOTLINE;COST(55),DOTLINE;COST(60),DOTLINE;COST(65),DOTLINE;COST(70),DOTLINE;
COST(75),DOTLINE;COST(80),DOTLINE;COST(85),DOTLINE;COST(90),DOTLINE;COST(95),DOTLINE;
COST(99.99);DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
VAR1:=EMA(EMA(CLOSE,9),9);
控盘:=(VAR1-REF(VAR1,1))/REF(VAR1,1)*1000;
STICKLINE(控盘 0,控盘,0,1,0),COLORWHITE;
A10:=CROSS(控盘,0);
无庄控盘:IF(控盘 0,控盘,0),COLORWHITE;
开始控盘:IF(A10,5,0),LINETHICK1,COLORYELLOW;
STICKLINE(控盘 REF(控盘,1)AND控盘 0,控盘,0,1,0),COLORRED;
有庄控盘:IF(控盘 REF(控盘,1)AND控盘 0,控盘,0),COLORRED;
VAR2:=100*WINNER(CLOSE*0.95);
STICKLINE(VAR2 50ANDCOST(85) CLOSEAND控盘 0,控盘,0,1,0),COLORFF00FF;
高度控盘:IF(VAR2 50ANDCOST(85) CLOSEAND控盘 0,控盘,0),COLORFF00FF;
STICKLINE(控盘 REF(控盘,1)AND控盘 0,控盘,0,1,0),COLOR00FF00;
主力出货:IF(控盘 REF(控盘,1)AND控盘 0,控盘,0),COLOR00FF00;
公式解读:
[源码注释]通达信公式动态公式解读A1赋值:收盘价的5日简单移动平均
A2赋值:收盘价的10日简单移动平均
A3赋值:收盘价的20日简单移动平均
A4赋值:收盘价的30日简单移动平均
A5赋值:A1 A2 AND A2 A3 AND A3 A4
B1赋值:1日前的收盘价*1.015
B2赋值:1日前的收盘价*0.985
输出XG:收盘价位于B1和B2之间 AND A5 AND 收盘价位于A1和A2之间
STICKLINE(C,90,90,0.9,0.9),COLOR883333;
STICKLINE(C,10,10,0.9,0.9),COLOR883333;
散户:=100*(HHV(HIGH,60)-CLOSE)/(HHV(HIGH,60)-LLV(LOW,60));
RSV:=(CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100;
RSV1:=(C-MA(C,4))/MA(C,4)*100;
VAR2:=REF(LOW,1);
VAR3:=SMA(ABS(LOW-VAR2),3,1)/SMA(MAX(LOW-VAR2,0),3,1)*100;
VAR4:=EMA(IF(CLOSE*1.3,VAR3*10,VAR3/10),3);
VAR5:=LLV(LOW,30);
VAR6:=HHV(VAR4,30);
VAR7:=IF(MA(CLOSE,58),1,0);
VAR8:=EMA(IF(LOW =VAR5,(VAR4+VAR6*2)/2,0),3)/618*VAR7;
VAR9:=IF(VAR8 100,100,VAR8);
K:=SMA(RSV,5,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
主力:=EMA(J,6),COLORYELLOW;
AA3:=(HHV(HIGH,21)-CLOSE)/(HHV(HIGH,21)-LLV(LOW,21))*100-10;
AA4:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*100;
AA5:=SMA(AA4,13,8);
走势:=CEILING(SMA(AA5,13,8)),COLORRED,LINETHICK2;
AA6:=SMA(AA3,21,8);
买观注:STICKLINE(走势-AA6 -65,0,7,15,1);
DRAWICON(FILTER(J REF(J,1)AND走势 =REF(走势,1)AND走势 25,5),走势,1);
卖观注:STICKLINE(走势-AA6 85,98,90,15,1),COLORFFFF00;
DRAWICON(FILTER(J REF(J,1)AND走势 =REF(走势,1)ANDJ 85,5),J,2);
吸筹:STICKLINE(VAR9 -120,50,50+(VAR9/2),8,1),COLORRED;
CDMA:EMA(EMA(RSV1,7),7)*8,NODRAW,COLORWHITE;
STICKLINE(CDMA =0ANDCDMA =REF(CDMA,1),50,50+CDMA,2.5,0),COLORDD55CC;
STICKLINE(CDMA =0ANDCDMA =REF(CDMA,1),50,50+CDMA,2.5,1),COLORDD55CC;
STICKLINE(CDMA =0ANDCDMA =REF(CDMA,1),50,50+CDMA,2.5,1),COLOR00D080;
STICKLINE(CDMA =0ANDCDMA =REF(CDMA,1),50,50+CDMA,2.5,0),COLOR00D080;
快线:(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100,LINETHICK2,COLOR333333;
散户线:散户,COLORFFFFFF,LINETHICK1;
主力线:主力,COLORYELLOW;
走势线:走势,COLORRED,LINETHICK2;
DRAWTEXT(ISLASTBAR,散户线, ←散户线 ),COLORFFFFFF;
DRAWTEXT(ISLASTBAR,主力线, ←主力线 ),COLORYELLOW;
VAR1:=(HHV(HIGH,13)-CLOSE)/(HHV(HIGH,13)-LLV(LOW,13))*200-110;
散户:SMA(VAR1,8,1);
VAR2:=(CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))*200-100;
主力:SMA(SMA(VAR2,5,1),3,1);
VARF:=(2*CLOSE+HIGH+LOW)/4;
VAR12:=EMA((VARF-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100,6);
VAR13:=EMA(0.667*REF(VAR12,1)+0.333*VAR12,4);
CD1:IF(IF(COUNT(CLOSE REF(CLOSE,1),8)/8 0.3ANDCOUNT(VAR12 VAR13,3)ANDREF(LOW,1)=LLV(LOW,120)ANDCLOSE OPEN,1,0),52,0),COLORFF00FF;
VAR18:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);
CD2:IF(CROSS(VAR18,3),52,0),COLORRED;
VAR1:=1;
VAR55:=LLV(LOW,8);
VAR66:=HHV(HIGH,8);
VAR77:=(VAR66-VAR55)/10;
VAR88:=SMA((CLOSE-VAR55)/VAR77,20,1);
VARA:=3*VAR88-2*SMA(VAR88,15,1);
散户筹码集中度:(10-VARA)*VAR1*6,colorgreen,LINETHICK2;
机构筹码集中度:EMA(WINNER(C)*70,3),LINETHICK2,colorred;
主力筹码:10*WINNER(CLOSE*0.9)*8,colorcyan;
十天主力筹码:EMA(主力筹码,10),LINETHICK2,coloryellow;
VAR100:=(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*(10);
增减力度:VAR100*6,colormagenta,LINETHICK2;
70,colorgreen;
0,coloryellow;
X4:=EMA(C,6);
斜率6:(X4-REF(X4,1))/REF(X4,1)*100,LINETHICK0;
X5:=EMA(C,12);
斜率12:(X5-REF(X5,1))/REF(X5,1)*100,LINETHICK0;
X6:=EMA(C,18);
斜率18:(X6-REF(X6,1))/REF(X6,1)*100,LINETHICK0;
VARE:=SMA(MAX(CLOSE-REF(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),6,1)*100;
TD:IF(CROSS(84,VARE),(-1)*VARE,0),COLORGREEN;
HSL:=100*VOL/CAPITAL;
TD2:IF(REF(0.34*HSL,1) 4ANDREF(0.34*HSL,1) 4.2,-60,0),COLORF0F000;
0,COLOR888888;
DRAWTEXT(ISLASTBAR,走势线, ←走势线 ),COLORRED;
关注低买:IF(90 散户ANDCROSS(90,散户),98,0),COLORMAGENTA,STICK,NODRAW;
{高抛低吸:IF(散户 10ANDCROSS(10,散户),20,0),COLORGREEN,STICK,NODRAW;}
风险:COUNT( RSI.RSI1 (6,12,24) 80,3)=3ANDCROSS( RSI.RSI2 (6,12,24),79.5),NODRAW;
观注顶:(散户 8AND主力 90AND走势 90ANDCDMA =REF(CDMA,1)AND散户线),COLORGREEN,NODRAW;
DRAWTEXT(观注顶,-1, ◆ ),COLORGREEN;
DRAWTEXT(风险,95, ←风险 ),COLOR00FFFF;
STICKLINE(关注低买,0,100,0,-1),COLORMAGENTA;
{STICKLINE(高抛低吸,0,100,0,-1),COLORGREEN;};
VAR1:=(CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100;
VAR2:=SMA(VAR1,2,1);
VAR3:=SMA(VAR2,2,1);
VAR4:=VOL/CAPITAL*34;
VAR5:=REF(VAR4,1);
大户减仓:VAR5 50ANDVAR5 4.2,LINETHICK3,STICK,COLOR00FF00;
机构出货:VAR3 89.5ANDVAR2 91,LINETHICK3,STICK,COLORFFFFFF;
主力出货:VAR3 88.5ANDVAR2 94.6,LINETHICK3,STICK,COLORFFFF00;
公式编写要求:
均线5日、10日、20、30成多头排列,估价在5日线和10日线之间,涨跌幅在1.5%之内的公式。
公式编写方法:
A1:=MA(C,5);
A2:=MA(C,10);
A3:=MA(C,20);
A4:=MA(C,30);
A5:=A1 A2ANDA2 A3ANDA3
B1:=REF(C,1)*1.015;
B2:=REF(C,1)*0.985;
XG:BETWEEN(C,B1,B2)ANDA5ANDBETWEEN(C,A1,A2);