通达信变盘擒牛套装指标 短线及时介入跟随主力拉升 源码附图
{变盘擒牛源码如下}
X_1:=CLOSE>REF(OPEN,1) AND CLOSE>MA(CLOSE,60) AND OPEN<REF(CLOSE,1) AND REF(OPEN,1)>REF(CLOSE,1) AND (REF(CLOSE,2)-REF(CLOSE,1))*100/REF(CLOSE,2)>0.5;
LC:=REF((O+H+L+2*C)/5,1);
RSI:=SMA(MAX(C-LC,0),7,1)/SMA(ABS(C-LC),7,1)*10;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:=(TYP-MA(TYP,23))/(0.015*AVEDEV(TYP,23));
买:=CROSS(RSI,7.1) AND MA(V,5)>MA(V,10),COLORRED;
变盘擒牛:CROSS(RSI,7.1) AND MA(V,5)>MA(V,10)AND IF(CODELIKE('688'),0,1)AND C>REF(C,1)*1.05,COLORRED;
{变盘擒牛主图源码如下}
S:=2;N:=5;
STICKLINE(CLOSE>=REF(CLOSE,1),HIGH,LOW,0,1),COLORRED;
STICKLINE(CLOSE>=REF(CLOSE,1),OPEN,CLOSE,3,0),COLOR000066;
STICKLINE(CLOSE>=REF(CLOSE,1),OPEN,CLOSE,2.6,0),COLOR000099;
STICKLINE(CLOSE>=REF(CLOSE,1),OPEN,CLOSE,2,0),COLOR0000CC;
STICKLINE(CLOSE>=REF(CLOSE,1),OPEN,CLOSE,1.2,0),COLOR0000FF;
STICKLINE(CLOSE>=REF(CLOSE,1),OPEN,CLOSE,0.4,0),COLORCC66FF;
STICKLINE(CLOSE<REF(CLOSE,1),HIGH,LOW,0,1),COLORCYAN;
STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,3,0),COLORCC0000;
STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,2.6,0),COLORFF4400;
STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,2,0),COLORFF8800;
STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,1.2,0),COLORFFCC00;
STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,0.4,0),COLORCYAN;
TYX3:=MA(REF(HHV((C+L+O+H)/4,30),1),3);
STICKLINE(CROSS(MA(C,2),MA(C,7)),H,C,0.05,0),COLOR0000FF;
STICKLINE(CROSS(MA(C,2),MA(C,7)),C,O,3,0),COLORFF0099;
STICKLINE(CROSS(MA(C,2),MA(C,7)),O,L,0.05,0),COLOR0099FF;
XG1:=CROSS(MA(C,7),MA(C,2));
STICKLINE(XG1,H,L,3.5,0),LINETHICK1,COLORWHITE;
STICKLINE(XG1,H,L,0.2,0),COLORGREEN;
STICKLINE(XG1,O,C,3,0),LINETHICK1,COLORGREEN;
STICKLINE((C-REF(C,1))*100/REF(C,1)>=(10-0.01*100/REF(C,1)),OPEN,CLOSE,3,0),COLORFF00FF;
STICKLINE((REF(C,1)-C)*100/REF(C,1)>=(10-0.01*100/REF(C,1)),OPEN,CLOSE,3,0),COLORWHITE;
STICKLINE(REF(COUNT(C<TYX3,5)=5,1) AND C>TYX3 AND C>O,C,O,3.5,0),COLOR00CCFF;
P:=8;
KE:=V*(H-L)/REF(C,1);
KEP:=KE=HHV(KE,P);
KUD:=BARSLAST(KEP);
阻力1:REFDATE(REF(HHV(H,22),1),DATE),COLORGRAY;
底1:REFDATE(REF(LLV(L,22),1),DATE),COLORGRAY;
DMLJ:=HHV(H,120);
E:=(H+L+O+2*C)/5;
CRTP:=E+(H-L);
CRZL:=2*E-L;
CRZC:=2*E-H;
CRFZ:=E-(H-L);
CRXL:=(E+CRTP+CRZL+CRZC+CRFZ)/5;
高:=CONST(CRTP),COLORRED;
阻:=CONST(CRZL),COLORC7C9FF;
支:=CONST(CRZC),COLOR7C9CFF;
反:=CONST(CRFZ),COLORDD00DD;
心理:=CONST(CRXL);
高压:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,高,ISLASTBAR,高,1),COLOR0000FF;
阻力:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,阻,ISLASTBAR,阻,1),COLOR0099FF;
支撑:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,支,ISLASTBAR,支,1),COLORGREEN;
反转价:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,反,ISLASTBAR,反,1),COLORDD00DD;
次日心理价:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,心理,ISLASTBAR,心理,1),COLORFFFFFF;
DRAWTEXT(ISLASTBAR,反,'反转少量买'),LINETHICK1,COLORDD00DD;
DRAWTEXT(ISLASTBAR,支,'支撑'),LINETHICK1,COLOR00FF00;
DRAWTEXT(ISLASTBAR,阻,'阻力'),LINETHICK1,COLOR0099FF;
DRAWTEXT(ISLASTBAR,高,'高压'),LINETHICK1,COLOR0000FF;
T1:=CONST(LLVBARS(LOW,10));
T1HIGH:=CONST(REF(HIGH,T1));
CC:=CONST(CURRBARSCOUNT);
T2:=CONST(BARSLAST(CURRBARSCOUNT>CC+T1 AND H>T1HIGH));
T2HIGH:=CONST(REF(HIGH,T2));
T3:=CONST(BARSLAST(CURRBARSCOUNT>CC+T2 AND HIGH>T2HIGH));
T3HIGH:=CONST(REF(HIGH,T3));
猎击线:DRAWLINE(CURRBARSCOUNT=T3+1,T3HIGH,ISLASTBAR,T3HIGH,1),COLOR00FFFF,LINETHICK1;
DRAWTEXT(ISLASTBAR,T3HIGH,'买入')LINETHICK1,COLOR00FFFF;
IF(S=1,CRTP,DRAWNULL),COLORRED;
IF(S=1,CRZL,DRAWNULL),COLORC7C9FF;
IF(S=1,CRZC,DRAWNULL),COLOR7C9CFF;
IF(S=1,CRFZ,DRAWNULL),COLORDD00DD;
IF(S=1,CRXL,DRAWNULL),COLORFFDDFF;
AA17:=EMA(C,14)COLORWHITE,LINETHICK1;
A17X:=(AA17-REF(AA17,1))/REF(AA17,1)*100,NODRAW;
试买:IF(A17X>=0,REF(EMA(C,14),BARSLAST(CROSS(A17X,0))+1),DRAWNULL)COLORRED,LINETHICK2;
DRAWTEXT(ISLASTBAR,试买,'试买'),COLORYELLOW,LINETHICK4;
指平12:EXPMA(CLOSE,12),COLORGRAY,LINETHICK2;
指平33:EXPMA(CLOSE,33),COLORFF00FF,LINETHICK4;
IF(指平33<REF(指平33,1),指平33,DRAWNULL),COLOR00FF00,LINETHICK3;
LC:=REF((O+H+L+2*C)/5,1);
RSI:=SMA(MAX(C-LC,0),7,1)/SMA(ABS(C-LC),7,1)*10;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:=(TYP-MA(TYP,23))/(0.015*AVEDEV(TYP,23));
买:=CROSS(RSI,7.1) AND MA(V,5)>MA(V,10) ,COLORRED;
DRAWTEXT(CROSS(RSI,7.1) AND MA(V,5)>MA(V,10)AND IF(CODELIKE('688'),0,1)AND C>REF(C,1)*1.05,L,'◆变盘◆'),COLORWHITE;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
{变盘擒牛源码如下}X_1赋值:CLOSE>1日前的OPEN AND CLOSE>CLOSE的60日简单移动平均 AND OPEN<1日前的CLOSE AND 1日前的OPEN>1日前的CLOSE AND (2日前的CLOSE-1日前的CLOSE)*100/2日前的CLOSE>0.5
LC赋值:REF((O+H+L+2*C)/5,1)
RSI赋值:SMA(C-LC和0较大值,7,1)/SMA(C-LC的绝对值,7,1)*10
TYP赋值:(最高价+最低价+CLOSE)/3
CCI赋值:(TYP-TYP的23日简单移动平均)/(0.015*AVEDEV(TYP,23))
买赋值:RSI上穿7.1 AND V的5日简单移动平均>V的10日简单移动平均,COLORRED
输出变盘擒牛:RSI上穿7.1 AND V的5日简单移动平均>V的10日简单移动平均AND IF(CODELIKE('688'),0,1)AND C>1日前的C*1.05,COLORRED
{变盘擒牛主图源码如下}S:=2
N赋值:5
STICKLINE(CLOSE>=1日前的CLOSE,最高价,最低价,0,1),COLORRED
STICKLINE(CLOSE>=1日前的CLOSE,OPEN,CLOSE,3,0),COLOR000066
STICKLINE(CLOSE>=1日前的CLOSE,OPEN,CLOSE,2.6,0),COLOR000099
STICKLINE(CLOSE>=1日前的CLOSE,OPEN,CLOSE,2,0),COLOR0000CC
STICKLINE(CLOSE>=1日前的CLOSE,OPEN,CLOSE,1.2,0),COLOR0000FF
STICKLINE(CLOSE>=1日前的CLOSE,OPEN,CLOSE,0.4,0),COLORCC66FF
STICKLINE(CLOSE<1日前的CLOSE,最高价,最低价,0,1),COLORCYAN
STICKLINE(CLOSE<1日前的CLOSE,OPEN,CLOSE,3,0),COLORCC0000
STICKLINE(CLOSE<1日前的CLOSE,OPEN,CLOSE,2.6,0),COLORFF4400
STICKLINE(CLOSE<1日前的CLOSE,OPEN,CLOSE,2,0),COLORFF8800
STICKLINE(CLOSE<1日前的CLOSE,OPEN,CLOSE,1.2,0),COLORFFCC00
STICKLINE(CLOSE<1日前的CLOSE,OPEN,CLOSE,0.4,0),COLORCYAN
TYX3赋值:MA(REF(HHV((C+L+O+H)/4,30),1),3)
STICKLINE(CROSS(C的2日简单移动平均,C的7日简单移动平均),H,C,0.05,0),COLOR0000FF
STICKLINE(CROSS(C的2日简单移动平均,C的7日简单移动平均),C,O,3,0),COLORFF0099
STICKLINE(CROSS(C的2日简单移动平均,C的7日简单移动平均),O,L,0.05,0),COLOR0099FF
XG1赋值:CROSS(C的7日简单移动平均,C的2日简单移动平均)
当满足条件XG1时,在H和L之间画柱状线
当满足条件XG1时,在H和L之间画柱状线
当满足条件XG1时,在O和C之间画柱状线
STICKLINE((C-1日前的C)*100/1日前的C>=(10-0.01*100/1日前的C),OPEN,CLOSE,3,0),COLORFF00FF
STICKLINE((1日前的C-C)*100/1日前的C>=(10-0.01*100/1日前的C),OPEN,CLOSE,3,0),COLORWHITE
STICKLINE(1日前的统计5日满足CTYX3 AND C>O,C,O,3.5,0),COLOR00CCFF
P赋值:8
KE赋值:V*(H-L)/1日前的C
KEP赋值:KE=P日内KE最高值
KUD赋值:上次KEP距今天数
输出阻力1:REFDATE(REF(22日内H最高值,1),DATE),COLORGRAY
输出底1:REFDATE(REF(22日内L最低值,1),DATE),COLORGRAY
DMLJ赋值:120日内H最高值
E赋值:(H+L+O+2*C)/5
CRTP赋值:E+(H-L)
CRZL赋值:2*E-L
CRZC赋值:2*E-H
CRFZ赋值:E-(H-L)
CRXL赋值:(E+CRTP+CRZL+CRZC+CRFZ)/5
高赋值:CONST(CRTP),COLORRED
阻赋值:CONST(CRZL),COLORC7C9FF
支赋值:CONST(CRZC),COLOR7C9CFF
反赋值:CONST(CRFZ),COLORDD00DD
心理赋值:CONST(CRXL)
高压:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,高,ISLASTBAR,高,1),COLOR0000FF
阻力:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,阻,ISLASTBAR,阻,1),COLOR0099FF
支撑:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,支,ISLASTBAR,支,1),COLORGREEN
反转价:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,反,ISLASTBAR,反,1),COLORDD00DD
次日心理价:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,心理,ISLASTBAR,心理,1),COLORFFFFFF
当满足条件ISLASTBAR时,在反和'反转少量买'位置书写文字
当满足条件ISLASTBAR时,在支和'支撑'位置书写文字
当满足条件ISLASTBAR时,在阻和'阻力'位置书写文字
当满足条件ISLASTBAR时,在高和'高压'位置书写文字
T1赋值:CONST(LLVBARS(最低价,10))
T1最高价:=CONST(T1日前的最高价)
CC赋值:CONST(CURRBARSCOUNT)
T2赋值:CONST(上次CURRBARSCOUNT>CC+T1 AND H>T1最高价距今天数)
T2最高价:=CONST(T2日前的最高价)
T3赋值:CONST(上次CURRBARSCOUNT>CC+T2 AND 最高价>T2最高价距今天数)
T3最高价:=CONST(T3日前的最高价)
输出猎击线:DRAWLINE(CURRBARSCOUNT=T3+1,T3最高价,ISLASTBAR,T3最高价,1),COLOR00FFFF,LINETHICK1
当满足条件ISLASTBAR时,在T3最高价和'买入'位置书写文字
如果S=1返回CRTP否则返回DRAWNULL
如果S=1返回CRZL否则返回DRAWNULL
如果S=1返回CRZC否则返回DRAWNULL
如果S=1返回CRFZ否则返回DRAWNULL
如果S=1返回CRXL否则返回DRAWNULL
AA17赋值:C的14日指数移动平均COLORWHITE,LINETHICK1
A17X赋值:(AA17-1日前的AA17)/1日前的AA17*100,NODRAW
试输出买:IF(A17X>=0,REF(C的14日指数移动平均,上次A17X上穿0距今天数+1),DRAWNULL)COLORRED,LINETHICK2
当满足条件ISLASTBAR时,在试买和'试买'位置书写文字
输出指平12:CLOSE的12日指数移动平均,COLORGRAY,LINETHICK2
输出指平33:CLOSE的33日指数移动平均,COLORFF00FF,LINETHICK4
IF(指平33<1日前的指平33,指平33,DRAWNULL),COLOR00FF00,LINETHICK3
LC赋值:REF((O+H+L+2*C)/5,1)
RSI赋值:SMA(C-LC和0较大值,7,1)/SMA(C-LC的绝对值,7,1)*10
TYP赋值:(最高价+最低价+CLOSE)/3
CCI赋值:(TYP-TYP的23日简单移动平均)/(0.015*AVEDEV(TYP,23))
买赋值:RSI上穿7.1 AND V的5日简单移动平均>V的10日简单移动平均 ,COLORRED
DRAWTEXT(RSI上穿7.1 AND V的5日简单移动平均>V的10日简单移动平均AND IF(CODELIKE('688'),0,1)AND C>1日前的C*1.05,L,'◆变盘◆'),COLORWHITE