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

通达信源码:突破防线,趋势K线

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

突破防线:

VAR1Y:=(CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2));
VAR2Y:=(REF(VAR1Y,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR3Y:=(REF(VAR2Y,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR4Y:=(REF(VAR3Y,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR5Y:=(REF(VAR4Y,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR6Y:=(REF(VAR5Y,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR7Y:=(REF(VAR6Y,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR8Y:=(REF(VAR7Y,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR9Y:=(REF(VAR8Y,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VARAY:=(REF(VAR9Y,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VARBY:=(REF(VARAY,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VARCY:=(REF(VARBY,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VARDY:=(CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2));
VAREY:=(REF(VARDY,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VARFY:=(REF(VAREY,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR10Y:=(REF(VARFY,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR11Y:=(REF(VAR10Y,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR12Y:=(REF(VAR11Y,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR13Y:=(REF(VAR12Y,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR14Y:=(REF(VAR13Y,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR15Y:=(REF(VAR14Y,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR16Y:=(REF(VAR15Y,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR17Y:=(REF(VAR16Y,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR18Y:=(REF(VAR17Y,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR19Y:=((REF(VARDY OR VAREY OR VARFY OR VAR10Y OR VAR11Y OR VAR12Y OR VAR13Y OR VAR14Y OR VAR15Y OR VAR16Y OR VAR17Y OR VAR18Y,1)) AND VAR1Y);
VAR1AY:=((REF(VAR1Y OR VAR2Y OR VAR3Y OR VAR4Y OR VAR5Y OR VAR6Y OR VAR7Y OR VAR8Y OR VAR9Y OR VARAY OR VARBY OR VARCY,1)) AND VARDY);
红色持股:=VAR1Y OR VAR2Y OR VAR3Y OR VAR4Y OR VAR5Y OR VAR6Y OR VAR7Y OR VAR8Y OR VAR9Y OR VARAY OR VARBY OR VARCY,COLOR0000FF,NODRAW;
青色观望:=IF((VARDY OR VAREY OR VARFY OR VAR10Y OR VAR11Y OR VAR12Y OR VAR13Y OR VAR14Y OR VAR15Y OR VAR16Y OR VAR17Y OR VAR18Y),1,0);
品红离场:=VAR1AY,COLORFF99FF,NODRAW;
短买:=VAR19Y,COLOR33AACC,NODRAW;
急速超跌:=(CLOSE-MA(CLOSE,30))/MA(CLOSE,30)*100<-12,COLORFFFFFF,NODRAW;
STICKLINE(C>=O,L,H,0,0),COLOR0000CC;
STICKLINE(C<O,L,H,0,0),COLOR999900;
STICKLINE(1,C,O,3.5,0),COLOR858500;
STICKLINE(C>=O,C,O,3.5,0),COLOR0000E5;
STICKLINE(红色持股,CLOSE,O,4.8,0),COLOR0000AA;
STICKLINE(红色持股,CLOSE,O,3.5,0),COLOR0000CC;
STICKLINE(红色持股,CLOSE,O,2.5,0),COLOR0000EE;
STICKLINE(红色持股,CLOSE,O,1.5,0),COLOR0000FF;
STICKLINE(青色观望,CLOSE,O,4.8,0),COLORAAAA00;
STICKLINE(青色观望,CLOSE,O,3.5,0),COLORCCCC00;
STICKLINE(青色观望,CLOSE,O,2.5,0),COLOREEEE00;
STICKLINE(青色观望,CLOSE,O,1.5,0),COLORFFFF00;
CO:=(C-O);
STICKLINE(急速超跌,O,C-CO/2,3.0,1),COLOR999999;
STICKLINE(急速超跌,O,C-CO/2,2.0,0),COLORAAAAAA;
STICKLINE(急速超跌,O,C-CO/2,0.9,1),COLORCCCCCC;
STICKLINE(急速超跌,O,C-CO/2,0.0,0),COLOREEEEEE;
STICKLINE(短买,O,O+CO/3,3.0,1),COLOR338888;
STICKLINE(短买,O,O+CO/3,2.0,0),COLOR33AAAA;
STICKLINE(短买,O,O+CO/3,0.9,1),COLOR33CCCC;
STICKLINE(短买,O,O+CO/3,0,0),COLOR33EEEE;
STICKLINE(品红离场,O,O+CO/3,3.0,1),COLOR880088;
STICKLINE(品红离场,O,O+CO/3,2.0,0),COLOR880088;
STICKLINE(品红离场,O,O+CO/3,0.9,1),COLORAA00AA;
STICKLINE(品红离场,O,O+CO/3,0.05,0),COLOREE00EE;
五日线:MA(C,4),LINETHICK2;
五日线1:=MA(C,7),LINETHICK2;
二十线:MA(C,17),LINETHICK2;
九十线:MA(C,60),LINETHICK2;
涨:IF(二十线>REF(二十线,1),二十线,DRAWNULL),COLOR00009C,LINETHICK3;
平:=IF(二十线=REF(二十线,1),二十线,DRAWNULL),LINETHICK2;
跌:IF(二十线<REF(二十线,1),二十线,DRAWNULL),COLORGREEN,LINETHICK2;
SHORT:=12;
LONG:=26;
MID:=9;
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=EMA(DIF,MID);
MACD:=(DIF-DEA)*2,;
VR02:=DIF>DEA AND MACD>0;
VAR1:=EMA(CLOSE,2)-EMA(CLOSE,89)*1;
VAR2:=EMA(VAR1,30)*1;
VAR3:=2*(VAR1-VAR2)*10*1;
VAR4:=POW(VAR3,3)*0.1+POW(VAR3,2)*1;
VAR5:=SQRT(SQRT(LOW*HIGH*OPEN*CLOSE));
VAR6:=EMA(VAR5*0.97,3)*1;
VAR7:=(HIGH+LOW+CLOSE)/3*1;
VAR8:=(VAR7-MA(VAR7,12))/(0.015*AVEDEV(VAR7,12))*1;
VAR9:=IF(VAR3>0.015,VAR4,0)/45*1;
VAR10:=EMA(CLOSE,2)-EMA(CLOSE,150);
增量资金:=VAR9;
VAR11:=EMA(VAR10,100);
VAR12:=2*(VAR10-VAR11);
VAR13:=POW(VAR12,3)*0.1+POW(VAR12,1);
VAR1A:=SQRT(SQRT(LOW*HIGH*OPEN*CLOSE));
VAR1B:=EMA(VAR1A*0.97,3);
VAR1C:=(HIGH+LOW+CLOSE)/3;
VAR1D:=(VAR1C-MA(VAR1C,14))/(0.015*AVEDEV(VAR1C,14));
主力资金:=IF(VAR12>0.1,VAR13,0)*5,LINETHICK2,COLORYELLOW;
VR03:=增量资金>0 AND 主力资金>0;
M1:=5;
M2:=60;VOLUME:=VOL;
MAVOL1:=MA(VOLUME,M1);
MAVOL2:=MA(VOLUME,M2);
VR04:=MAVOL1>MAVOL2;
买点:=VR02 AND VR03 AND VR04;
BT01:=REF(MACD,1)<0 AND MACD>0;
BT02:=REF(MACD,2)<0 AND MACD>0;
BT03:=REF(MACD,3)<0 AND MACD>0;
BT123:=BT01 OR BT02 OR BT03;
VR1:=CROSS(五日线,二十线) AND 二十线>REF(二十线,1) AND 二十线<九十线 AND 买点;
DRAWICON(VR1,二十线*0.99,25),COLOR00FFFF,LINETHICK8;
DRAWTEXT(VR1,二十线*0.94,'基础进入'),COLORFF00FF,LINETHICK8;
 
VR1X:=CROSS(五日线,五日线1) AND C>O AND H/C<1.025 AND C>REF(C,1);
DRAWICON(VR1X,五日线1*0.98,25),COLOR00FFFF,LINETHICK2;
DRAWTEXT(VR1X,五日线1*0.95,'突破'),COLOR00FFFF,LINETHICK2;
 
VR2:=CROSS(五日线,九十线) AND 买点;
DRAWICON(VR2,九十线*0.98,26),COLOR00FFFF,LINETHICK8;
DRAWTEXT(VR2,九十线*0.935,'再加点'),COLOR00FFFF,LINETHICK2;
VR3:=CROSS(二十线,九十线) AND 买点;
DRAWICON(VR3 AND C>O*0.99,九十线*0.99,27),COLOR00FFFF,LINETHICK8;
DRAWTEXT(VR3 AND C>O*0.99,九十线*0.97,'赌全部'),COLORRED,LINETHICK8;
VR4:=CROSS(五日线,二十线) AND 二十线>REF(二十线,1) AND 二十线>九十线 AND 买点 AND BT123;
DRAWICON(VR4,二十线*0.99,24),COLOR00FFFF,LINETHICK8;
DRAWTEXT(VR4,二十线*0.95,'赌性质'),COLORRED,LINETHICK8;
C2:=REF(C,1);
涨停:=IF((C-C2)*100/C2>=(10-0.01*100/C2),0.8,0);
跌停:=IF((C2-C)*100/C2>=(10-0.01*100/C2),0.8,0);
STICKLINE(涨停,OPEN,CLOSE,2,0),COLORYELLOW;
STICKLINE(跌停,OPEN,CLOSE,2,0),COLORGREEN;
周K:="KDJ.K#WEEK"(9,3,3);
周D:="KDJ.D#WEEK"(9,3,3);
周J:="KDJ.J#WEEK"(9,3,3);
月K:="KDJ.K#MONTH"(9,3,3);
月D:="KDJ.D#MONTH"(9,3,3);
月J:="KDJ.J#MONTH"(9,3,3);
月金叉:=CROSS(月K,月D);
周金叉:=CROSS(周K,周D);
DRAWICON(周金叉,L-0.1,13),COLOR0022EE;
DRAWTEXT(周金叉,L-0.1,'周金叉'),COLOR00FFFF;
DRAWICON(月金叉,L-0.14,13),COLOR0022EE;
DRAWTEXT(月金叉,L-0.14,'月金叉'),COLOR00FFFF;
 
TYP:=(HIGH+LOW+CLOSE)/3;
NCC1:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
NC1:=SMA(NCC1,3,1);
NC2:=SMA(NC1,3,1);
NC3:=3*NC1-2*NC2;
CB1:=EMA(NC3,5);
CB2:=REF(CB1,1);
LC := REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
RSI:=(RSI1-50)*5,LINETHICK2,COLORYELLOW;
NR1:=SMA(RSI,3,1);
ND1:=SMA(NR1,3,1);
NJ1:=3*NR1-2*ND1;
RR1:=EMA(NJ1,5);
RR2:=REF(RR1,1);
RR:=RR1>RR2;
RSVQ:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
NK:=SMA(RSVQ,3,1);
NK1:=(NK-50)*5,COLORRED;
NK2:=SMA(NK1,3,1);
ND2:=SMA(NK2,3,1);
NJ2:=3*NK2-2*ND2;
NBB1:=EMA(NJ2,5);
NBB2:=REF(NBB1,1);
买N入:=RR AND NOT(REF(RR,1)) AND (NBB1<-100 AND NBB1<-100) AND CB1<-100;
DRAWICON(买N入,L-0.010,5);
卖N出:=REF(RR,1)=1 AND NOT(RR) AND CB1>100,LINETHICK0;
DRAWICON(卖N出,H+0.01,6);
M5:=MA(C,5);
M10:=MA(C,10);
M15:=MA(C,15);
TJ:=M5>REF(M5,1) AND M10>REF(M10,1) AND M15>=REF(M15,10);
T:=BARSLAST(CROSS(TJ,0.5));
TT:=BARSLAST(WEEKOFYEAR!=REF(WEEKOFYEAR,1));
HH:=MAX(MAX(M5,M10),M15);
LL:=MIN(MIN(M5,M10),M15);
NH:=HH/LL*100-100;
ZZF:=(C-REF(C,TT+1))/REF(C,TT+1)*100;
ZZF1:=REF(ZZF,TT+1);
TJ2:=CROSS(ZZF>20,0.5) OR CROSS(ZZF1>20,0.5);
JD:=(ATAN((M5/REF(M5,1)-1)*100)*180/3.1415926);
TJA:=ZZF1>0 AND ZZF1>0 ;
DT:=M10/M15*100-100>1 AND H/MAX(C,O)<1.03;
BL:=MIN(C,O)/M5;
BL5:=M5/M10*100-100;
XG:=TJ2 AND C=HHV(C,5) AND BETWEEN(T,0,5)AND TJA AND NH<12 AND DT AND BL<1.045  AND BL5<7.2 AND JD<77.5;
DRAWTEXT(CROSS(XG,0.5),L*0.98,'周线走好'),COLORYELLOW;
AR2:=(2*CLOSE+HIGH+LOW)/4; 
AR3:=IF(YEAR>=2099 AND MONTH>2,0,1); 
AR4:=LLV(LOW,5); AR5:=HHV(HIGH,4); 
散户:=EMA((AR2-AR4)/(AR5-AR4)*100,4)*AR3; 
庄家:=EMA(0.667*REF(散户,1)+0.333*散户,2)*AR3; 
DRAWTEXT(CROSS(散户,庄家) AND 散户<30,L-0.05,'←低吸'),COLORLIRED; 
DRAWTEXT(CROSS(庄家,散户) AND 散户>70,H+0.05,'←高抛'),COLORGREEN; 
买线:=EMA(CLOSE,2); 
卖线:=EMA(SLOPE(CLOSE,21)*20+CLOSE,42); 
B1:DRAWTEXT(CROSS(买线,卖线),L-0.02,'★跟进'),COLORYELLOW; 
DRAWTEXT_FIX(1,0.3,1,0,'K线红色是上升通道,绿色是下降通道!'),COLORFFDD44;




趋势K线:

VOL成交副图

股价趋势:= 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); 

底部警戒:=10,COLORRED,LINETHICK2;
底1:=CROSS(股价趋势,底部警戒);
A1:=(2*CLOSE+HIGH+LOW)/4;
A2:=LLV(LOW,27);
A3:=HHV(HIGH,27);
A4:=EMA((A1-A2)/(A3-A2)*100,13);
A5:=EMA(0.618*REF(A4,1)+0.382*A4,3);
底2:=CROSS(A4,A5) AND A4<16;
波底:=底1 AND 底2;
{奔牛}
VAR2:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;
VAR3:=SMA(SMA(VAR2,3,1),3,1)/28.57;
VAR4:=EMA(VAR3,5);
VAR5:=3*VAR3-2*VAR4;
牛:=CROSS(VAR5,VAR3) AND VAR3<2.1 AND C>O;
{逃顶提示}
VARA2:=LLV(LOW,10);
VARA3:=HHV(HIGH,25);
动力线:= EMA((CLOSE-VARA2)/(VARA3-VARA2)*4,4);
{突破与破位}
N:=19;
VARB1:=HHV(HIGH,N); 
VARB2:=LLV(LOW,N); 
阻力线:=EMA((CLOSE-VARB2)/(VARB1-VARB2),21)-0.5;
操作线:=EMA((CLOSE-VARB2)/(VARB1-VARB2),5)-0.5;
突破:=CROSS(操作线,阻力线) AND 阻力线<0.1;
破位:=CROSS(阻力线,操作线) AND 阻力线>0.25;
{立桩成立判断}
V2:=IF(CURRBARSCOUNT=1,VOL*240/FROMOPEN/REF(VOL,1)-1,VOL/REF(VOL,1)-1);
T12:=V2>=1;
T0:=BARSLAST(T12);
L1:=REF(L,T0);
H1:=REF(H,T0);
L11:=MIN(REF(L,1),L);
L10:=MIN(L11,REF(L,2));
L21:=MAX(REF(L,1),L);
L20:=MAX(L21,REF(L,2));
T111:=(REF(V2>=1,3) OR REF(V2>=1,2) OR REF(V2>=1,1)) AND 
((L10>L1 AND L20>H1) OR (L11>L1 AND L21>H1) OR (L>H1));
T11:=T111 AND REF(T111,1)=0;
{涨跌停}
C3:=REF(C,1);
涨停:=IF((C-C3)*100/C3>=(10-0.01*100/C3),1,0);
跌停:=IF((C3-C)*100/C3>=(10-0.01*100/C3),1,0);
{顶背离与底背离}
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);
顶背离:=CROSS(88,RSI);
底背离:=CROSS(FF,MA15);
{45度攻击}
X1:=(C+L+H)/3;
BB13:=ATAN(EMA(X1,13)-REF(EMA(X1,13),1))*3.1416*10;
EMA8:=EMA(C,8);
T1:=FILTER(BB13>1 AND EMA(X1,13)>REF(EMA(X1,8),1),10);
{获利盘提示}
获利盘:=WINNER(C)*100;
{彩色成交量柱线}
VOLUME:VOL,VOLSTICK;
MAVOL1:MA(VOLUME,5),COLORWHITE;
MAVOL2:MA(VOLUME,35),COLORYELLOW;MAVOL3:MA(VOLUME,135),COLORGREEN;
{V2:IF(CURRBARSCOUNT=1,VOL*240/FROMOPEN/REF(VOL,1)-1,VOL/REF(VOL,1)-1),NODRAW,COLORRED;}
STICKLINE(V2>=1,0,VOL*0.5,2,0),COLORYELLOW;
STICKLINE(动力线>=3.2,0,VOL,1,0),COLOR238E23;
STICKLINE(波底,0,VOL,2,0),COLORMAGENTA;
DRAWTEXT(波底,VOL*0.8,'底'),COLORWHITE;
DRAWICON(波底,VOL*1.1,5);
STICKLINE(牛,0,VOL,2,0),COLORRED;
DRAWTEXT(牛,VOL*1.15,'牛'),COLORWHITE;
STICKLINE(突破,0,VOL,1,0),COLORBLUE;
DRAWTEXT(突破,VOL*1.3,'←突破')COLORRED;
DRAWICON(突破,VOL*1.2,1);
STICKLINE(破位,0,VOL,0.5,0),COLORBROWN;
DRAWTEXT(破位,VOL*1.2,'破位'),COLORGREEN;
DRAWICON(破位,VOL*1.05,2);
STICKLINE(T11,O,VOL,2,0),COLORFF00FF;
STICKLINE(涨停,VOL*0.5,VOL,2.5,0),COLORLIRED;
STICKLINE(涨停,VOL*0.5,VOL,0,0),COLORRED;
DRAWTEXT(涨停,VOL*1.5,'涨'),COLORRED;
DRAWTEXT(涨停,VOL*1.2,'停'),COLORRED;
STICKLINE(跌停,VOL*0.5,VOL,2.5,0),COLOR2F4F2F;
STICKLINE(跌停,VOL*0.5,VOL,0,0),COLORBLACK;
STICKLINE(顶背离,VOL*0.8,VOL,2.5,0),COLORGREEN;
DRAWTEXT(顶背离,VOL*1.8,'顶'),COLORGREEN;
DRAWTEXT(顶背离,VOL*1.5,'背'),COLORGREEN;
DRAWTEXT(顶背离,VOL*1.2,'离'),COLORGREEN;
STICKLINE(底背离,0,VOL*0.2,3,0),COLOR7F017F;
DRAWTEXT(底背离,VOL*1.8,'底'),COLOR00FFFF;
DRAWTEXT(底背离,VOL*1.5,'背'),COLOR00FFFF;
DRAWTEXT(底背离,VOL*1.2,'离'),COLOR00FFFF;
DRAWTEXT(T1,VOL*1.1,'∠45'),COLOR007575;
DRAWTEXT(获利盘>=75 AND 动力线>=3.2,VOL*1.1,'●'),COLORRED;
DRAWTEXT(获利盘<75 AND 动力线>=3.2,VOL*1.1,'●'),COLORGREEN;

上一篇:通达信源码:精品买卖,进退自如,超级量能柱

下一篇:通达信公式下载:黑马狂奔,YX330原创选股指标,平台突破主图和选股