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

通达信源码:万能KDJ,ZYZT自用涨停,主升强度

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

1、万能KDJ

万能KDJ

VAR1:=((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100+(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100+(CLOSE-MA(CLOSE,32))/MA(CLOSE,32)*100)/3;
持币区域:VAR1,colorgreen;
持股区域:IF(VAR1>0,VAR1,0),colorred;
短顶:STICKLINE(VAR1>9 AND FILTER(VAR1<REF(VAR1,1),5),VAR1+2,0,3,0),colorgreen;
大顶:STICKLINE(VAR1>20 AND FILTER(VAR1<REF(VAR1,1),5),VAR1+5,0,7,0),COLOR00FF00;
VAR2:=HHV(VAR1>20,10);
危险: STICKLINE(VAR2 AND CROSS((REF(HIGH,1)+REF(LOW,1))/2,MA(CLOSE,20)+2*STD(CLOSE,20)),VAR1+10,0,4,0);
注意止损:STICKLINE(VAR2 AND FILTER(VAR1< REF(VAR1,1),6)
AND CROSS(MA(CLOSE,5),MA(CLOSE,2)),VAR1+6,0,3,0);
短底:STICKLINE(VAR1<-9 AND VAR1> REF(VAR1,1),VAR1-2,0,3,0),colorred;
大底:STICKLINE(VAR1<-20 AND FILTER(VAR1> REF(VAR1,1),5),VAR1-5,0,7,0),coloryellow;
买入准备:VAR1<-9 AND VAR1>REF(VAR1,1),coloryellow;//顶尖财经 股票学院: http://58188.com
DRAWTEXT(VAR1>9 AND FILTER(VAR1<REF(VAR1,1),5),VAR1+2,'短顶'),COLOR00FF00;
DRAWTEXT(VAR1>20 AND FILTER(VAR1<REF(VAR1,1),5),VAR1+5,'大顶'),COLORFFFF00;
DRAWTEXT(VAR2 AND CROSS((REF(HIGH,1)+REF(LOW,1))/2,MA(CLOSE,20)+2*STD(CLOSE,20)),VAR1+10,'危险'),COLOR00FFFF;
DRAWTEXT(VAR2 AND FILTER(VAR1< REF(VAR1,1),6) AND CROSS(MA(CLOSE,5),MA(CLOSE,2)),VAR1+6,'注意止损'),COLORFF00FF;
DRAWTEXT(FILTER(VAR1<-9 AND VAR1>REF(VAR1,1),18),VAR1-2,'短底'),,COLOR0000FF;
DRAWTEXT(VAR1<-20 AND FILTER(VAR1> REF(VAR1,1),5),VAR1-5,'大底'),;
DRAWTEXT(FILTER(VAR1<-9 AND VAR1>REF(VAR1,1),18),1,'买入准备');
 
N1:=9;N2:=5;
MTM:=C-REF(C,1);
主力:100*EMA(EMA(MTM,N1),N1)/EMA(EMA(ABS(MTM),N1),N1),colormagenta;



2、ZYZT自用涨停

AAA:=(3*C+H+L+O)/6;
VAR1:=(8*AAA+7*REF(AAA,1)+6*REF(AAA,2)+5*REF(AAA,3)+4*REF(AAA,4)+3*REF(AAA,5)+2*REF(AAA,6)+REF(AAA,8))/36;
VAR2:=(HHV(VAR1,5)+HHV(VAR1,10)+HHV(VAR1,20))/3;
VAR3:=(LLV(VAR1,5)+LLV(VAR1,10)+LLV(VAR1,20))/3;
VAR4:=(HHV(VAR2,5)+HHV(VAR2,10)+HHV(VAR2,20))/3;
VAR5:=(LLV(VAR3,5)+LLV(VAR3,10)+LLV(VAR3,20))/3;
VAR6:=(LLV(VAR1,2)+LLV(VAR1,4)+LLV(VAR1,6))/3;
DRAWBAND(VAR1,RGB(155,50,50),VAR6,RGB(250,250,0));
短线:VAR1,COLORWHITE;
中线:VAR6,COLORYELLOW;
下跌:IF(VAR1=VAR6,VAR6,DRAWNULL),COLORGREEN;
TJ1:=VOL=HHV(VOL,10)AND VOL>2*REF(VOL,1)AND CLOSE>VAR1;
获利盘%:WINNER(CLOSE)*100,NODRAW,COLORMAGENTA;
套牢盘%:(1-WINNER(C))*100,NODRAW,COLORFF9933;
 
AA05:=MA(C,5),LINETHICK3,COLOR0099CC;
五日乖离率:=(C-AA05)/AA05*100;
BB05:=ATAN((AA05/REF(AA05,1)-1)*100)*180/3.1416;
速度5:=SMA(EMA((AA05-REF(AA05,1))/REF(AA05,1),3)*100,3,1);
加速度5:EMA((速度5-REF(速度5,1)),3),NODRAW;
 
{倍量柱成立分析}
短趋:= (8*AAA+7*REF(AAA,1)+6*REF(AAA,2)+5*REF(AAA,3)+4*REF(AAA,4)+3*REF(AAA,5)+2*REF(AAA,6)+REF(AAA,8))/36;
中趋:=(LLV(短趋,2)+LLV(短趋,4)+LLV(短趋,6))/3;
{STICKLINE(C>中趋,短趋,中趋,0,0),COLORYELLOW;}
TTJ1:=VOL=HHV(VOL,10) AND VOL>2*REF(VOL,1) AND CLOSE>短趋;
立桩量:=FILTER(TTJ1,5);
TTJ2:=IF(BARSLAST(立桩量)=1 AND CLOSE>REF(HIGH,1),1,IF(BARSLAST(立桩量)=2 AND CLOSE>REF(HIGH,2),1,IF(BARSLAST(立桩量)=3 AND CLOSE>REF(HIGH,3),1,0)));
突破:=TTJ2=1;
TTJ3:=IF(BARSLAST(立桩量)=1 AND CLOSE>REF(LOW,1),1,IF(BARSLAST(立桩量)=2 AND CLOSE>REF(LOW,2),1,IF(BARSLAST(立桩量)=3 AND CLOSE>REF(LOW,3),1,0)));
三天法则:=TTJ3=1;
成立:=三天法则 AND 突破;
条件成立:=FILTER(成立,3);
{DRAWICON(条件成立,L*0.91,1);}
DRAWTEXT(条件成立,L*0.998,'立桩成立'),COLORYELLOW;
 
{45度角上涨}
X1:=(C+L+H)/3;
BB13:=ATAN(EMA(X1,13)-REF(EMA(X1,13),1))*3.1416*10;
EMA8:=EMA(C,8);
DRAWTEXT(FILTER(BB13>1 AND EMA(X1,13)>REF(EMA(X1,8),1),10),
EMA8,'∠45升'),COLORWHITE;
 
{绝密买点}
A81:=EMA(C,3),COLORWHITE;
A82:=EMA(C,5),COLORYELLOW;
A83:=EMA(C,7),COLORMAGENTA;
A84:=EMA(C,12),COLORGREEN;
A85:=EMA(C,20),COLORRED;
A86:=EMA(C,50),COLORBLUE,LINETHICK2;
SS8:=CROSS(A81,A85)  AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018 ;
SSS8:=CROSS(A81,A85)  AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018;
DRAWICON(SS8 ,L-0.04,23);
{DRAWTEXT(SS8,L-0.38,'↖绝密买点'),COLORYELLOW;};
 
{龙出海}
Y:=(MA(C,5)-MA(C,30))/MA(C,5)*100;
YY1:=C>MA(C,5) AND OPEN<MA(C,5);{龙出海} 
YY3:=C>MA(C,10) AND OPEN<MA(C,10);
YY5:=C>MA(C,30) AND OPEN<MA(C,30);
DRAWTEXT(YY1 AND YY5 AND YY3,LOW-0.03,'↖龙出大海'),COLORRED;
 
{BIAS顶底}
{BIAS1:=(C-MA(C,6))/MA(C,6)*100;
BIAS2:=(C-MA(C,12))/MA(C,12)*100;
BIAS3:=(C-MA(C,24))/MA(C,24)*100;
BIAS:=(BIAS1+2*BIAS2+3*BIAS3)/6;
乖离:=MA(BIAS,3);
DRAWTEXT(CROSS(BIAS,乖离)  AND 乖离<-9,C,'---------BIAS底买'),COLORWHITE;
DRAWTEXT(CROSS(BIAS,乖离)  AND 乖离>3,C,'---------BIAS顶'),COLORWHITE;}
 
A:=(3*C+L+O+H)/6;
X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+REF(A,20))/210;
主力成本:EMA(X,13),COLORFF00FF,LINETHICK0;
ZZ:=(O+H+L)/3;
YC:=(H+L)/2;
YCHJX:=(EMA(ZZ,4))+(YC-REF(ZZ,3))/4;
今日买点:EMA(ZZ,3),COLORYELLOW,LINETHICK0; 
明日买点:YCHJX,LINETHICK0;
昨测今日买点:REF(YCHJX,1),LINETHICK0;
 
BBI:=(MA(CLOSE,M1)+MA(CLOSE,M2)+MA(CLOSE,M3)+MA(CLOSE,M4))/4;
IF(BBI>REF(BBI,1),BBI,DRAWNULL),COLORRED,LINETHICK2,NODRAW;
IF(BBI<REF(BBI,1),BBI,DRAWNULL),COLORYELLOW,LINETHICK2,NODRAW;
MA1:=MA(CLOSE,24),COLOR00E300,LINETHICK1;
V2:=IF(CURRBARSCOUNT=1,VOL*240/FROMOPEN/REF(VOL,1)-1,VOL/REF(VOL,1)-1);
STICKLINE(V2>=1,O,C,2,0),COLORMAGENTA;
MA13:=MA(CLOSE,13);
A1:=MIN(O,C);
B1:=ABS(O-C);
T1:=FILTER(BB13>1 AND EMA(X1,13)>REF(EMA(X1,8),1),10);
STICKLINE(T1,A1,A1+B1/4,2,0),COLOR007575;
STICKLINE(T1,A1+B1/4,A1+B1/2,2,0),COLORFF0000;
STICKLINE(T1,A1+B1/2,A1+B1*3/4,2,0),COLOR007575;
STICKLINE(T1,A1+B1*3/4,A1+B1,2,0),COLORFF0000;
LC:=REF(CLOSE,1);
RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
FF:=EMA(CLOSE,3);
MA15:=EMA(CLOSE,21);
{DRAWTEXT(CROSS(FF,MA15),(LOW * 0.97),'底背离'),COLORA6E500;
DRAWTEXT(CROSS(88,RSI),(HIGH * 1.04),'顶背离'),COLOR1880FF;}
STICKLINE(CROSS(FF,MA15),A1,A1+B1/2,2,0),COLOR7F017F;
STICKLINE(CROSS(88,RSI),A1+B1,A1+B1/2,2,0),COLORGREEN;
T2:=COUNT(CROSS(BBI,3),3)=1 AND CROSS(C,BBI);
DRAWTEXT(T2,H*1.05,'反转'),COLORWHITE;
STICKLINE(T2,O,C,2,0),COLORRED; 
 
A23:=((C + L) + H) / 3;
A24:=EMA(A23,6);
A25:=EMA(A24,5);
A26:=CROSS(A24,A25);
DRAWICON(A26,(L/1.01),30),LINETHICK2,COLORMAGENTA;
 
{涨停统计}
涨停:=CLOSE/REF(CLOSE,1)>=1.095;
ZTCS:=COUNT(涨停,BARSSINCE(涨停)+1);
DRAWNUMBER(涨停,HIGH*1.04,ZTCS),COLORYELLOW;
GZT1:=STRCAT(' 共涨停: ',CON2STR(ZTCS,0));
GZT2:=STRCAT(GZT1,'次');
SSTS1:=STRCAT(' 上市: ',CON2STR(FINANCE(42),0));
SSTS2:=STRCAT(SSTS1,'天');
NTZZT1:=STRCAT(' 距今:',CON2STR(CONST(BARSLAST(涨停)),0));
NTZZT2:=STRCAT(NTZZT1,'天有涨停');
ZTTJ1:=STRCAT(SSTS2,GZT2);
ZTTJ2:=STRCAT(ZTTJ1,NTZZT2);
ZTTJ:=STRCAT('★涨停统计★',ZTTJ2);
DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0,0,ZTTJ),COLOR999999;
 
{连阳公式}
阳涨幅:=4;
阳倍量:=1.5;
单阳:=C>O*(1+阳涨幅/100) AND VOL>REF(VOL,1)*阳倍量;
DRAWTEXT(CURRBARSCOUNT<100 AND 单阳,L*0.98,'阳'),COLOR00FFFF;
高不破价:=REF(C,BARSLAST(单阳));
中不破价:=REF((C+L)/2,BARSLAST(单阳));
低不破价:=REF(L,BARSLAST(单阳));
单阳不破:=CURRBARSCOUNT<100 AND BARSLAST(单阳)<11 AND (LLV(L,BARSLAST(单阳))>低不破价 OR LLV(L,BARSLAST(单阳))=低不破价);
STICKLINE(单阳不破,低不破价-低不破价*0.003,低不破价,0.1,0),COLORRED;
DRAWTEXT(BARSLAST(单阳)=1 AND 单阳不破,低不破价*0.98,'1'),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=2 AND 单阳不破,低不破价*0.98,'2'),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=3 AND 单阳不破,低不破价*0.98,'3'),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=4 AND 单阳不破,低不破价*0.98,'4'),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=5 AND 单阳不破,低不破价*0.98,'5'),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=6 AND 单阳不破,低不破价*0.98,'6'),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=7 AND 单阳不破,低不破价*0.98,'7'),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=8 AND 单阳不破,低不破价*0.98,'8'),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=9 AND 单阳不破,低不破价*0.98,'9'),COLORGREEN;
DRAWTEXT(BARSLAST(单阳)=10 AND 单阳不破,低不破价*0.98,'10'),COLORGREEN;
 
{DRAWTEXT_FIX(C>0,0.001,0.045,0,STRCAT('金库提示:  ',EXTERNSTR(0,972))),COLOR999999;
DRAWTEXT_FIX(C>0,0.001,0.085,0,STRCAT('千股千评:  ',EXTERNSTR(0,991))),COLOR999999;
DRAWTEXT_FIX(C>0,0.001,0.125,0,STRCAT('分配预案:  ',EXTERNSTR(0,992))),COLOR999999;
DRAWTEXT_FIX(C>0,0.001,0.165,0,STRCAT('主题投资:  ',EXTERNSTR(0,993))),COLOR999999;
DRAWTEXT_FIX(C>0,0.001,0.205,0,STRCAT('业绩预告:  ',EXTERNSTR(0,994))),COLOR999999;
DRAWTEXT_FIX(C>0,0.001,0.245,0,STRCAT('转送公告:  ',EXTERNSTR(0,995))),COLOR999999;}
 
MA30:=MA(C,30);
支撑价:MA(REF(LLV(C,30),1),2),DOTLINE,COLORFF00FF;
DRAWTEXT(ISLASTBAR,支撑价,'------支撑'),COLORFF00FF;
压力价:MA(REF(HHV(C,30),1),2),DOTLINE,COLORGREEN;
DRAWTEXT(ISLASTBAR,压力价,'------压力'),COLORGREEN;
短线交易:MA(REF(LLV(C,3),1),2),DOTLINE,COLORRED;
DRAWTEXT(ISLASTBAR,短线交易,'------短买'),COLORRED;
 
{突破盘整}
{W1:=C=HHV(C,20);
W2:=BARSLAST(W1);
W3:=IF(W2>0,REF(C,W2),REF(C,W2));
W4:=CROSS(C,REF(W3,1));
突破盘整:=W4 AND COUNT(W4,5)=1;
DRAWTEXT(突破盘整>0,L*0.996,'↖突破盘整'),COLORWHITE;}
 
{龙虎显示}
HG00:='●龙 ';
HG03:='●构 ';
LHB:=SIGNALS_USER(490,0)>0 OR SIGNALS_USER(491,0)<0;  {龙虎榜净买入额}
JGZY:=SIGNALS_USER(498,0)>0 OR SIGNALS_USER(499,0)<0;{判断-----机构专用};
DRAWTEXT(JGZY, L*0.978, HG03 ),COLORCYAN;
DRAWTEXT(LHB,  L*0.996, HG00 ),COLORYELLOW;
 
{量能平台}
N1:=10;
TK:=CONST(HHVBARS(V,10)),COLOR0000FF,LINETHICK1;
量能平台:=IF(CURRBARSCOUNT<=N1+3,CONST(IF(TK=0,C,REF(C,TK))),DRAWNULL),COLORGRAY,LINETHICK1,NODRAW;
NOTEXT_新量能点:IF(CURRBARSCOUNT=TK+1,量能平台,DRAWNULL),CIRCLEDOT,COLOR00FFFF,LINETHICK9;
{DRAWTEXT(ISLASTBAR,量能平台,' 量能平台'),COLORGRAY;};
 
{关键位预测}
关键位:REFDATE((MA(C,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4,DATE),DOTLINE,COLOR999999,LINETHICK1;
DRAWTEXT(ISLASTBAR,关键位,STRCAT('【关键位: ',STRCAT(CON2STR(关键位,2),' 元】'))),COLOR00FFFF;
 
{海底捞月主图公式}
VARC:=HIGH>LOW*1.0505;
HDLY1:=OPEN/HHV(CLOSE,30)<0.78 AND OPEN=LLV(OPEN,30);
HDLY2:=CLOSE>REF(CLOSE,1)*1.005;
HDLY:=HDLY1 AND HDLY2 AND COUNT(VARC,5)>1;
DRAWICON(HDLY,LOW*0.95,30);
DRAWTEXT(HDLY,LOW*0.98,'海底'),COLORYELLOW;




3、主升强度

{公式名称: 主升强度

公式描述: 
无参数
公式类型: 技术指标公式-其他类型
画线方法: 副图
公式版本: 0
显示小数: 缺省位数
坐标线位置: 自动
额外Y轴分界: 无
 
参数精灵:无
用法注释:无
公式源码:}
XA_1:=120;
XA_2:=1;
XA_3:=LLV(LOW,XA_1);
XA_4:=HHV(HIGH,XA_1);
XA_5:=100*(CLOSE-XA_3)/(XA_4-XA_3);
个股强度:MA(XA_5,XA_2);
XA_6:=LLV(INDEXL,XA_1);
XA_7:=HHV(INDEXH,XA_1);
XA_8:=100*(INDEXC-XA_6)/(XA_7-XA_6);
大盘强度:MA(XA_8,XA_2);
弱势线:20;
强势线:80;
IF(个股强度>=80,个股强度,DRAWNULL),LINETHICK2;
异动点:(CROSS(个股强度,大盘强度) AND 个股强度>10 AND BARSLASTCOUNT(个股强度>10)>3)*100;


选股公式的源码:
 
{公式名称: 主升强度选股
公式描述: 
无参数
公式类型: 条件选股公式-其他类型
公式版本: 0
 
参数精灵:无
用法注释:无
公式源码:}
XA_1:=120;
XA_2:=1;
XA_3:=LLV(LOW,XA_1);
XA_4:=HHV(HIGH,XA_1);
XA_5:=100*(CLOSE-XA_3)/(XA_4-XA_3);
XA_6:=MA(XA_5,XA_2);
XA_7:=LLV(INDEXL,XA_1);
XA_8:=HHV(INDEXH,XA_1);
XA_9:=100*(INDEXC-XA_7)/(XA_8-XA_7);
XA_10:=MA(XA_9,XA_2);
XA_6>80;

上一篇:通达信源码:地量爆发,仿预测赢家测上升阻力,大财女变线

下一篇:通达信公式下载:吸筹买点,切线永久版,盘古系列公式