通达信指标公式源码概况:指标类别: 通达信指标公式授权方式: 免费版指标评级: ★★★★★指标分类: 策略画线方法: 副图一、通达信主力线的指标公式 {短线: KDJ.J (5,3,3),COLORAAAAAA;} 散户线: 100*(HHV(HIGH,60)-CLOSE)/(HHV(HIGH,60)-LLV(LOW,60)),LINETHICK2,COLOR00FF00; RSV30:=(CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100; K30:=SMA(RSV30,5,1); D30:=SMA(K30,3,1); J30:=3*K30-2*D30;主力线:EMA(J30,6),COLORYELLOW,LINETHICK2; RSV21:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*100; K21:=SMA(RSV21,13,8); 趋势:CEILING(SMA(K21,13,8)),COLORRED,LINETHICK1; 0;20;50;80;100; {N310030M310060} 散户线:100*(HHV(HIGH,M)-CLOSE)/(HHV(HIGH,M)-LLV(LOW,M)),LINETHICK2; RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:=SMA(RSV,5,1); D:=SMA(K,3,1); J:=3*K-2*D; 主力线:EMA(J,6),COLORYELLOW,LINETHICK2; 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); 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,LINETHICK3;二、通达信主力资金线指标公式 DRAWRECTREL(0,0,400,988,IF(120,RGB(10,0,0),0));超 B:=L2_AMO(0,2)/10000.0;大B:=L2_AMO(1,2)/10000.0;中 B:=L2_AMO(2,2)/10000.0;小B:=L2_AMO(3,2)/10000.0;超 S:=L2_AMO(0,3)/10000.0;大S:=L2_AMO(1,3)/10000.0;中 S:=L2_AMO(2,3)/10000.0;小S:=L2_AMO(3,3)/10000.0;主买 A:=ACTINVOL,COLORRED,NODRAW;主卖 A:=ACTOUTVOL,COLORGREEN,NODRAW;主买:=主买 A*100/(主买A+主卖A),NODRAW,COLORRED;主卖:=主卖 A*100/(主买A+主卖 A),NODRAW,COLORGREEN;SAT:=(AMOUNT/C)/(HHV(AMO UNT,20)/HHV(C,20));【量能饱 和】:IF(SAT 1,1,SAT)*100,COLORYELLOW,NODRAW;主力净 买量:=(LARGEINTRDVOL-LARGEOUTTRDVOL),COLORYELLOW ,NODRAW;大宗净流入:=(超B+大B)-(超S+大 S),COLORRED,NODRAW;主动买卖 差:=(ACTINVOL-ACTOUTVOL),COLORMAGENTA,NODRAW; 主力资金 差:=((L2_AMO(0,0)+L2_AMO(1,0)-L2_AMO(0,1)-L2_AMO(1,1 )))/10000,COLORCYAN,NODRAW;DRAWRECTREL(100,0,90+ CONST(主买 *300/100),40,RGB(230,65,0));DRAWRECTREL(100,60,90+CO NST(主卖 *300/100),100,RGB(0,104,0));DRAWRECTREL(100,120,390,16 0,RGB(0,0,100));DRAWRECTREL(100,120,90+CONST(【量能饱 和】*300/100),160,RGB(250,104,0));大单动 向:=(LARGEINTRDVOL-LARGEOUTTRDVOL)*10000/FINANC E(7),NODRAW;T1:=IF(大单动向 0ANDREF(大单动 向,1)T2:=IF(大单动向 0ANDREF(大单动向,1) 0AND REF(大单动向,2)T3:=IF(大单动向 0ANDREF(大单动向,1) 0 ANDREF(大单动向,2) 0ANDREF(大单动向,3)T4:=IF(大单 动向 0ANDREF(大单动向,1) 0ANDREF(大单动向,2) 0 ANDREF(大单动向,3) 0ANDREF(大单动向,4)T5:=IF(大单 动向 0ANDREF(大单动向,1) 0ANDREF(大单动向,2) 0 ANDREF(大单动向,3) 0ANDREF(大单动向,4) 0AND REF(大单动向,5)T6:=IF(大单动向 0ANDREF(大单动向,1) 0 ANDREF(大单动向,2) 0ANDREF(大单动向,3) 0AND REF(大单动向,4) 0ANDREF(大单动向,5) 0ANDREF(大单 动向,6)T7:=IF(大单动向 0ANDREF(大单动向,1) 0AND REF(大单动向,2) 0ANDREF(大单动向,3) 0ANDREF(大单 动向,4) 0ANDREF(大单动向,5) 0ANDREF(大单动向,6) 0 ANDREF(大单动向,7)T8:=IF(大单动向 0ANDREF(大单动 .向,1) 0ANDREF(大单动向,2) 0ANDREF(大单动向,3) 0 ANDREF(大单动向,4) 0ANDREF(大单动向,5) 0AND REF(大单动向,6) 0ANDREF(大单动向,7) 0ANDREF(大单 动向,8)T9:=IF(大单动向 0ANDREF(大单动向,1) 0AND REF(大单动向,2) 0ANDREF(大单动向,3) 0ANDREF(大单 动向,4) 0ANDREF(大单动向,5) 0ANDREF(大单动向,6) 0 ANDREF(大单动向,7) 0ANDREF(大单动向,8) 0AND REF(大单动向,9)T:=IF(大单动向 0ANDREF(大单动向,1) 0 ANDREF(大单动向,2) 0ANDREF(大单动向,3) 0AND REF(大单动向,4) 0ANDREF(大单动向,5) 0ANDREF(大单 动向,6) 0ANDREF(大单动向,7) 0ANDREF(大单动向,8) 0 ANDREF(大单动向,9) 0,10,T9);D:=COUNT(大单动 向 0,10),NODRAW;DRAWTEXT_FIX(1,0.005,0.01,0,STRCAT(S TRCAT( 【主买比】: ,CON2STR(主买,1)), % )),COLORYELLOW;DRAWTEXT_FIX(1,0.005,0.07,0,STRCAT(ST RCAT( 【主卖比】: ,CON2STR(主卖,1)), % )),COLORGREEN;DRAWTEXT_FIX(1,0.005,0.13,0,STRCAT(STR CAT( 【量能饱和】: ,CON2STR(【量能饱和】,1)), % )),COLORYELLOW;DRAWTEXT_FIX(1,0.005,0.19,0,STRCAT(ST RCAT( 【主力资金差】: ,CON2STR(主力资金差,1)), 万元 )),COLORYELLOW;DRAWTEXT_FIX(1,0.2,0.19,0,STRCAT(STRC AT( 【大宗净流入】: ,CON2STR(大宗净流入,1)), 万元 N:=8;:M:=13;P:=60;S:=3; V1:=(C*2+H+L)/4*10; V2:=EMA(V1,13)-EMA(V1,34); V3:=EMA(V2,5); V4:=2*(V2-V3)*5.5; {主力开始出:IF(V4 =0,V4,0),COLOR00FF00,LINETHICK2;} 主力开始进:IF(V4 =0,V4,0){,COLORFF00FF,LINETHICK2}; {V5:=(HHV(INDEXH,8)-INDEXC)/(HHV(INDEXH,8)-LLV(INDEXL,8))*8; V6:=EMA(3*V5-2*SMA(V5,18,1),5); V7:=(INDEXC-LLV(INDEXL,8))/(HHV(INDEXH,8)-LLV(INDEXL,8))*10; V8:=(INDEXC*2+INDEXH+INDEXL)/4; V9:=EMA(V8,13)-EMA(V8,34); VA:=EMA(V9,3); VB:=(V9-VA)/2; 大资金进场:IF(VB =0,VB,0),COLORRED,LINETHICK2; 大资金撤走:IF(VB =0,VB,0),COLORBLUE,LINETHICK2;};[源码注释]通达信公式动态公式解读主线赋值:18主差赋值:2起初赋值:1主赋值:收盘价的起初日指数移动平均前N赋值:0B1赋值:1B2赋值:主差+1B3赋值:主差*2+1B4赋值:主差*3+1B5赋值:主差*4+1B6赋值:主差*5+1B7赋值:主差*6+1B8赋值:主差*7+1B9赋值:主差*8+1B10赋值:主差*9+1B11赋值:主差*10+1B12赋值:主差*11+1B13赋值:主差*12+1B14赋值:主差*13+1B15赋值:主差*14+1B16赋值:主差*15+1B17赋值:主差*16+1B18赋值:主差*17+1B19赋值:主差*18+1B20赋值:主差*19+1S1赋值:B1的主线日指数移动平均S2赋值:B2的主线日指数移动平均S3赋值:B3的主线日指数移动平均S4赋值:B4的主线日指数移动平均S5赋值:B5的主线日指数移动平均S6赋值:B6的主线日指数移动平均S7赋值:B7的主线日指数移动平均S8赋值:B8的主线日指数移动平均S9赋值:B9的主线日指数移动平均S10赋值:B10的主线日指数移动平均S11赋值:B11的主线日指数移动平均S12赋值:B12的主线日指数移动平均S13赋值:B13的主线日指数移动平均S14赋值:B14的主线日指数移动平均S15赋值:B15的主线日指数移动平均S16赋值:B16的主线日指数移动平均S17赋值:B17的主线日指数移动平均S18赋值:B18的主线日指数移动平均S19赋值:B19的主线日指数移动平均S20赋值:B20的主线日指数移动平均输出NOTETEXT1:前N日前的S1日内主的最高值,画绿色输出NOTETEXT2:前N日前的S2日内主的最高值,画绿色输出NOTETEXT3:前N日前的S3日内主的最高值,画绿色输出NOTETEXT4:前N日前的S4日内主的最高值,画绿色输出NOTETEXT5:前N日前的S5日内主的最高值,画绿色输出NOTETEXT6:前N日前的S6日内主的最高值,画绿色输出NOTETEXT7:前N日前的S7日内主的最高值,画绿色输出NOTETEXT8:前N日前的S8日内主的最高值,画绿色输出NOTETEXT9:前N日前的S9日内主的最高值,画绿色输出NOTETEXT10:前N日前的S10日内主的最高值,画绿色输出NOTETEXT11:前N日前的S11日内主的最高值,画绿色输出NOTETEXT12:前N日前的S12日内主的最高值,画绿色输出NOTETEXT13:前N日前的S13日内主的最高值,画绿色输出NOTETEXT14:前N日前的S14日内主的最高值,画绿色输出NOTETEXT15:前N日前的S15日内主的最高值,画绿色输出NOTETEXT16:前N日前的S16日内主的最高值,画绿色输出NOTETEXT17:前N日前的S17日内主的最高值,画绿色输出NOTETEXT18:前N日前的S18日内主的最高值,画绿色输出NOTETEXT19:前N日前的S19日内主的最高值,画绿色输出NOTETEXT20:前N日前的S20日内主的最高值,画绿色输出NOTETEXF1:前N日前的S1日内主的最低值,画红色输出NOTETEXF2:前N日前的S2日内主的最低值,画红色输出NOTETEXF3:前N日前的S3日内主的最低值,画红色输出NOTETEXF4:前N日前的S4日内主的最低值,画红色输出NOTETEXF5:前N日前的S5日内主的最低值,画红色输出NOTETEXF6:前N日前的S6日内主的最低值,画红色输出NOTETEXF7:前N日前的S7日内主的最低值,画红色输出NOTETEXF8:前N日前的S8日内主的最低值,画红色输出NOTETEXF9:前N日前的S9日内主的最低值,画红色输出NOTETEXF10:前N日前的S10日内主的最低值,画红色输出NOTETEXF11:前N日前的S11日内主的最低值,画红色输出NOTETEXF12:前N日前的S12日内主的最低值,画红色输出NOTETEXF13:前N日前的S13日内主的最低值,画红色输出NOTETEXF14:前N日前的S14日内主的最低值,画红色输出NOTETEXF15:前N日前的S15日内主的最低值,画红色输出NOTETEXF16:前N日前的S16日内主的最低值,画红色输出NOTETEXF17:前N日前的S17日内主的最低值,画红色输出NOTETEXF18:前N日前的S18日内主的最低值,画红色输出NOTETEXF19:前N日前的S19日内主的最低值,画红色输出NOTETEXF20:前N日前的S20日内主的最低值,画红色输出天值:NOTETEXT1和NOTETEXT2的较大值和NOTETEXT3的较大值和NOTETEXT4的较大值和NOTETEXT5的较大值和NOTETEXT6的较大值和NOTETEXT7的较大值和NOTETEXT8的较大值和?的较大值和?的较大值和?的较大值和?的较大值和?的较大值和?的较大值和?的较大值和?的较大值和?的较大值和?的较大值和?的较大值和OTETEXT9),NOTETEXT10),NOTETEXT11),NOTETEXT12),NOTETEXT13),NOTETEXT14),NOTETEXT15),NOTETEXT16),NOTETEXT17),NOTETEXT18),NOTETEXT19)的较大值,画黄色,线宽为3输出地值:NOTETEXF1和NOTETEXF2的较小值和NOTETEXF3的较小值和NOTETEXF4的较小值和NOTETEXF5的较小值和NOTETEXF6的较小值和NOTETEXF7的较小值和NOTETEXF8的较小值和?的较小值和?的较小值和?的较小值和?的较小值和?的较小值和?的较小值和?的较小值和?的较小值和?的较小值和?的较小值和?的较小值和OTETEXF9),NOTETEXF10),NOTETEXF11),NOTETEXF12),NOTETEXF13),NOTETEXF14),NOTETEXF15),NOTETEXF16),NOTETEXF17),NOTETEXF18),NOTETEXF19)的较小值,画绿色,线宽为3输出价格:收盘价,画红色,线宽为2当满足条件NOTETEXT1=NOTETEXT20的25日过滤时,在NOTETEXT1位置画23号图标,画黄色推荐阅读:通达信主力资金指标 A1:=EMA(C,14)COLORWHITE,LINETHICK1; A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW; 出击:IF(A1X =0,REF(EMA(C,14),BARSLAST(CROSS(A1X,0))+1 ),DRAWNULL)COLORRED,LINETHICK1; 休假:IF(A1X 0,REF(EMA(C,14),BARSLAST(CROSS(0,A1X))+1) ,DRAWNULL)COLORGREEN,LINETHICK1; STICKLINE(CROSS(A1X,0),C,O,2,0)COLORYELLOW; STICKLINE(CROSS(0,A1X),C,O,2,0)COLORGREEN; STICKLINE(CROSS(A1X,0)OR CROSS(0,A1X),REF(EMA(C,14),1),REF(EMA(C,14),1)*0.99 8,2,0)COLORWHITE; STICKLINE(ISLASTBAR,REF(EMA(C,14),1),REF(EMA(C,14), 1)*0.998,5,0)COLORWHITE; 工作线:=EMA(C,14); 止盈线:EMA(C,7),LINETHICK1,COLORGRAY; 工作区:IF(C =工作线ANDEMA(C,14) =EMA(C,25),工作 线,DRAWNULL),COLORRED,LINETHICK2; {准备区:IF(C =工作线ANDEMA(C,14)} 准备区:IF(C =工作线ANDEMA(C,14) 休息区:IF(CEMA(C,14),L*0.99,1); {DRAWICON(COUNT(CEMA(C,14)ANDCOUNT(C 止盈 线,6) =3,H*1.03,2);} DRAWICON(COUNT(CEMA(C,14)ANDCOUNT(C 止盈 线,6) =3,H*1.03,2); DRAWICON(CROSS(工作线,C)AND EMA(C,14) EMA(C,25),H*1.01,8);{止损位} IF(CROSS(生命线,工作 线),HIGH*1.04,DRAWNULL),CIRCLEDOT,COLORGREEN; N:=35;M:=35;N1:=3; B1:=(HHV(H,N)-C)/(HHV(H,N)-LLV(LOW,N))*100-M; B2:=SMA(B1,N,1)+100; B3:=(C-LLV(L,N))/(HHV(H,N)-LLV(L,N))*100; B4:=SMA(B3,3,1); B5:=SMA(B4,3,1)+100; B6:=B5-B2; 控盘程度:(IF(B6 N1,B6-N1+2,0))*,COLORYELLOW; 控盘度:100,COLORRED; STICKLINE(控盘程度,0,控盘程度,,0),COLOR00FFFF; STICKLINE(控盘程度AND控盘程度 100,100,控盘程 度,,0),COLORRED;主力状态 ZLCM:=EMA(WINNER(CLOSE)*70,3);{//主力筹码估算} SHCM:=EMA((WINNER(CLOSE*-WINNER(CLOSE*)*80,3);{//散 户筹码估算} ZSHTL:=SHCM/(ZLCM+SHCM)*100;{//散户套牢筹码比率} ZZLKP:=ZLCM/(ZLCM+SHCM)*100;{//主力控盘筹码比率} ZCMZL:=MA(ZLCM+SHCM,13);{//市场筹码总量} ZZNTS:=BARSLAST(ZSHTL90);{//走牛天数} ZSHJJ:=EMA(ZSHTL,89);{//散户警戒} ZZLJJ:=EMA(ZZLKP,89);{//主力警戒} ZJLRQD:=INTPART(ZZLKP-ZZLJJ);{//资金流入强度} SH8:=EMA(ZSHTL,8); DKB:=IF(ZZLKP-REF(ZZLKP,1) ZSHTL-REF(ZSHTL,1),1,0); {散户套牢筹码} STICKLINE(C 0,ZSHTL,ZZLKP,1,0),COLORFFFFFF; {散户筹码警戒} STICKLINE(ZSHJJ REF(ZSHJJ,1),ZSHTL,ZSHJJ,2,0),COLOR 00FF00; {主力控盘筹码} STICKLINE(C 0,ZZLKP,0,1,0),COLORA4A4A4; {筑顶风险区} STICKLINE(ZZLKP 75,ZZLKP,0,1,0),COLORFFFFFF; {顶部:(ZZLKP 75),COLORFFFFFF;} {主力筹码警戒} STICKLINE(ZZLJJ REF(ZZLJJ,1),ZZLKP,ZZLJJ,2,0),COLOR RED; {筑底散兵坑} STICKLINE(ZSHTL =90,ZZLKP,0,2,0),COLOR66FFCC; {底部:(ZSHTL =90),COLOR66FFCC;} {筹码总量上升} IF(ZCMZL,ZCMZL REF(ZCMZL,1),0),COLOR0066FF,LINETHIC K1; {增量资金}; 散户套牢系数:INTPART(ZSHTL),COLORCYAN,LINETHICK2; 主力控盘系数:INTPART(ZZLKP),COLORYELLOW,LINETHICK2; 资金流入强度:ZJLRQD,LINETHICK2,COLORRED; 资金流入强度 2:IF(ZJLRQD 10,ZJLRQD,0),LINETHICK2,COLORWHITE; 市场筹码总量:INTPART(ZCMZL),COLORWHITE,LINETHICK0; DRAWICON(CROSS(主力控盘系数,散户套牢系数),散户套牢 系数-5,11); DRAWICON(CROSS(资金流入强度,散户套牢系数),散户套牢 系数-5,17); M1:=5; M2:=10; ZLCM:=EMA(WINNER(CLOSE)*70,3);{//主力筹码估算} SHCM:=EMA((WINNER(CLOSE*1.1)-WINNER(CLOSE*0.9 ))*80,3);{//小筹码估算} ZSHTL:=SHCM/(ZLCM+SHCM)*100;{//小股民套牢筹码比 率} ZZLKP:=ZLCM/(ZLCM+SHCM)*100;{//主力控盘筹码比率} ZCMZL:=MA(ZLCM+SHCM,13);{//市场筹码总量} ZZNTS:=BARSLAST(ZSHTL90);{//走牛天数} ZSHJJ:=EMA(ZSHTL,89);{//小股民警戒} ZZLJJ:=EMA(ZZLKP,89);{//主力警戒} ZJLRQD:=INTPART(ZZLKP-ZZLJJ);{//资金流入强度} SH8:=EMA(ZSHTL,8); DKB:=IF(ZZLKP-REF(ZZLKP,1) ZSHTL-REF(ZSHTL,1),1,0 ); {//------【数值显示】} 散户套牢系数:INTPART(ZSHTL),NODRAW; 主力控盘系数:INTPART(ZZLKP),COLOR4080FF,NODRAW; 资金流入强度:ZJLRQD,NODRAW,COLOR00FFFF; {☆精确风险}{【参数定义】} RSV:=(CLOSE-LLV(LOW,15))/(HHV(HIGH,15)-LLV(LOW,1 5))*100; K1:=SMA(RSV,10,1); D1:=SMA(K1,5,1); KK:=INTPART(K1); DD0:=INTPART(D1); TFXXS:=KK+DD0;{//变异KD风险系数} TGLD:=MOD(TFXXS,10);{//踏浪涨停概率点} TGLXS:=(TFXXS-REF(TFXXS,1))*10;{//变异KD乖离系数} TYCFX:=TFXXS+TGLXS;{//变异KD预测风险} 乖离系数:TGLXS,LINETHICK0,COLORGREEN,NODRAW; {【图解模板】}{级别拐点}{乖离系数} STICKLINE(TGLXS 0,100,100+TGLXS,3,0),COLOR000088; STICKLINE(TGLXS 0,100,100+TGLXS,2.5,0),COLOR00009 STICKLINE(TGLXS 0,100,100+TGLXS,2,0),COLOR0000A A; STICKLINE(TGLXS 0,100,100+TGLXS,1.5,0),COLOR0000 BB; {STICKLINE(TGLXS 0,100,100+TGLXS,1.2,0),COLOR0000 CC;} STICKLINE(TGLXS 0,100,100+TGLXS,1.0,0),COLOR0000 DD; {STICKLINE(TGLXS 0,100,100+TGLXS,0.8,0),COLOR0000 EE;} STICKLINE(TGLXS 0,100,100+TGLXS,0.5,0),COLOR0000F F;{//红柱} STICKLINE(TGLXS 0,100,100+TGLXS,3,0),COLOR008800; {STICKLINE(TGLXS 0,100,100+TGLXS,2.8,0),COLOR0099 00;} STICKLINE(TGLXS 0,100,100+TGLXS,2.5,0),COLOR00AA 00; STICKLINE(TGLXS 0,100,100+TGLXS,2,0),COLOR00BB00 ; {STICKLINE(TGLXS 0,100,100+TGLXS,1.8,0),COLOR00C C00;} STICKLINE(TGLXS=0,100,100+TGLXS,8,0),COLORRED; STICKLINE(TGLXS=0ANDREF(TGLXS,1)REF(ZCMZL,1) ANDDKB=0); T3:=CONST(ZCMZL=REF(ZCMZL,1));